am a12ac54c: am 25596374: Merge "[ActivityManager] Prevent provider from been created twice."

* commit 'a12ac54cf69c0c8cfec6fa7c14176b714cae7107':
  [ActivityManager] Prevent provider from been created twice.
This commit is contained in:
Craig Mautner
2014-12-01 05:27:00 +00:00
committed by Android Git Automerger

View File

@@ -9339,11 +9339,13 @@ public final class ActivityManagerService extends ActivityManagerNative
if (DEBUG_PROVIDER) {
Slog.d(TAG, "Installing in existing process " + proc);
}
checkTime(startTime, "getContentProviderImpl: scheduling install");
proc.pubProviders.put(cpi.name, cpr);
try {
proc.thread.scheduleInstallProvider(cpi);
} catch (RemoteException e) {
if (!proc.pubProviders.containsKey(cpi.name)) {
checkTime(startTime, "getContentProviderImpl: scheduling install");
proc.pubProviders.put(cpi.name, cpr);
try {
proc.thread.scheduleInstallProvider(cpi);
} catch (RemoteException e) {
}
}
} else {
checkTime(startTime, "getContentProviderImpl: before start process");