Loading services/core/java/com/android/server/am/ActivityRecord.java +2 −1 Original line number Diff line number Diff line Loading @@ -1575,7 +1575,8 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo } void setVisibility(boolean visible) { mWindowContainerController.setVisibility(visible, mDeferHidingClient); mWindowContainerController.setVisibility(visible, visibleIgnoringKeyguard, mDeferHidingClient); mStackSupervisor.mActivityMetricsLogger.notifyVisibilityChanged(this, visible); } Loading services/core/java/com/android/server/am/ActivityStack.java +10 −0 Original line number Diff line number Diff line Loading @@ -2597,6 +2597,16 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // the screen based on the new activity order. boolean notUpdated = true; if (mStackSupervisor.isFocusedStack(this)) { // We have special rotation behavior when Keyguard is locked. Make sure all activity // visibilities are set correctly as well as the transition is updated if needed to // get the correct rotation behavior. // TODO: Remove this once visibilities are set correctly immediately when starting // an activity. if (mStackSupervisor.mKeyguardController.isKeyguardLocked()) { mStackSupervisor.ensureActivitiesVisibleLocked(null /* starting */, 0 /* configChanges */, false /* preserveWindows */); } final Configuration config = mWindowManager.updateOrientationFromAppTokens( mStackSupervisor.getDisplayOverrideConfiguration(mDisplayId), next.mayFreezeScreenLocked(next.app) ? next.appToken : null, mDisplayId); Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +4 −3 Original line number Diff line number Diff line Loading @@ -1269,6 +1269,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D r.app = app; if (mKeyguardController.isKeyguardLocked()) { r.notifyUnknownVisibilityLaunched(); } // Have the window manager re-evaluate the orientation of the screen based on the new // activity order. Note that as a result of this, it can call back into the activity // manager with a new orientation. We don't care about that, because the activity is Loading @@ -1295,9 +1299,6 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D r.setVisibility(true); } if (mKeyguardController.isKeyguardLocked()) { r.notifyUnknownVisibilityLaunched(); } final int applicationInfoUid = (r.info.applicationInfo != null) ? r.info.applicationInfo.uid : -1; if ((r.userId != app.userId) || (r.appInfo.uid != applicationInfoUid)) { Loading services/core/java/com/android/server/wm/AppWindowContainerController.java +6 −2 Original line number Diff line number Diff line Loading @@ -321,7 +321,8 @@ public class AppWindowContainerController } } public void setVisibility(boolean visible, boolean deferHidingClient) { public void setVisibility(boolean visible, boolean visibleIgnoringKeyguard, boolean deferHidingClient) { synchronized(mWindowMap) { if (mContainer == null) { Slog.w(TAG_WM, "Attempted to set visibility of non-existing app token: " Loading Loading @@ -360,13 +361,16 @@ public class AppWindowContainerController wtoken.hiddenRequested = !visible; wtoken.mDeferHidingClient = deferHidingClient; if (!visibleIgnoringKeyguard) { mService.mUnknownAppVisibilityController.appRemovedOrHidden(wtoken); } if (!visible) { // If the app is dead while it was visible, we kept its dead window on screen. // Now that the app is going invisible, we can remove it. It will be restarted // if made visible again. wtoken.removeDeadWindows(); wtoken.setVisibleBeforeClientHidden(); mService.mUnknownAppVisibilityController.appRemovedOrHidden(wtoken); } else { if (!mService.mAppTransition.isTransitionSet() && mService.mAppTransition.isReady()) { Loading services/core/java/com/android/server/wm/DisplayContent.java +3 −1 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM; import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG; import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT; import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; import static com.android.server.wm.AppTransition.TRANSIT_KEYGUARD_UNOCCLUDE; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_BOOT; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DISPLAY; Loading Loading @@ -3606,7 +3607,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mLastWindowForcedOrientation = SCREEN_ORIENTATION_UNSPECIFIED; if (policy.isKeyguardShowingAndNotOccluded()) { if (policy.isKeyguardShowingAndNotOccluded() || mService.mAppTransition.getAppTransition() == TRANSIT_KEYGUARD_UNOCCLUDE) { return mLastKeyguardForcedOrientation; } Loading Loading
services/core/java/com/android/server/am/ActivityRecord.java +2 −1 Original line number Diff line number Diff line Loading @@ -1575,7 +1575,8 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo } void setVisibility(boolean visible) { mWindowContainerController.setVisibility(visible, mDeferHidingClient); mWindowContainerController.setVisibility(visible, visibleIgnoringKeyguard, mDeferHidingClient); mStackSupervisor.mActivityMetricsLogger.notifyVisibilityChanged(this, visible); } Loading
services/core/java/com/android/server/am/ActivityStack.java +10 −0 Original line number Diff line number Diff line Loading @@ -2597,6 +2597,16 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai // the screen based on the new activity order. boolean notUpdated = true; if (mStackSupervisor.isFocusedStack(this)) { // We have special rotation behavior when Keyguard is locked. Make sure all activity // visibilities are set correctly as well as the transition is updated if needed to // get the correct rotation behavior. // TODO: Remove this once visibilities are set correctly immediately when starting // an activity. if (mStackSupervisor.mKeyguardController.isKeyguardLocked()) { mStackSupervisor.ensureActivitiesVisibleLocked(null /* starting */, 0 /* configChanges */, false /* preserveWindows */); } final Configuration config = mWindowManager.updateOrientationFromAppTokens( mStackSupervisor.getDisplayOverrideConfiguration(mDisplayId), next.mayFreezeScreenLocked(next.app) ? next.appToken : null, mDisplayId); Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +4 −3 Original line number Diff line number Diff line Loading @@ -1269,6 +1269,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D r.app = app; if (mKeyguardController.isKeyguardLocked()) { r.notifyUnknownVisibilityLaunched(); } // Have the window manager re-evaluate the orientation of the screen based on the new // activity order. Note that as a result of this, it can call back into the activity // manager with a new orientation. We don't care about that, because the activity is Loading @@ -1295,9 +1299,6 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D r.setVisibility(true); } if (mKeyguardController.isKeyguardLocked()) { r.notifyUnknownVisibilityLaunched(); } final int applicationInfoUid = (r.info.applicationInfo != null) ? r.info.applicationInfo.uid : -1; if ((r.userId != app.userId) || (r.appInfo.uid != applicationInfoUid)) { Loading
services/core/java/com/android/server/wm/AppWindowContainerController.java +6 −2 Original line number Diff line number Diff line Loading @@ -321,7 +321,8 @@ public class AppWindowContainerController } } public void setVisibility(boolean visible, boolean deferHidingClient) { public void setVisibility(boolean visible, boolean visibleIgnoringKeyguard, boolean deferHidingClient) { synchronized(mWindowMap) { if (mContainer == null) { Slog.w(TAG_WM, "Attempted to set visibility of non-existing app token: " Loading Loading @@ -360,13 +361,16 @@ public class AppWindowContainerController wtoken.hiddenRequested = !visible; wtoken.mDeferHidingClient = deferHidingClient; if (!visibleIgnoringKeyguard) { mService.mUnknownAppVisibilityController.appRemovedOrHidden(wtoken); } if (!visible) { // If the app is dead while it was visible, we kept its dead window on screen. // Now that the app is going invisible, we can remove it. It will be restarted // if made visible again. wtoken.removeDeadWindows(); wtoken.setVisibleBeforeClientHidden(); mService.mUnknownAppVisibilityController.appRemovedOrHidden(wtoken); } else { if (!mService.mAppTransition.isTransitionSet() && mService.mAppTransition.isReady()) { Loading
services/core/java/com/android/server/wm/DisplayContent.java +3 −1 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM; import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG; import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT; import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; import static com.android.server.wm.AppTransition.TRANSIT_KEYGUARD_UNOCCLUDE; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_BOOT; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DISPLAY; Loading Loading @@ -3606,7 +3607,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo mLastWindowForcedOrientation = SCREEN_ORIENTATION_UNSPECIFIED; if (policy.isKeyguardShowingAndNotOccluded()) { if (policy.isKeyguardShowingAndNotOccluded() || mService.mAppTransition.getAppTransition() == TRANSIT_KEYGUARD_UNOCCLUDE) { return mLastKeyguardForcedOrientation; } Loading