Loading packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +1 −2 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import com.android.systemui.statusbar.phone.panelstate.PanelExpansionChangeEvent import com.android.wm.shell.animation.FlingAnimationUtils; import java.util.Optional; import javax.inject.Inject; import javax.inject.Named; Loading Loading @@ -153,8 +154,6 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { private void setPanelExpansion(float expansion, float dragDownAmount) { mCurrentExpansion = expansion; mCentralSurfaces.ifPresent(centralSurfaces -> centralSurfaces.setBouncerShowingOverDream( mCurrentExpansion != KeyguardBouncer.EXPANSION_HIDDEN)); PanelExpansionChangeEvent event = new PanelExpansionChangeEvent( /* fraction= */ mCurrentExpansion, Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void onVisibilityChanged(boolean isVisible) { mCentralSurfaces .setBouncerShowingOverDream( isVisible && mDreamOverlayStateController.isOverlayActive()); if (!isVisible) { mCentralSurfaces.setBouncerHiddenFraction(KeyguardBouncer.EXPANSION_HIDDEN); } Loading packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -428,7 +428,6 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { @Test public void testInformBouncerShowingOnExpand() { swipeToPosition(1f, Direction.UP, 0); verify(mCentralSurfaces).setBouncerShowingOverDream(true); } /** Loading @@ -441,7 +440,6 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { Mockito.clearInvocations(mCentralSurfaces); swipeToPosition(0f, Direction.DOWN, 0); verify(mCentralSurfaces).setBouncerShowingOverDream(false); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java +28 −0 Original line number Diff line number Diff line Loading @@ -61,7 +61,9 @@ import com.google.common.truth.Truth; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import java.util.Optional; Loading Loading @@ -97,6 +99,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Mock private LatencyTracker mLatencyTracker; private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; private KeyguardBouncer.BouncerExpansionCallback mBouncerExpansionCallback; @Before public void setUp() { Loading Loading @@ -136,6 +139,11 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { mBypassController); when(mKeyguardStateController.isOccluded()).thenReturn(false); mStatusBarKeyguardViewManager.show(null); ArgumentCaptor<KeyguardBouncer.BouncerExpansionCallback> callbackArgumentCaptor = ArgumentCaptor.forClass(KeyguardBouncer.BouncerExpansionCallback.class); verify(mKeyguardBouncerFactory).create(any(ViewGroup.class), callbackArgumentCaptor.capture()); mBouncerExpansionCallback = callbackArgumentCaptor.getValue(); } @Test Loading Loading @@ -417,4 +425,24 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { return new PanelExpansionChangeEvent( fraction, expanded, tracking, /* dragDownPxAmount= */ 0f); } @Test public void testReportBouncerOnDreamWhenVisible() { mBouncerExpansionCallback.onVisibilityChanged(true); verify(mCentralSurfaces).setBouncerShowingOverDream(false); Mockito.clearInvocations(mCentralSurfaces); when(mDreamOverlayStateController.isOverlayActive()).thenReturn(true); mBouncerExpansionCallback.onVisibilityChanged(true); verify(mCentralSurfaces).setBouncerShowingOverDream(true); } @Test public void testReportBouncerOnDreamWhenNotVisible() { mBouncerExpansionCallback.onVisibilityChanged(false); verify(mCentralSurfaces).setBouncerShowingOverDream(false); Mockito.clearInvocations(mCentralSurfaces); when(mDreamOverlayStateController.isOverlayActive()).thenReturn(true); mBouncerExpansionCallback.onVisibilityChanged(false); verify(mCentralSurfaces).setBouncerShowingOverDream(false); } } Loading
packages/SystemUI/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandler.java +1 −2 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import com.android.systemui.statusbar.phone.panelstate.PanelExpansionChangeEvent import com.android.wm.shell.animation.FlingAnimationUtils; import java.util.Optional; import javax.inject.Inject; import javax.inject.Named; Loading Loading @@ -153,8 +154,6 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler { private void setPanelExpansion(float expansion, float dragDownAmount) { mCurrentExpansion = expansion; mCentralSurfaces.ifPresent(centralSurfaces -> centralSurfaces.setBouncerShowingOverDream( mCurrentExpansion != KeyguardBouncer.EXPANSION_HIDDEN)); PanelExpansionChangeEvent event = new PanelExpansionChangeEvent( /* fraction= */ mCurrentExpansion, Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb @Override public void onVisibilityChanged(boolean isVisible) { mCentralSurfaces .setBouncerShowingOverDream( isVisible && mDreamOverlayStateController.isOverlayActive()); if (!isVisible) { mCentralSurfaces.setBouncerHiddenFraction(KeyguardBouncer.EXPANSION_HIDDEN); } Loading
packages/SystemUI/tests/src/com/android/systemui/dreams/touch/BouncerSwipeTouchHandlerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -428,7 +428,6 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { @Test public void testInformBouncerShowingOnExpand() { swipeToPosition(1f, Direction.UP, 0); verify(mCentralSurfaces).setBouncerShowingOverDream(true); } /** Loading @@ -441,7 +440,6 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase { Mockito.clearInvocations(mCentralSurfaces); swipeToPosition(0f, Direction.DOWN, 0); verify(mCentralSurfaces).setBouncerShowingOverDream(false); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java +28 −0 Original line number Diff line number Diff line Loading @@ -61,7 +61,9 @@ import com.google.common.truth.Truth; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import java.util.Optional; Loading Loading @@ -97,6 +99,7 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { @Mock private LatencyTracker mLatencyTracker; private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; private KeyguardBouncer.BouncerExpansionCallback mBouncerExpansionCallback; @Before public void setUp() { Loading Loading @@ -136,6 +139,11 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { mBypassController); when(mKeyguardStateController.isOccluded()).thenReturn(false); mStatusBarKeyguardViewManager.show(null); ArgumentCaptor<KeyguardBouncer.BouncerExpansionCallback> callbackArgumentCaptor = ArgumentCaptor.forClass(KeyguardBouncer.BouncerExpansionCallback.class); verify(mKeyguardBouncerFactory).create(any(ViewGroup.class), callbackArgumentCaptor.capture()); mBouncerExpansionCallback = callbackArgumentCaptor.getValue(); } @Test Loading Loading @@ -417,4 +425,24 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { return new PanelExpansionChangeEvent( fraction, expanded, tracking, /* dragDownPxAmount= */ 0f); } @Test public void testReportBouncerOnDreamWhenVisible() { mBouncerExpansionCallback.onVisibilityChanged(true); verify(mCentralSurfaces).setBouncerShowingOverDream(false); Mockito.clearInvocations(mCentralSurfaces); when(mDreamOverlayStateController.isOverlayActive()).thenReturn(true); mBouncerExpansionCallback.onVisibilityChanged(true); verify(mCentralSurfaces).setBouncerShowingOverDream(true); } @Test public void testReportBouncerOnDreamWhenNotVisible() { mBouncerExpansionCallback.onVisibilityChanged(false); verify(mCentralSurfaces).setBouncerShowingOverDream(false); Mockito.clearInvocations(mCentralSurfaces); when(mDreamOverlayStateController.isOverlayActive()).thenReturn(true); mBouncerExpansionCallback.onVisibilityChanged(false); verify(mCentralSurfaces).setBouncerShowingOverDream(false); } }