Loading services/core/java/com/android/server/am/ActivityManagerService.java +11 −15 Original line number Original line Diff line number Diff line Loading @@ -14891,7 +14891,7 @@ public final class ActivityManagerService extends ActivityManagerNative } } } } for (int i=0; i<cpr.connections.size(); i++) { for (int i = cpr.connections.size() - 1; i >= 0; i--) { ContentProviderConnection conn = cpr.connections.get(i); ContentProviderConnection conn = cpr.connections.get(i); if (conn.waiting) { if (conn.waiting) { // If this connection is waiting for the provider, then we don't // If this connection is waiting for the provider, then we don't Loading Loading @@ -14986,7 +14986,8 @@ public final class ActivityManagerService extends ActivityManagerNative for (int i = app.pubProviders.size() - 1; i >= 0; i--) { for (int i = app.pubProviders.size() - 1; i >= 0; i--) { ContentProviderRecord cpr = app.pubProviders.valueAt(i); ContentProviderRecord cpr = app.pubProviders.valueAt(i); final boolean always = app.bad || !allowRestart; final boolean always = app.bad || !allowRestart; if (removeDyingProviderLocked(app, cpr, always) || always) { boolean inLaunching = removeDyingProviderLocked(app, cpr, always); if ((inLaunching || always) && !cpr.connections.isEmpty()) { // We left the provider in the launching list, need to // We left the provider in the launching list, need to // restart it. // restart it. restart = true; restart = true; Loading @@ -15004,7 +15005,7 @@ public final class ActivityManagerService extends ActivityManagerNative // Unregister from connected content providers. // Unregister from connected content providers. if (!app.conProviders.isEmpty()) { if (!app.conProviders.isEmpty()) { for (int i=0; i<app.conProviders.size(); i++) { for (int i = app.conProviders.size() - 1; i >= 0; i--) { ContentProviderConnection conn = app.conProviders.get(i); ContentProviderConnection conn = app.conProviders.get(i); conn.provider.connections.remove(conn); conn.provider.connections.remove(conn); stopAssociationLocked(app.uid, app.processName, conn.provider.uid, stopAssociationLocked(app.uid, app.processName, conn.provider.uid, Loading @@ -15019,9 +15020,8 @@ public final class ActivityManagerService extends ActivityManagerNative // XXX Commented out for now. Trying to figure out a way to reproduce // XXX Commented out for now. Trying to figure out a way to reproduce // the actual situation to identify what is actually going on. // the actual situation to identify what is actually going on. if (false) { if (false) { for (int i=0; i<mLaunchingProviders.size(); i++) { for (int i = mLaunchingProviders.size() - 1; i >= 0; i--) { ContentProviderRecord cpr = (ContentProviderRecord) ContentProviderRecord cpr = mLaunchingProviders.get(i); mLaunchingProviders.get(i); if (cpr.connections.size() <= 0 && !cpr.hasExternalProcessHandles()) { if (cpr.connections.size() <= 0 && !cpr.hasExternalProcessHandles()) { synchronized (cpr) { synchronized (cpr) { cpr.launchingApp = null; cpr.launchingApp = null; Loading Loading @@ -15127,18 +15127,14 @@ public final class ActivityManagerService extends ActivityManagerNative // and if any run in this process then either schedule a restart of // and if any run in this process then either schedule a restart of // the process or kill the client waiting for it if this process has // the process or kill the client waiting for it if this process has // gone bad. // gone bad. int NL = mLaunchingProviders.size(); boolean restart = false; boolean restart = false; for (int i=0; i<NL; i++) { for (int i = mLaunchingProviders.size() - 1; i >= 0; i--) { ContentProviderRecord cpr = mLaunchingProviders.get(i); ContentProviderRecord cpr = mLaunchingProviders.get(i); if (cpr.launchingApp == app) { if (cpr.launchingApp == app) { if (!alwaysBad && !app.bad) { if (!alwaysBad && !app.bad && !cpr.connections.isEmpty()) { restart = true; restart = true; } else { } else { removeDyingProviderLocked(app, cpr, true); removeDyingProviderLocked(app, cpr, true); // cpr should have been removed from mLaunchingProviders NL = mLaunchingProviders.size(); i--; } } } } } } Loading
services/core/java/com/android/server/am/ActivityManagerService.java +11 −15 Original line number Original line Diff line number Diff line Loading @@ -14891,7 +14891,7 @@ public final class ActivityManagerService extends ActivityManagerNative } } } } for (int i=0; i<cpr.connections.size(); i++) { for (int i = cpr.connections.size() - 1; i >= 0; i--) { ContentProviderConnection conn = cpr.connections.get(i); ContentProviderConnection conn = cpr.connections.get(i); if (conn.waiting) { if (conn.waiting) { // If this connection is waiting for the provider, then we don't // If this connection is waiting for the provider, then we don't Loading Loading @@ -14986,7 +14986,8 @@ public final class ActivityManagerService extends ActivityManagerNative for (int i = app.pubProviders.size() - 1; i >= 0; i--) { for (int i = app.pubProviders.size() - 1; i >= 0; i--) { ContentProviderRecord cpr = app.pubProviders.valueAt(i); ContentProviderRecord cpr = app.pubProviders.valueAt(i); final boolean always = app.bad || !allowRestart; final boolean always = app.bad || !allowRestart; if (removeDyingProviderLocked(app, cpr, always) || always) { boolean inLaunching = removeDyingProviderLocked(app, cpr, always); if ((inLaunching || always) && !cpr.connections.isEmpty()) { // We left the provider in the launching list, need to // We left the provider in the launching list, need to // restart it. // restart it. restart = true; restart = true; Loading @@ -15004,7 +15005,7 @@ public final class ActivityManagerService extends ActivityManagerNative // Unregister from connected content providers. // Unregister from connected content providers. if (!app.conProviders.isEmpty()) { if (!app.conProviders.isEmpty()) { for (int i=0; i<app.conProviders.size(); i++) { for (int i = app.conProviders.size() - 1; i >= 0; i--) { ContentProviderConnection conn = app.conProviders.get(i); ContentProviderConnection conn = app.conProviders.get(i); conn.provider.connections.remove(conn); conn.provider.connections.remove(conn); stopAssociationLocked(app.uid, app.processName, conn.provider.uid, stopAssociationLocked(app.uid, app.processName, conn.provider.uid, Loading @@ -15019,9 +15020,8 @@ public final class ActivityManagerService extends ActivityManagerNative // XXX Commented out for now. Trying to figure out a way to reproduce // XXX Commented out for now. Trying to figure out a way to reproduce // the actual situation to identify what is actually going on. // the actual situation to identify what is actually going on. if (false) { if (false) { for (int i=0; i<mLaunchingProviders.size(); i++) { for (int i = mLaunchingProviders.size() - 1; i >= 0; i--) { ContentProviderRecord cpr = (ContentProviderRecord) ContentProviderRecord cpr = mLaunchingProviders.get(i); mLaunchingProviders.get(i); if (cpr.connections.size() <= 0 && !cpr.hasExternalProcessHandles()) { if (cpr.connections.size() <= 0 && !cpr.hasExternalProcessHandles()) { synchronized (cpr) { synchronized (cpr) { cpr.launchingApp = null; cpr.launchingApp = null; Loading Loading @@ -15127,18 +15127,14 @@ public final class ActivityManagerService extends ActivityManagerNative // and if any run in this process then either schedule a restart of // and if any run in this process then either schedule a restart of // the process or kill the client waiting for it if this process has // the process or kill the client waiting for it if this process has // gone bad. // gone bad. int NL = mLaunchingProviders.size(); boolean restart = false; boolean restart = false; for (int i=0; i<NL; i++) { for (int i = mLaunchingProviders.size() - 1; i >= 0; i--) { ContentProviderRecord cpr = mLaunchingProviders.get(i); ContentProviderRecord cpr = mLaunchingProviders.get(i); if (cpr.launchingApp == app) { if (cpr.launchingApp == app) { if (!alwaysBad && !app.bad) { if (!alwaysBad && !app.bad && !cpr.connections.isEmpty()) { restart = true; restart = true; } else { } else { removeDyingProviderLocked(app, cpr, true); removeDyingProviderLocked(app, cpr, true); // cpr should have been removed from mLaunchingProviders NL = mLaunchingProviders.size(); i--; } } } } } }