Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54f40fa1 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge changes I36ec1bf3,Ic5f11074 into oc-mr1-dev

* changes:
  Fix transition between two occluding activities
  Use Keyguard orientation when unoccluding
parents 55309e79 791ccc00
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1571,7 +1571,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);
    }

+10 −0
Original line number Diff line number Diff line
@@ -2580,6 +2580,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);
+4 −3
Original line number Diff line number Diff line
@@ -1336,6 +1336,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
@@ -1362,9 +1366,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)) {
+6 −2
Original line number Diff line number Diff line
@@ -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: "
@@ -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()) {
+3 −1
Original line number Diff line number Diff line
@@ -57,6 +57,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;
@@ -3554,7 +3555,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;
            }