title: Why do android kills the client process which holds the cursor on content provider on another process in this case?
body: <p>My app runs in Process1 and I'm using a content provider provided by another app which runs under Process2. When Process2 kills it's causing my app which runs under Process1 to be killed.</p>
  
  <pre><code>09-14 23:31:52.583   782  1351 I ActivityManager: Killing 11797:com.example.myapp/1000 (adj 100): depends on provider com.example.exampleapp/com.example.exampleapp.MyContentProvider in dying proc com.example.exampleapp (adj 100)
  09-14 23:31:52.585   782   812 W libprocessgroup: kill(-11797, 9) failed: No such process
  09-14 23:31:52.585   782   812 I libprocessgroup: Successfully killed process cgroup uid 1000 pid 11797 in 0ms
  09-14 23:31:52.623   368   368 I Zygote  : Process 11797 exited due to signal (9)
  </code></pre>
  
  <p>I came across this <a href="https://stackoverflow.com/a/46195263/6680585">good answer in SO</a> which basically explains what would happen when we have content observer vs query on the content provider.</p>
  
  <p>But I'm not clear why even android killing the entire process. Why this cant' be handled at application level with the help of <code>DeadObjectException</code> which we face similarly when interacting with a binder service running on other process and it goes down.</p>
  
  <p>I agree that Android provides an alternative to handle this with the help of acquiring <code>unstableContentProviderClient</code> but I'm not convinced why do they need to kill the client process? I'm worried because not only the content provider query source will be running in the process - there can be other logic running in that process. Why the framework is killing the app and restarting it?</p>