[BugFix] acquireProvider maybe wait for timeout

Test: manual
Change-Id: Iaeb951ad8dda333e660a66a138e2cc80f9dbd6a0
This commit is contained in:
Guanyou Chen
2022-02-24 19:01:12 +00:00
parent b667621f8b
commit 036d3ce1a9

View File

@@ -6989,7 +6989,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) {