If you use acquireContentProviderClient then your process will be killed if the content provider dies.
If you use acquireUnstableContentProviderClient then your process will not be killed if the content provider dies - instead you get a DeadObjectException - which you need to handle in your code.
You will need to write additional code with an unstable version to handle recovery when you receive a DeadObjectException . You can see the default android implementation for the query method in ContentResolver.java
As I understand it, your application will not leak due to the use of an unstable version.
As for why you did not decide to use the unstable version always - I consider it the other way around. Very few applications will need to be processed and restored due to a failure of the content provider. The easiest approach is to let your application die and restart. Content provider crashes should be extremely rare: memory corruption, disk corruption, etc. Unless you have your own provider, which is expected to crash for some specific / strange reason, you will not need to use an unstable version.
This disables the mechanism in the platform cleanup processes, which are dependent on the content provider if that content provider leaves.
It is the logic of the platform to kill all the processes that use the content provider. This means that your application will not be killed if you use an unstable version.
Rocketandom
source share