From 6e721e1103c63fda74ffd64823f4b08e784b2711 Mon Sep 17 00:00:00 2001 From: Jing Ji Date: Fri, 14 Feb 2020 20:18:20 -0800 Subject: [PATCH] Fix spurious "Timeout waiting for provider" There is a race that if two clients are acquiring the same content provider at the same momment, the second one would create a new ContentProviderRecord and then start a new process. Bug: 148953992 Test: Manual Change-Id: I3e95be32208a0869dc0b399da70f767abdd76fb4 --- .../core/java/com/android/server/am/ActivityManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index ad550c5cedecb..68de2c61ca87d 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -7156,7 +7156,7 @@ public class ActivityManagerService extends IActivityManager.Stub } finally { Binder.restoreCallingIdentity(ident); } - } else if (dyingProc == cpr.proc) { + } else if (dyingProc == cpr.proc && dyingProc != null) { // The old stable connection's client should be killed during proc cleaning up, // so do not re-use the old ContentProviderRecord, otherwise the new clients // could get killed unexpectedly.