Merge "[BugFix] acquireProvider maybe wait for timeout"

This commit is contained in:
Jing Ji
2022-04-19 04:31:57 +00:00
committed by Gerrit Code Review

View File

@@ -7026,7 +7026,13 @@ public final class ActivityThread extends ClientTransactionHandler
// local, we'll need to wait for the publishing of the provider.
if (holder != null && holder.provider == null && !holder.mLocal) {
synchronized (key.mLock) {
key.mLock.wait(ContentResolver.CONTENT_PROVIDER_READY_TIMEOUT_MILLIS);
if (key.mHolder != null) {
if (DEBUG_PROVIDER) {
Slog.i(TAG, "already received provider: " + auth);
}
} else {
key.mLock.wait(ContentResolver.CONTENT_PROVIDER_READY_TIMEOUT_MILLIS);
}
holder = key.mHolder;
}
if (holder != null && holder.provider == null) {