Loading services/core/java/com/android/server/wm/ActivityRecord.java +3 −18 Original line number Diff line number Diff line Loading @@ -285,7 +285,6 @@ import android.os.RemoteException; import android.os.SystemClock; import android.os.Trace; import android.os.UserHandle; import android.os.storage.StorageManager; import android.service.contentcapture.ActivityEvent; import android.service.dreams.DreamActivity; import android.service.dreams.DreamManagerInternal; Loading Loading @@ -730,7 +729,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // TODO: rename to mNoDisplay @VisibleForTesting boolean noDisplay; boolean mShowForAllUsers; final boolean mShowForAllUsers; // TODO: Make this final int mTargetSdk; Loading Loading @@ -5304,7 +5303,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A void updateVisibilityIgnoringKeyguard(boolean behindFullscreenActivity) { visibleIgnoringKeyguard = (!behindFullscreenActivity || mLaunchTaskBehind) && okToShowLocked(); && showToCurrentUser(); } boolean shouldBeVisible() { Loading Loading @@ -6341,22 +6340,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return this; } /** Checks whether the activity should be shown for current user. */ public boolean okToShowLocked() { // We cannot show activities when the device is locked and the application is not // encryption aware. if (!StorageManager.isUserKeyUnlocked(mUserId) && !info.applicationInfo.isEncryptionAware()) { return false; } return (info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0 || (mTaskSupervisor.isCurrentProfileLocked(mUserId) && mAtmService.mAmInternal.isUserRunning(mUserId, 0 /* flags */)); } boolean canBeTopRunning() { return !finishing && okToShowLocked(); return !finishing && showToCurrentUser(); } /** Loading services/core/java/com/android/server/wm/ActivityStarter.java +1 −1 Original line number Diff line number Diff line Loading @@ -2357,7 +2357,7 @@ class ActivityStarter { // of this in the record so that we can skip it when trying to find // the top running activity. mDoResume = doResume; if (!doResume || !r.okToShowLocked() || mLaunchTaskBehind) { if (!doResume || !r.showToCurrentUser() || mLaunchTaskBehind) { r.delayedResume = true; mDoResume = false; } Loading services/core/java/com/android/server/wm/ActivityTaskSupervisor.java +0 −6 Original line number Diff line number Diff line Loading @@ -1872,12 +1872,6 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { mHandler.obtainMessage(LAUNCH_TASK_BEHIND_COMPLETE, token).sendToTarget(); } /** Checks whether the userid is a profile of the current user. */ boolean isCurrentProfileLocked(int userId) { if (userId == mRootWindowContainer.mCurrentUser) return true; return mService.mAmInternal.isCurrentProfile(userId); } /** * Processes the activities to be stopped or destroyed. This should be called when the resumed * activities are idle or drawn. Loading services/core/java/com/android/server/wm/RootWindowContainer.java +1 −1 Original line number Diff line number Diff line Loading @@ -1965,7 +1965,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> private boolean startActivityForAttachedApplicationIfNeeded(ActivityRecord r, WindowProcessController app, ActivityRecord top) { if (r.finishing || !r.okToShowLocked() || !r.visibleIgnoringKeyguard || r.app != null if (r.finishing || !r.showToCurrentUser() || !r.visibleIgnoringKeyguard || r.app != null || app.mUid != r.info.applicationInfo.uid || !app.mName.equals(r.processName)) { return false; } Loading services/core/java/com/android/server/wm/Task.java +2 −2 Original line number Diff line number Diff line Loading @@ -5159,7 +5159,7 @@ class Task extends TaskFragment { } final ActivityRecord prev = baseTask.getActivity( a -> a.mStartingData != null && a.okToShowLocked()); a -> a.mStartingData != null && a.showToCurrentUser()); r.showStartingWindow(prev, newTask, isTaskSwitch, true /* startActivity */, sourceRecord); } Loading Loading @@ -5530,7 +5530,7 @@ class Task extends TaskFragment { // Don't refocus if invisible to current user final ActivityRecord top = tr.getTopNonFinishingActivity(); if (top == null || !top.okToShowLocked()) { if (top == null || !top.showToCurrentUser()) { positionChildAtTop(tr); if (top != null) { mTaskSupervisor.mRecentTasks.add(top.getTask()); Loading Loading
services/core/java/com/android/server/wm/ActivityRecord.java +3 −18 Original line number Diff line number Diff line Loading @@ -285,7 +285,6 @@ import android.os.RemoteException; import android.os.SystemClock; import android.os.Trace; import android.os.UserHandle; import android.os.storage.StorageManager; import android.service.contentcapture.ActivityEvent; import android.service.dreams.DreamActivity; import android.service.dreams.DreamManagerInternal; Loading Loading @@ -730,7 +729,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // TODO: rename to mNoDisplay @VisibleForTesting boolean noDisplay; boolean mShowForAllUsers; final boolean mShowForAllUsers; // TODO: Make this final int mTargetSdk; Loading Loading @@ -5304,7 +5303,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A void updateVisibilityIgnoringKeyguard(boolean behindFullscreenActivity) { visibleIgnoringKeyguard = (!behindFullscreenActivity || mLaunchTaskBehind) && okToShowLocked(); && showToCurrentUser(); } boolean shouldBeVisible() { Loading Loading @@ -6341,22 +6340,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return this; } /** Checks whether the activity should be shown for current user. */ public boolean okToShowLocked() { // We cannot show activities when the device is locked and the application is not // encryption aware. if (!StorageManager.isUserKeyUnlocked(mUserId) && !info.applicationInfo.isEncryptionAware()) { return false; } return (info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0 || (mTaskSupervisor.isCurrentProfileLocked(mUserId) && mAtmService.mAmInternal.isUserRunning(mUserId, 0 /* flags */)); } boolean canBeTopRunning() { return !finishing && okToShowLocked(); return !finishing && showToCurrentUser(); } /** Loading
services/core/java/com/android/server/wm/ActivityStarter.java +1 −1 Original line number Diff line number Diff line Loading @@ -2357,7 +2357,7 @@ class ActivityStarter { // of this in the record so that we can skip it when trying to find // the top running activity. mDoResume = doResume; if (!doResume || !r.okToShowLocked() || mLaunchTaskBehind) { if (!doResume || !r.showToCurrentUser() || mLaunchTaskBehind) { r.delayedResume = true; mDoResume = false; } Loading
services/core/java/com/android/server/wm/ActivityTaskSupervisor.java +0 −6 Original line number Diff line number Diff line Loading @@ -1872,12 +1872,6 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks { mHandler.obtainMessage(LAUNCH_TASK_BEHIND_COMPLETE, token).sendToTarget(); } /** Checks whether the userid is a profile of the current user. */ boolean isCurrentProfileLocked(int userId) { if (userId == mRootWindowContainer.mCurrentUser) return true; return mService.mAmInternal.isCurrentProfile(userId); } /** * Processes the activities to be stopped or destroyed. This should be called when the resumed * activities are idle or drawn. Loading
services/core/java/com/android/server/wm/RootWindowContainer.java +1 −1 Original line number Diff line number Diff line Loading @@ -1965,7 +1965,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> private boolean startActivityForAttachedApplicationIfNeeded(ActivityRecord r, WindowProcessController app, ActivityRecord top) { if (r.finishing || !r.okToShowLocked() || !r.visibleIgnoringKeyguard || r.app != null if (r.finishing || !r.showToCurrentUser() || !r.visibleIgnoringKeyguard || r.app != null || app.mUid != r.info.applicationInfo.uid || !app.mName.equals(r.processName)) { return false; } Loading
services/core/java/com/android/server/wm/Task.java +2 −2 Original line number Diff line number Diff line Loading @@ -5159,7 +5159,7 @@ class Task extends TaskFragment { } final ActivityRecord prev = baseTask.getActivity( a -> a.mStartingData != null && a.okToShowLocked()); a -> a.mStartingData != null && a.showToCurrentUser()); r.showStartingWindow(prev, newTask, isTaskSwitch, true /* startActivity */, sourceRecord); } Loading Loading @@ -5530,7 +5530,7 @@ class Task extends TaskFragment { // Don't refocus if invisible to current user final ActivityRecord top = tr.getTopNonFinishingActivity(); if (top == null || !top.okToShowLocked()) { if (top == null || !top.showToCurrentUser()) { positionChildAtTop(tr); if (top != null) { mTaskSupervisor.mRecentTasks.add(top.getTask()); Loading