Merge "Fix a race condition in acquiring content provider" into sc-dev
This commit is contained in:
@@ -501,7 +501,6 @@ public class ContentProviderHelper {
|
|||||||
|
|
||||||
mService.grantImplicitAccess(userId, null, callingUid,
|
mService.grantImplicitAccess(userId, null, callingUid,
|
||||||
UserHandle.getAppId(cpi.applicationInfo.uid));
|
UserHandle.getAppId(cpi.applicationInfo.uid));
|
||||||
}
|
|
||||||
|
|
||||||
if (caller != null) {
|
if (caller != null) {
|
||||||
// The client will be waiting, and we'll notify it when the provider is ready.
|
// The client will be waiting, and we'll notify it when the provider is ready.
|
||||||
@@ -529,10 +528,12 @@ public class ContentProviderHelper {
|
|||||||
ContentResolver.CONTENT_PROVIDER_READY_TIMEOUT_MILLIS);
|
ContentResolver.CONTENT_PROVIDER_READY_TIMEOUT_MILLIS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Return a holder instance even if we are waiting for the publishing of the provider,
|
// Return a holder instance even if we are waiting for the publishing of the
|
||||||
// client will check for the holder.provider to see if it needs to wait for it.
|
// provider, client will check for the holder.provider to see if it needs to wait
|
||||||
|
// for it.
|
||||||
return cpr.newHolder(conn, false);
|
return cpr.newHolder(conn, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Because of the provider's external client (i.e., SHELL), we'll have to wait right here.
|
// Because of the provider's external client (i.e., SHELL), we'll have to wait right here.
|
||||||
// Wait for the provider to be published...
|
// Wait for the provider to be published...
|
||||||
|
|||||||
Reference in New Issue
Block a user