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

Commit eab04ba5 authored by Xu Yang's avatar Xu Yang
Browse files

WindowManager: Disable rotation on device shutting down animation

BootAnimation layer should not be rotated when device shutting down,
otherwise BootAnimation layer would only cover the left part of the
screen and display error.

Change-Id: Iae87591fce7c1858bae0e4e85c58aa9ce120cbc3
CRs-Fixed: 631780
parent bfe13dfb
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -329,6 +329,8 @@ public class WindowManagerService extends IWindowManager.Stub


    final DisplaySettings mDisplaySettings;
    final DisplaySettings mDisplaySettings;


    boolean mIsShutdown = false;

    /**
    /**
     * All currently active sessions with clients.
     * All currently active sessions with clients.
     */
     */
@@ -5176,12 +5178,14 @@ public class WindowManagerService extends IWindowManager.Stub
    // Called by window manager policy.  Not exposed externally.
    // Called by window manager policy.  Not exposed externally.
    @Override
    @Override
    public void shutdown(boolean confirm) {
    public void shutdown(boolean confirm) {
        mIsShutdown = true;
        ShutdownThread.shutdown(mContext, confirm);
        ShutdownThread.shutdown(mContext, confirm);
    }
    }


    // Called by window manager policy.  Not exposed externally.
    // Called by window manager policy.  Not exposed externally.
    @Override
    @Override
    public void rebootSafeMode(boolean confirm) {
    public void rebootSafeMode(boolean confirm) {
        mIsShutdown = true;
        ShutdownThread.rebootSafeMode(mContext, confirm);
        ShutdownThread.rebootSafeMode(mContext, confirm);
    }
    }


@@ -5913,7 +5917,8 @@ public class WindowManagerService extends IWindowManager.Stub
        //       an orientation that has different metrics than it expected.
        //       an orientation that has different metrics than it expected.
        //       eg. Portrait instead of Landscape.
        //       eg. Portrait instead of Landscape.


        int rotation = mPolicy.rotationForOrientationLw(mForcedAppOrientation, mRotation);
        int rotation = mIsShutdown ? Surface.ROTATION_0 : mPolicy
                       .rotationForOrientationLw(mForcedAppOrientation, mRotation);
        boolean altOrientation = !mPolicy.rotationHasCompatibleMetricsLw(
        boolean altOrientation = !mPolicy.rotationHasCompatibleMetricsLw(
                mForcedAppOrientation, rotation);
                mForcedAppOrientation, rotation);