Merge "Explicitly specify current user everywhere home is started." into jb-mr1-dev

This commit is contained in:
Dianne Hackborn
2012-09-07 18:01:22 -07:00
committed by Android (Google) Code Review
3 changed files with 4 additions and 13 deletions

View File

@@ -4152,7 +4152,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
} catch (ActivityNotFoundException e) {
}
}
mContext.startActivity(mHomeIntent);
mContext.startActivityAsUser(mHomeIntent, UserHandle.CURRENT);
}
/**

View File

@@ -463,7 +463,7 @@ class UiModeManagerService extends IUiModeManager.Stub {
if (homeIntent != null) {
try {
mContext.startActivity(homeIntent);
mContext.startActivityAsUser(homeIntent, UserHandle.CURRENT);
} catch (ActivityNotFoundException e) {
}
}

View File

@@ -2392,17 +2392,8 @@ public final class ActivityManagerService extends ActivityManagerNative
String resultWho, int requestCode, int startFlags,
String profileFile, ParcelFileDescriptor profileFd, Bundle options, int userId) {
enforceNotIsolatedCaller("startActivity");
if (userId != UserHandle.getCallingUserId()) {
userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId,
false, true, "startActivity", null);
} else {
if (intent.getCategories() != null
&& intent.getCategories().contains(Intent.CATEGORY_HOME)) {
// Requesting home, set the identity to the current user
// HACK!
userId = mCurrentUserId;
}
}
userId = handleIncomingUserLocked(Binder.getCallingPid(), Binder.getCallingUid(), userId,
false, true, "startActivity", null);
return mMainStack.startActivityMayWait(caller, -1, intent, resolvedType,
resultTo, resultWho, requestCode, startFlags, profileFile, profileFd,
null, null, options, userId);