Merge "Add back ActivityManagerService.onUserRemoved" into rvc-dev am: 525fab26a1
Change-Id: Ie3903b8778b9adf92ccc299d059bfe1fe724d870
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user