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

Commit ebf50a49 authored by Mitsuru Oshima's avatar Mitsuru Oshima Committed by Qing Xia
Browse files

Add config flag to disable transition animation.

Bug: 37424692
Test: See repro step in the bug.
Change-Id: Iff2a3dd53455769ff2d6cad8e501de1fc4c1199b
parent b22c0ac0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -123,6 +123,9 @@
         be sent during a change to the audio output device. -->
    <bool name="config_sendAudioBecomingNoisy">true</bool>

    <!-- Flag to disable all transition animations -->
    <bool name="config_disableTransitionAnimation">false</bool>

    <!-- The duration (in milliseconds) of a short animation. -->
    <integer name="config_shortAnimTime">200</integer>

+1 −0
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@
  <java-symbol type="bool" name="config_bluetooth_hfp_inband_ringing_support" />
  <java-symbol type="bool" name="config_cellBroadcastAppLinks" />
  <java-symbol type="bool" name="config_duplicate_port_omadm_wappush" />
  <java-symbol type="bool" name="config_disableTransitionAnimation" />
  <java-symbol type="bool" name="config_enableAutoPowerModes" />
  <java-symbol type="integer" name="config_autoPowerModeThresholdAngle" />
  <java-symbol type="integer" name="config_autoPowerModeAnyMotionSensor" />
+12 −0
Original line number Diff line number Diff line
@@ -569,6 +569,8 @@ public class WindowManagerService extends IWindowManager.Stub
    boolean mForceResizableTasks = false;
    boolean mSupportsPictureInPicture = false;

    private boolean mDisableTransitionAnimation = false;

    int getDragLayerLocked() {
        return mPolicy.getWindowLayerFromTypeLw(TYPE_DRAG) * TYPE_LAYER_MULTIPLIER + TYPE_LAYER_OFFSET;
    }
@@ -966,6 +968,8 @@ public class WindowManagerService extends IWindowManager.Stub
                com.android.internal.R.bool.config_allowAnimationsInLowPowerMode);
        mMaxUiWidth = context.getResources().getInteger(
                com.android.internal.R.integer.config_maxUiWidth);
        mDisableTransitionAnimation = context.getResources().getBoolean(
                com.android.internal.R.bool.config_disableTransitionAnimation);
        mInputManager = inputManager; // Must be before createDisplayContentLocked.
        mDisplayManagerInternal = LocalServices.getService(DisplayManagerInternal.class);
        mDisplaySettings = new DisplaySettings();
@@ -2279,6 +2283,14 @@ public class WindowManagerService extends IWindowManager.Stub

    boolean applyAnimationLocked(AppWindowToken atoken, WindowManager.LayoutParams lp,
            int transit, boolean enter, boolean isVoiceInteraction) {
        if (mDisableTransitionAnimation) {
            if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
                Slog.v(TAG_WM,
                        "applyAnimation: transition animation is disabled. atoken=" + atoken);
            }
            atoken.mAppAnimator.clearAnimation();
            return false;
        }
        // Only apply an animation if the display isn't frozen.  If it is
        // frozen, there is no reason to animate and it can cause strange
        // artifacts when we unfreeze the display if some different animation