Loading services/core/java/com/android/server/am/ProcessList.java +32 −3 Original line number Diff line number Diff line Loading @@ -1712,12 +1712,18 @@ public final class ProcessList { zygoteProcesses.remove(app); if (zygoteProcesses.size() == 0) { mService.mHandler.removeMessages(KILL_APP_ZYGOTE_MSG); if (app.removed) { // If we stopped this process because the package hosting it was removed, // there's no point in delaying the app zygote kill. killAppZygoteIfNeededLocked(appZygote); } else { Message msg = mService.mHandler.obtainMessage(KILL_APP_ZYGOTE_MSG); msg.obj = appZygote; mService.mHandler.sendMessageDelayed(msg, KILL_APP_ZYGOTE_DELAY_MS); } } } } private AppZygote createAppZygoteForProcessIfNeeded(final ProcessRecord app) { synchronized (mService) { Loading Loading @@ -2169,6 +2175,29 @@ public final class ProcessList { for (int i=0; i<N; i++) { removeProcessLocked(procs.get(i), callerWillRestart, allowRestart, reason); } // See if there are any app zygotes running for this packageName / UID combination, // and kill it if so. final ArrayList<AppZygote> zygotesToKill = new ArrayList<>(); for (SparseArray<AppZygote> appZygotes : mAppZygotes.getMap().values()) { for (int i = 0; i < appZygotes.size(); ++i) { final int appZygoteUid = appZygotes.keyAt(i); if (userId != UserHandle.USER_ALL && UserHandle.getUserId(appZygoteUid) != userId) { continue; } if (appId >= 0 && UserHandle.getAppId(appZygoteUid) != appId) { continue; } final AppZygote appZygote = appZygotes.valueAt(i); if (packageName != null && !packageName.equals(appZygote.getAppInfo().packageName)) { continue; } zygotesToKill.add(appZygote); } } for (AppZygote appZygote : zygotesToKill) { killAppZygoteIfNeededLocked(appZygote); } mService.updateOomAdjLocked(); return N > 0; } Loading Loading
services/core/java/com/android/server/am/ProcessList.java +32 −3 Original line number Diff line number Diff line Loading @@ -1712,12 +1712,18 @@ public final class ProcessList { zygoteProcesses.remove(app); if (zygoteProcesses.size() == 0) { mService.mHandler.removeMessages(KILL_APP_ZYGOTE_MSG); if (app.removed) { // If we stopped this process because the package hosting it was removed, // there's no point in delaying the app zygote kill. killAppZygoteIfNeededLocked(appZygote); } else { Message msg = mService.mHandler.obtainMessage(KILL_APP_ZYGOTE_MSG); msg.obj = appZygote; mService.mHandler.sendMessageDelayed(msg, KILL_APP_ZYGOTE_DELAY_MS); } } } } private AppZygote createAppZygoteForProcessIfNeeded(final ProcessRecord app) { synchronized (mService) { Loading Loading @@ -2169,6 +2175,29 @@ public final class ProcessList { for (int i=0; i<N; i++) { removeProcessLocked(procs.get(i), callerWillRestart, allowRestart, reason); } // See if there are any app zygotes running for this packageName / UID combination, // and kill it if so. final ArrayList<AppZygote> zygotesToKill = new ArrayList<>(); for (SparseArray<AppZygote> appZygotes : mAppZygotes.getMap().values()) { for (int i = 0; i < appZygotes.size(); ++i) { final int appZygoteUid = appZygotes.keyAt(i); if (userId != UserHandle.USER_ALL && UserHandle.getUserId(appZygoteUid) != userId) { continue; } if (appId >= 0 && UserHandle.getAppId(appZygoteUid) != appId) { continue; } final AppZygote appZygote = appZygotes.valueAt(i); if (packageName != null && !packageName.equals(appZygote.getAppInfo().packageName)) { continue; } zygotesToKill.add(appZygote); } } for (AppZygote appZygote : zygotesToKill) { killAppZygoteIfNeededLocked(appZygote); } mService.updateOomAdjLocked(); return N > 0; } Loading