Skip to content

Commit faa4b3c

Browse files
committed
Disallow switching managed profile to foreground
Another check in the ActivityManager to stop us from getting into an invalid state by a fat-fingered 'am switch' etc. @bug 16814252 Change-Id: Id65ab647d5a535cc2f965139a1b717cf65aa7e69
1 parent 7dea98f commit faa4b3c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

services/core/java/com/android/server/am/ActivityManagerService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17244,6 +17244,10 @@ private boolean startUser(final int userId, boolean foreground) {
1724417244
Slog.w(TAG, "No user info for user #" + userId);
1724517245
return false;
1724617246
}
17247+
if (foreground && userInfo.isManagedProfile()) {
17248+
Slog.w(TAG, "Cannot switch to User #" + userId + ": not a full user");
17249+
return false;
17250+
}
1724717251

1724817252
if (foreground) {
1724917253
mWindowManager.startFreezingScreen(R.anim.screen_user_exit,

0 commit comments

Comments
 (0)