Loading packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java +1 −1 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ public interface KeyguardViewController { /** * Stop showing the alternate bouncer, if showing. */ void hideAlternateBouncer(boolean forceUpdateScrim); void hideAlternateBouncer(boolean updateScrim); // TODO: Deprecate registerStatusBar in KeyguardViewController interface. It is currently // only used for testing purposes in StatusBarKeyguardViewManager, and it prevents us from Loading packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +3 −1 Original line number Diff line number Diff line Loading @@ -240,7 +240,9 @@ public class NotificationShadeWindowViewController { mFalsingCollector.onTouchEvent(ev); mPulsingWakeupGestureHandler.onTouchEvent(ev); mStatusBarKeyguardViewManager.onTouch(ev); if (mStatusBarKeyguardViewManager.onTouch(ev)) { return true; } if (mBrightnessMirror != null && mBrightnessMirror.getVisibility() == View.VISIBLE) { // Disallow new pointers while the brightness mirror is visible. This is so that Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +0 −6 Original line number Diff line number Diff line Loading @@ -605,7 +605,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { private Runnable mLaunchTransitionEndRunnable; private Runnable mLaunchTransitionCancelRunnable; private boolean mLaunchingAffordance; private boolean mLaunchCameraWhenFinishedWaking; private boolean mLaunchCameraOnFinishedGoingToSleep; private boolean mLaunchEmergencyActionWhenFinishedWaking; Loading Loading @@ -3744,8 +3743,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mScrimController.setExpansionAffectsAlpha(!unlocking); boolean launchingAffordanceWithPreview = mLaunchingAffordance; mScrimController.setLaunchingAffordanceWithPreview(launchingAffordanceWithPreview); if (mAlternateBouncerInteractor.isVisibleState()) { if ((!isOccluded() || isPanelExpanded()) && (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED Loading @@ -3764,9 +3761,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { ScrimState state = mStatusBarKeyguardViewManager.primaryBouncerNeedsScrimming() ? ScrimState.BOUNCER_SCRIMMED : ScrimState.BOUNCER; mScrimController.transitionTo(state); } else if (launchingAffordanceWithPreview) { // We want to avoid animating when launching with a preview. mScrimController.transitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback); } else if (mBrightnessMirrorVisible) { mScrimController.transitionTo(ScrimState.BRIGHTNESS_MIRROR); } else if (mState == StatusBarState.SHADE_LOCKED) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +13 −9 Original line number Diff line number Diff line Loading @@ -405,14 +405,14 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } /** * Sets a new legacy alternate bouncer. Only used if mdoern alternate bouncer is NOT enable. * Sets a new legacy alternate bouncer. Only used if modern alternate bouncer is NOT enabled. */ public void setLegacyAlternateBouncer(@NonNull LegacyAlternateBouncer alternateBouncerLegacy) { if (!mIsModernAlternateBouncerEnabled) { if (!Objects.equals(mAlternateBouncerInteractor.getLegacyAlternateBouncer(), alternateBouncerLegacy)) { mAlternateBouncerInteractor.setLegacyAlternateBouncer(alternateBouncerLegacy); hideAlternateBouncer(false); hideAlternateBouncer(true); } } Loading Loading @@ -640,7 +640,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb */ public void showPrimaryBouncer(boolean scrimmed) { hideAlternateBouncer(false); if (mKeyguardStateController.isShowing() && !isBouncerShowing()) { mPrimaryBouncerInteractor.show(scrimmed); } Loading Loading @@ -734,7 +733,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb showBouncerOrKeyguard(hideBouncerWhenShowing); } if (hideBouncerWhenShowing) { hideAlternateBouncer(false); hideAlternateBouncer(true); } mKeyguardUpdateManager.sendKeyguardReset(); updateStates(); Loading @@ -742,8 +741,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } @Override public void hideAlternateBouncer(boolean forceUpdateScrim) { updateAlternateBouncerShowing(mAlternateBouncerInteractor.hide() || forceUpdateScrim); public void hideAlternateBouncer(boolean updateScrim) { updateAlternateBouncerShowing(mAlternateBouncerInteractor.hide() && updateScrim); } private void updateAlternateBouncerShowing(boolean updateScrim) { Loading Loading @@ -1448,16 +1447,21 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb * For any touches on the NPVC, show the primary bouncer if the alternate bouncer is currently * showing. */ public void onTouch(MotionEvent event) { if (mAlternateBouncerInteractor.isVisibleState() public boolean onTouch(MotionEvent event) { boolean handledTouch = false; if (event.getAction() == MotionEvent.ACTION_UP && mAlternateBouncerInteractor.isVisibleState() && mAlternateBouncerInteractor.hasAlternateBouncerShownWithMinTime()) { showPrimaryBouncer(true); handledTouch = true; } // Forward NPVC touches to callbacks in case they want to respond to touches for (KeyguardViewManagerCallback callback: mCallbacks) { callback.onTouch(event); } return handledTouch; } /** Update keyguard position based on a tapped X coordinate. */ Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +14 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,20 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { underTest.keyguardMessageArea verify(view).findViewById<ViewGroup>(R.id.keyguard_message_area) } @Test fun handleDispatchTouchEvent_statusBarViewControllerOnTouch_returnsTrue() { underTest.setStatusBarViewController(phoneStatusBarViewController) // GIVEN the statusBarKeyguardViewManager will handle any touches whenever(statusBarKeyguardViewManager.onTouch(any())).thenReturn(true) // WHEN a touch is dispatched val returnVal = interactionEventHandler.handleDispatchTouchEvent(downEv) // THEN handleDispatchTouchEvent returns true assertThat(returnVal).isTrue() } } private val downEv = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0) Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardViewController.java +1 −1 Original line number Diff line number Diff line Loading @@ -168,7 +168,7 @@ public interface KeyguardViewController { /** * Stop showing the alternate bouncer, if showing. */ void hideAlternateBouncer(boolean forceUpdateScrim); void hideAlternateBouncer(boolean updateScrim); // TODO: Deprecate registerStatusBar in KeyguardViewController interface. It is currently // only used for testing purposes in StatusBarKeyguardViewManager, and it prevents us from Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java +3 −1 Original line number Diff line number Diff line Loading @@ -240,7 +240,9 @@ public class NotificationShadeWindowViewController { mFalsingCollector.onTouchEvent(ev); mPulsingWakeupGestureHandler.onTouchEvent(ev); mStatusBarKeyguardViewManager.onTouch(ev); if (mStatusBarKeyguardViewManager.onTouch(ev)) { return true; } if (mBrightnessMirror != null && mBrightnessMirror.getVisibility() == View.VISIBLE) { // Disallow new pointers while the brightness mirror is visible. This is so that Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +0 −6 Original line number Diff line number Diff line Loading @@ -605,7 +605,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { private Runnable mLaunchTransitionEndRunnable; private Runnable mLaunchTransitionCancelRunnable; private boolean mLaunchingAffordance; private boolean mLaunchCameraWhenFinishedWaking; private boolean mLaunchCameraOnFinishedGoingToSleep; private boolean mLaunchEmergencyActionWhenFinishedWaking; Loading Loading @@ -3744,8 +3743,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mScrimController.setExpansionAffectsAlpha(!unlocking); boolean launchingAffordanceWithPreview = mLaunchingAffordance; mScrimController.setLaunchingAffordanceWithPreview(launchingAffordanceWithPreview); if (mAlternateBouncerInteractor.isVisibleState()) { if ((!isOccluded() || isPanelExpanded()) && (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED Loading @@ -3764,9 +3761,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { ScrimState state = mStatusBarKeyguardViewManager.primaryBouncerNeedsScrimming() ? ScrimState.BOUNCER_SCRIMMED : ScrimState.BOUNCER; mScrimController.transitionTo(state); } else if (launchingAffordanceWithPreview) { // We want to avoid animating when launching with a preview. mScrimController.transitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback); } else if (mBrightnessMirrorVisible) { mScrimController.transitionTo(ScrimState.BRIGHTNESS_MIRROR); } else if (mState == StatusBarState.SHADE_LOCKED) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +13 −9 Original line number Diff line number Diff line Loading @@ -405,14 +405,14 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } /** * Sets a new legacy alternate bouncer. Only used if mdoern alternate bouncer is NOT enable. * Sets a new legacy alternate bouncer. Only used if modern alternate bouncer is NOT enabled. */ public void setLegacyAlternateBouncer(@NonNull LegacyAlternateBouncer alternateBouncerLegacy) { if (!mIsModernAlternateBouncerEnabled) { if (!Objects.equals(mAlternateBouncerInteractor.getLegacyAlternateBouncer(), alternateBouncerLegacy)) { mAlternateBouncerInteractor.setLegacyAlternateBouncer(alternateBouncerLegacy); hideAlternateBouncer(false); hideAlternateBouncer(true); } } Loading Loading @@ -640,7 +640,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb */ public void showPrimaryBouncer(boolean scrimmed) { hideAlternateBouncer(false); if (mKeyguardStateController.isShowing() && !isBouncerShowing()) { mPrimaryBouncerInteractor.show(scrimmed); } Loading Loading @@ -734,7 +733,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb showBouncerOrKeyguard(hideBouncerWhenShowing); } if (hideBouncerWhenShowing) { hideAlternateBouncer(false); hideAlternateBouncer(true); } mKeyguardUpdateManager.sendKeyguardReset(); updateStates(); Loading @@ -742,8 +741,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } @Override public void hideAlternateBouncer(boolean forceUpdateScrim) { updateAlternateBouncerShowing(mAlternateBouncerInteractor.hide() || forceUpdateScrim); public void hideAlternateBouncer(boolean updateScrim) { updateAlternateBouncerShowing(mAlternateBouncerInteractor.hide() && updateScrim); } private void updateAlternateBouncerShowing(boolean updateScrim) { Loading Loading @@ -1448,16 +1447,21 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb * For any touches on the NPVC, show the primary bouncer if the alternate bouncer is currently * showing. */ public void onTouch(MotionEvent event) { if (mAlternateBouncerInteractor.isVisibleState() public boolean onTouch(MotionEvent event) { boolean handledTouch = false; if (event.getAction() == MotionEvent.ACTION_UP && mAlternateBouncerInteractor.isVisibleState() && mAlternateBouncerInteractor.hasAlternateBouncerShownWithMinTime()) { showPrimaryBouncer(true); handledTouch = true; } // Forward NPVC touches to callbacks in case they want to respond to touches for (KeyguardViewManagerCallback callback: mCallbacks) { callback.onTouch(event); } return handledTouch; } /** Update keyguard position based on a tapped X coordinate. */ Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt +14 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,20 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() { underTest.keyguardMessageArea verify(view).findViewById<ViewGroup>(R.id.keyguard_message_area) } @Test fun handleDispatchTouchEvent_statusBarViewControllerOnTouch_returnsTrue() { underTest.setStatusBarViewController(phoneStatusBarViewController) // GIVEN the statusBarKeyguardViewManager will handle any touches whenever(statusBarKeyguardViewManager.onTouch(any())).thenReturn(true) // WHEN a touch is dispatched val returnVal = interactionEventHandler.handleDispatchTouchEvent(downEv) // THEN handleDispatchTouchEvent returns true assertThat(returnVal).isTrue() } } private val downEv = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0) Loading