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

Commit f68fbfb5 authored by Roy Chou's avatar Roy Chou Committed by Automerger Merge Worker
Browse files

Merge "fix(#Magnification): fix...

Merge "fix(#Magnification): fix WindowMagnificationControllerTest#enableWindowMagnification_rotationIsChanged_updateRotationValue fails on x86 devices" into udc-dev am: 580eb729

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22530658



Change-Id: I2a71c40da00e0a9762c572860564ebee4b1cfad3
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 22c9630f 580eb729
Loading
Loading
Loading
Loading
+12 −1
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.accessibility;


import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static android.content.res.Configuration.ORIENTATION_UNDEFINED;
import static android.view.Choreographer.FrameCallback;
import static android.view.Choreographer.FrameCallback;
import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_UP;
import static android.view.MotionEvent.ACTION_UP;
@@ -172,6 +173,12 @@ public class WindowMagnificationControllerTest extends SysuiTestCase {
                returnsSecondArg());
                returnsSecondArg());


        mResources = getContext().getOrCreateTestableResources().getResources();
        mResources = getContext().getOrCreateTestableResources().getResources();
        // prevent the config orientation from undefined, which may cause config.diff method
        // neglecting the orientation update.
        if (mResources.getConfiguration().orientation == ORIENTATION_UNDEFINED) {
            mResources.getConfiguration().orientation = ORIENTATION_PORTRAIT;
        }

        mWindowMagnificationAnimationController = new WindowMagnificationAnimationController(
        mWindowMagnificationAnimationController = new WindowMagnificationAnimationController(
                mContext, mValueAnimator);
                mContext, mValueAnimator);
        mWindowMagnificationController =
        mWindowMagnificationController =
@@ -688,7 +695,11 @@ public class WindowMagnificationControllerTest extends SysuiTestCase {


    @Test
    @Test
    public void enableWindowMagnification_rotationIsChanged_updateRotationValue() {
    public void enableWindowMagnification_rotationIsChanged_updateRotationValue() {
        final Configuration config = mContext.getResources().getConfiguration();
        // the config orientation should not be undefined, since it would cause config.diff
        // returning 0 and thus the orientation changed would not be detected
        assertNotEquals(ORIENTATION_UNDEFINED, mResources.getConfiguration().orientation);

        final Configuration config = mResources.getConfiguration();
        config.orientation = config.orientation == ORIENTATION_LANDSCAPE ? ORIENTATION_PORTRAIT
        config.orientation = config.orientation == ORIENTATION_LANDSCAPE ? ORIENTATION_PORTRAIT
                : ORIENTATION_LANDSCAPE;
                : ORIENTATION_LANDSCAPE;
        final int newRotation = simulateRotateTheDevice();
        final int newRotation = simulateRotateTheDevice();