Loading core/java/android/app/ActivityManagerInternal.java +9 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,15 @@ public abstract class ActivityManagerInternal { public abstract boolean startIsolatedProcess(String entryPoint, String[] mainArgs, String processName, String abiOverride, int uid, Runnable crashHandler); /** * Called when a user has been deleted. This can happen during normal device usage * or just at startup, when partially removed users are purged. Any state persisted by the * ActivityManager should be purged now. * * @param userId The user being cleaned up. */ public abstract void onUserRemoved(@UserIdInt int userId); /** * Kill foreground apps from the specified user. */ Loading services/core/java/com/android/server/am/ActivityManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -18778,6 +18778,15 @@ public class ActivityManagerService extends IActivityManager.Stub processName, abiOverride, uid, crashHandler); } @Override public void onUserRemoved(@UserIdInt int userId) { // Clean up any ActivityTaskManager state (by telling it the user is stopped) mAtmInternal.onUserStopped(userId); // Clean up various services by removing the user mBatteryStatsService.onUserRemoved(userId); mUserController.onUserRemoved(userId); } @Override public void killForegroundAppsForUser(@UserIdInt int userId) { synchronized (ActivityManagerService.this) { services/core/java/com/android/server/pm/UserManagerService.java +2 −3 Original line number Diff line number Diff line Loading @@ -3890,9 +3890,8 @@ public class UserManagerService extends IUserManager.Stub { new Thread() { @Override public void run() { // Clean up any ActivityTaskManager state LocalServices.getService(ActivityTaskManagerInternal.class) .onUserStopped(userId); LocalServices.getService(ActivityManagerInternal.class) .onUserRemoved(userId); removeUserState(userId); } }.start(); Loading services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java +2 −4 Original line number Diff line number Diff line Loading @@ -306,11 +306,9 @@ public abstract class ActivityTaskManagerInternal { public abstract void setAllowAppSwitches(@NonNull String type, int uid, int userId); /** * Called when a user has been deleted. This can happen during normal device usage * or just at startup, when partially removed users are purged. Any state persisted by the * ActivityManager should be purged now. * Called when a user has been stopped. * * @param userId The user being cleaned up. * @param userId The user being stopped. */ public abstract void onUserStopped(int userId); public abstract boolean isGetTasksAllowed(String caller, int callingPid, int callingUid); Loading Loading
core/java/android/app/ActivityManagerInternal.java +9 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,15 @@ public abstract class ActivityManagerInternal { public abstract boolean startIsolatedProcess(String entryPoint, String[] mainArgs, String processName, String abiOverride, int uid, Runnable crashHandler); /** * Called when a user has been deleted. This can happen during normal device usage * or just at startup, when partially removed users are purged. Any state persisted by the * ActivityManager should be purged now. * * @param userId The user being cleaned up. */ public abstract void onUserRemoved(@UserIdInt int userId); /** * Kill foreground apps from the specified user. */ Loading
services/core/java/com/android/server/am/ActivityManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -18778,6 +18778,15 @@ public class ActivityManagerService extends IActivityManager.Stub processName, abiOverride, uid, crashHandler); } @Override public void onUserRemoved(@UserIdInt int userId) { // Clean up any ActivityTaskManager state (by telling it the user is stopped) mAtmInternal.onUserStopped(userId); // Clean up various services by removing the user mBatteryStatsService.onUserRemoved(userId); mUserController.onUserRemoved(userId); } @Override public void killForegroundAppsForUser(@UserIdInt int userId) { synchronized (ActivityManagerService.this) {
services/core/java/com/android/server/pm/UserManagerService.java +2 −3 Original line number Diff line number Diff line Loading @@ -3890,9 +3890,8 @@ public class UserManagerService extends IUserManager.Stub { new Thread() { @Override public void run() { // Clean up any ActivityTaskManager state LocalServices.getService(ActivityTaskManagerInternal.class) .onUserStopped(userId); LocalServices.getService(ActivityManagerInternal.class) .onUserRemoved(userId); removeUserState(userId); } }.start(); Loading
services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java +2 −4 Original line number Diff line number Diff line Loading @@ -306,11 +306,9 @@ public abstract class ActivityTaskManagerInternal { public abstract void setAllowAppSwitches(@NonNull String type, int uid, int userId); /** * Called when a user has been deleted. This can happen during normal device usage * or just at startup, when partially removed users are purged. Any state persisted by the * ActivityManager should be purged now. * Called when a user has been stopped. * * @param userId The user being cleaned up. * @param userId The user being stopped. */ public abstract void onUserStopped(int userId); public abstract boolean isGetTasksAllowed(String caller, int callingPid, int callingUid); Loading