Loading services/java/com/android/server/am/ActivityManagerService.java +24 −2 Original line number Diff line number Diff line Loading @@ -2150,8 +2150,7 @@ public final class ActivityManagerService extends ActivityManagerNative intent.addCategory(Intent.CATEGORY_HOME); } ActivityInfo aInfo = intent.resolveActivityInfo(mContext.getPackageManager(), STOCK_PM_FLAGS); resolveActivityInfo(intent, STOCK_PM_FLAGS, userId); if (aInfo != null) { intent.setComponent(new ComponentName( aInfo.applicationInfo.packageName, aInfo.name)); Loading @@ -2174,6 +2173,29 @@ public final class ActivityManagerService extends ActivityManagerNative return true; } private ActivityInfo resolveActivityInfo(Intent intent, int flags, int userId) { ActivityInfo ai = null; ComponentName comp = intent.getComponent(); try { if (comp != null) { ai = AppGlobals.getPackageManager().getActivityInfo(comp, flags, userId); } else { ResolveInfo info = AppGlobals.getPackageManager().resolveIntent( intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), flags, userId); if (info != null) { ai = info.activityInfo; } } } catch (RemoteException e) { // ignore } return ai; } /** * Starts the "new version setup screen" if appropriate. */ Loading services/java/com/android/server/am/ActivityStack.java +5 −7 Original line number Diff line number Diff line Loading @@ -422,11 +422,10 @@ final class ActivityStack { } final ActivityRecord topRunningActivityLocked(ActivityRecord notTop) { // TODO: Don't look for any tasks from other users int i = mHistory.size()-1; while (i >= 0) { ActivityRecord r = mHistory.get(i); if (!r.finishing && r != notTop) { if (!r.finishing && r != notTop && r.userId == mCurrentUser) { return r; } i--; Loading @@ -435,11 +434,10 @@ final class ActivityStack { } final ActivityRecord topRunningNonDelayedActivityLocked(ActivityRecord notTop) { // TODO: Don't look for any tasks from other users int i = mHistory.size()-1; while (i >= 0) { ActivityRecord r = mHistory.get(i); if (!r.finishing && !r.delayedResume && r != notTop) { if (!r.finishing && !r.delayedResume && r != notTop && r.userId == mCurrentUser) { return r; } i--; Loading @@ -457,12 +455,12 @@ final class ActivityStack { * @return Returns the HistoryRecord of the next activity on the stack. */ final ActivityRecord topRunningActivityLocked(IBinder token, int taskId) { // TODO: Don't look for any tasks from other users int i = mHistory.size()-1; while (i >= 0) { ActivityRecord r = mHistory.get(i); // Note: the taskId check depends on real taskId fields being non-zero if (!r.finishing && (token != r.appToken) && (taskId != r.task.taskId)) { if (!r.finishing && (token != r.appToken) && (taskId != r.task.taskId) && r.userId == mCurrentUser) { return r; } i--; Loading Loading @@ -1400,7 +1398,7 @@ final class ActivityStack { // Launcher... if (mMainStack) { ActivityOptions.abort(options); return mService.startHomeActivityLocked(0, null); return mService.startHomeActivityLocked(mCurrentUser, null); } } Loading Loading
services/java/com/android/server/am/ActivityManagerService.java +24 −2 Original line number Diff line number Diff line Loading @@ -2150,8 +2150,7 @@ public final class ActivityManagerService extends ActivityManagerNative intent.addCategory(Intent.CATEGORY_HOME); } ActivityInfo aInfo = intent.resolveActivityInfo(mContext.getPackageManager(), STOCK_PM_FLAGS); resolveActivityInfo(intent, STOCK_PM_FLAGS, userId); if (aInfo != null) { intent.setComponent(new ComponentName( aInfo.applicationInfo.packageName, aInfo.name)); Loading @@ -2174,6 +2173,29 @@ public final class ActivityManagerService extends ActivityManagerNative return true; } private ActivityInfo resolveActivityInfo(Intent intent, int flags, int userId) { ActivityInfo ai = null; ComponentName comp = intent.getComponent(); try { if (comp != null) { ai = AppGlobals.getPackageManager().getActivityInfo(comp, flags, userId); } else { ResolveInfo info = AppGlobals.getPackageManager().resolveIntent( intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), flags, userId); if (info != null) { ai = info.activityInfo; } } } catch (RemoteException e) { // ignore } return ai; } /** * Starts the "new version setup screen" if appropriate. */ Loading
services/java/com/android/server/am/ActivityStack.java +5 −7 Original line number Diff line number Diff line Loading @@ -422,11 +422,10 @@ final class ActivityStack { } final ActivityRecord topRunningActivityLocked(ActivityRecord notTop) { // TODO: Don't look for any tasks from other users int i = mHistory.size()-1; while (i >= 0) { ActivityRecord r = mHistory.get(i); if (!r.finishing && r != notTop) { if (!r.finishing && r != notTop && r.userId == mCurrentUser) { return r; } i--; Loading @@ -435,11 +434,10 @@ final class ActivityStack { } final ActivityRecord topRunningNonDelayedActivityLocked(ActivityRecord notTop) { // TODO: Don't look for any tasks from other users int i = mHistory.size()-1; while (i >= 0) { ActivityRecord r = mHistory.get(i); if (!r.finishing && !r.delayedResume && r != notTop) { if (!r.finishing && !r.delayedResume && r != notTop && r.userId == mCurrentUser) { return r; } i--; Loading @@ -457,12 +455,12 @@ final class ActivityStack { * @return Returns the HistoryRecord of the next activity on the stack. */ final ActivityRecord topRunningActivityLocked(IBinder token, int taskId) { // TODO: Don't look for any tasks from other users int i = mHistory.size()-1; while (i >= 0) { ActivityRecord r = mHistory.get(i); // Note: the taskId check depends on real taskId fields being non-zero if (!r.finishing && (token != r.appToken) && (taskId != r.task.taskId)) { if (!r.finishing && (token != r.appToken) && (taskId != r.task.taskId) && r.userId == mCurrentUser) { return r; } i--; Loading Loading @@ -1400,7 +1398,7 @@ final class ActivityStack { // Launcher... if (mMainStack) { ActivityOptions.abort(options); return mService.startHomeActivityLocked(0, null); return mService.startHomeActivityLocked(mCurrentUser, null); } } Loading