Fix lost singleton provider after force-stopping user or package.

Case 1 (name == null):
Switch user from guest to owner. All processes of guest
will be killed, it will not include processes which singleton
components live in, but singleton provider records are still
collected and removed.

When the user switch is complete and the process of removed
singleton provider is still alive, there is someone access
the provider, it will create a new ContentProviderRecord and
wait but no one will notify it because the provider process
is alive with different ContentProviderRecord.

Then the access cannot get response unless the process of target
provider is died and restarted.

Case 2 (name != null):
Switch to another non-guest user, launch an application which
contains singleton provider. Go to Settings to force-stop the
package then switch back to owner user. Launch an application
which will access the singleton provider. It will also cannot
get response that similar as case 1.

Solution:
Only collect singleton provider if target user is all or owner.

Change-Id: Ic6828da66645172d1378cfb1f66d092df5966516
1 file changed