Skip to content

Commit d888399

Browse files
author
Dianne Hackborn
committed
Explicitly specify current user everywhere home is started.
Change-Id: I58d86136de7f9cef1eaf72793d0e200b852d7355
1 parent 7201829 commit d888399

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4152,7 +4152,7 @@ void startDockOrHome() {
41524152
} catch (ActivityNotFoundException e) {
41534153
}
41544154
}
4155-
mContext.startActivity(mHomeIntent);
4155+
mContext.startActivityAsUser(mHomeIntent, UserHandle.CURRENT);
41564156
}
41574157

41584158
/**

services/java/com/android/server/UiModeManagerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ final void updateLocked(int enableFlags, int disableFlags) {
463463

464464
if (homeIntent != null) {
465465
try {
466-
mContext.startActivity(homeIntent);
466+
mContext.startActivityAsUser(homeIntent, UserHandle.CURRENT);
467467
} catch (ActivityNotFoundException e) {
468468
}
469469
}

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,17 +2392,8 @@ public final int startActivityAsUser(IApplicationThread caller,
23922392
String resultWho, int requestCode, int startFlags,
23932393
String profileFile, ParcelFileDescriptor profileFd, Bundle options, int userId) {
23942394
enforceNotIsolatedCaller("startActivity");
2395-
if (userId != UserHandle.getCallingUserId()) {
2396-
userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId,
2397-
false, true, "startActivity", null);
2398-
} else {
2399-
if (intent.getCategories() != null
2400-
&& intent.getCategories().contains(Intent.CATEGORY_HOME)) {
2401-
// Requesting home, set the identity to the current user
2402-
// HACK!
2403-
userId = mCurrentUserId;
2404-
}
2405-
}
2395+
userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId,
2396+
false, true, "startActivity", null);
24062397
return mMainStack.startActivityMayWait(caller, -1, intent, resolvedType,
24072398
resultTo, resultWho, requestCode, startFlags, profileFile, profileFd,
24082399
null, null, options, userId);

0 commit comments

Comments
 (0)