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

Commit c1cef55a authored by Danny Baumann's avatar Danny Baumann
Browse files

Freeze screen while changing expanded desktop mode.

Also animate from old to new state.

Change-Id: I2db8ec4d55f7b8b5e592cc1ef21b86ebdbd00eb0
parent 93712566
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1183,4 +1183,13 @@ public interface WindowManagerPolicy {
     * @return True if the window is a top level one.
     */
    public boolean isTopLevelWindow(int windowType);

    /**
     * Determine the animation to run for a transition after display
     * metrics changed.
     *
     * @param anim The exiting animation resource id is stored in anim[0], the
     * entering animation resource id is stored in anim[1].
     */
    public void selectDisplayMetricsUpdateAnimationLw(int anim[]);
}
+2 −0
Original line number Diff line number Diff line
@@ -1536,6 +1536,8 @@
  <java-symbol type="anim" name="rotation_animation_jump_exit" />
  <java-symbol type="anim" name="rotation_animation_xfade_exit" />
  <java-symbol type="anim" name="rotation_animation_enter" />
  <java-symbol type="anim" name="shrink_fade_out_center" />
  <java-symbol type="anim" name="grow_fade_in_center" />
  <java-symbol type="array" name="config_autoBrightnessButtonBacklightValues" />
  <java-symbol type="array" name="config_autoBrightnessKeyboardBacklightValues" />
  <java-symbol type="array" name="config_autoBrightnessLcdBacklightValues" />
+6 −0
Original line number Diff line number Diff line
@@ -2174,6 +2174,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
    }

    @Override
    public void selectDisplayMetricsUpdateAnimationLw(int anim[]) {
        anim[0] = R.anim.shrink_fade_out_center;
        anim[1] = R.anim.grow_fade_in_center;
    }

    @Override
    public boolean validateRotationAnimationLw(int exitAnimId, int enterAnimId,
            boolean forceDefault) {
+9 −0
Original line number Diff line number Diff line
@@ -9982,6 +9982,15 @@ public class WindowManagerService extends IWindowManager.Stub
        }

        if (changed) {
            final int[] anim = new int[2];
            if (mAnimator.isDimmingLocked(Display.DEFAULT_DISPLAY)) {
                anim[0] = anim[1] = 0;
            } else {
                mPolicy.selectDisplayMetricsUpdateAnimationLw(anim);
            }

            mWaitingForConfig = true;
            startFreezingDisplayLocked(false, anim[0], anim[1]);
            mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION);
        }