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

Commit 62b6916d authored by Shawn Lin's avatar Shawn Lin Committed by Automerger Merge Worker
Browse files

Merge "Reset the flag of attaching nav to app to prevent flickering" into sc-dev am: 680d09ed

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

Change-Id: If15fecf080971dc0c2252bb018f44b4a7aad7481
parents 532c0705 680d09ed
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -658,6 +658,8 @@ public class RecentsAnimationController implements DeathRecipient {
        if (!mNavigationBarAttachedToApp) {
            return;
        }
        mNavigationBarAttachedToApp = false;

        if (mStatusBar != null) {
            mStatusBar.setNavigationBarLumaSamplingEnabled(mDisplayId, true);
        }
+8 −0
Original line number Diff line number Diff line
@@ -519,12 +519,14 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
                eq(mDefaultDisplay.mDisplayId), eq(false));
        verify(transaction).reparent(navToken.getSurfaceControl(), activity.getSurfaceControl());
        verify(transaction).setLayer(navToken.getSurfaceControl(), Integer.MAX_VALUE);
        assertTrue(mController.isNavigationBarAttachedToApp());

        mController.cleanupAnimation(REORDER_MOVE_TO_TOP);
        verify(mController).restoreNavigationBarFromApp(eq(true));
        verify(mController.mStatusBar).setNavigationBarLumaSamplingEnabled(
                eq(mDefaultDisplay.mDisplayId), eq(true));
        verify(transaction).setLayer(navToken.getSurfaceControl(), 0);
        assertFalse(mController.isNavigationBarAttachedToApp());
    }

    @Test
@@ -541,6 +543,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
                eq(mDefaultDisplay.mDisplayId), eq(false));
        verify(transaction).reparent(navToken.getSurfaceControl(), activity.getSurfaceControl());
        verify(transaction).setLayer(navToken.getSurfaceControl(), Integer.MAX_VALUE);
        assertTrue(mController.isNavigationBarAttachedToApp());

        final WindowContainer parent = navToken.getParent();

@@ -550,6 +553,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
                eq(mDefaultDisplay.mDisplayId), eq(true));
        verify(transaction).setLayer(navToken.getSurfaceControl(), 0);
        verify(transaction).reparent(navToken.getSurfaceControl(), parent.getSurfaceControl());
        assertFalse(mController.isNavigationBarAttachedToApp());
    }

    @Test
@@ -566,6 +570,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
                eq(mDefaultDisplay.mDisplayId), eq(false));
        verify(transaction).reparent(navToken.getSurfaceControl(), activity.getSurfaceControl());
        verify(transaction).setLayer(navToken.getSurfaceControl(), Integer.MAX_VALUE);
        assertTrue(mController.isNavigationBarAttachedToApp());

        final WindowContainer parent = navToken.getParent();

@@ -575,6 +580,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
        verify(mController.mStatusBar).setNavigationBarLumaSamplingEnabled(
                eq(mDefaultDisplay.mDisplayId), eq(true));
        verify(transaction).setLayer(navToken.getSurfaceControl(), 0);
        assertFalse(mController.isNavigationBarAttachedToApp());
    }

    @Test
@@ -607,6 +613,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
                eq(mDefaultDisplay.mDisplayId), eq(false));
        verify(navWindow).setSurfaceTranslationY(-secondary.getBounds().top);
        verify(transaction).reparent(navToken.getSurfaceControl(), secondary.getSurfaceControl());
        assertTrue(mController.isNavigationBarAttachedToApp());
        reset(navWindow);

        mController.cleanupAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION);
@@ -616,6 +623,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase {
        verify(navWindow).setSurfaceTranslationY(0);
        verify(transaction).reparent(navToken.getSurfaceControl(), parent.getSurfaceControl());
        verify(mController).restoreNavigationBarFromApp(eq(false));
        assertFalse(mController.isNavigationBarAttachedToApp());
    }

    @Test