Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeWindowController.java +0 −7 Original line number Diff line number Diff line Loading @@ -179,13 +179,6 @@ public interface NotificationShadeWindowController extends RemoteInputController */ default void setRequestTopUi(boolean requestTopUi, String componentTag) {} /** * Under low light conditions, we might want to increase the display brightness on devices that * don't have an IR camera. * @param brightness float from 0 to 1 or {@code LayoutParams.BRIGHTNESS_OVERRIDE_NONE} */ default void setFaceAuthDisplayBrightness(float brightness) {} /** * If {@link LightRevealScrim} obscures the UI. * @param opaque if the scrim is opaque Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java +20 −10 Original line number Diff line number Diff line Loading @@ -111,7 +111,6 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW private final SysuiColorExtractor mColorExtractor; private final ScreenOffAnimationController mScreenOffAnimationController; private float mFaceAuthDisplayBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE; /** * Layout params would be aggregated and dispatched all at once if this is > 0. * Loading Loading @@ -266,12 +265,6 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW mScreenBrightnessDoze = value / 255f; } @Override public void setFaceAuthDisplayBrightness(float brightness) { mFaceAuthDisplayBrightness = brightness; apply(mCurrentState); } private void setKeyguardDark(boolean dark) { int vis = mNotificationShadeView.getSystemUiVisibility(); if (dark) { Loading Loading @@ -455,7 +448,9 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW private void applyWindowLayoutParams() { if (mDeferWindowLayoutParams == 0 && mLp != null && mLp.copyFrom(mLpChanged) != 0) { Trace.beginSection("updateViewLayout"); mWindowManager.updateViewLayout(mNotificationShadeView, mLp); Trace.endSection(); } } Loading Loading @@ -523,7 +518,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW if (state.mForceDozeBrightness) { mLpChanged.screenBrightness = mScreenBrightnessDoze; } else { mLpChanged.screenBrightness = mFaceAuthDisplayBrightness; mLpChanged.screenBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE; } } Loading Loading @@ -572,6 +567,10 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW @Override public void setPanelVisible(boolean visible) { if (mCurrentState.mPanelVisible == visible && mCurrentState.mNotificationShadeFocusable == visible) { return; } mCurrentState.mPanelVisible = visible; mCurrentState.mNotificationShadeFocusable = visible; apply(mCurrentState); Loading Loading @@ -626,8 +625,14 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW @Override public void setScrimsVisibility(int scrimsVisibility) { if (scrimsVisibility == mCurrentState.mScrimsVisibility) { return; } boolean wasExpanded = isExpanded(mCurrentState); mCurrentState.mScrimsVisibility = scrimsVisibility; if (wasExpanded != isExpanded(mCurrentState)) { apply(mCurrentState); } mScrimsVisibilityListener.accept(scrimsVisibility); } Loading Loading @@ -687,6 +692,9 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW @Override public void setPanelExpanded(boolean isExpanded) { if (mCurrentState.mPanelExpanded == isExpanded) { return; } mCurrentState.mPanelExpanded = isExpanded; apply(mCurrentState); } Loading @@ -703,6 +711,9 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW */ @Override public void setForceDozeBrightness(boolean forceDozeBrightness) { if (mCurrentState.mForceDozeBrightness == forceDozeBrightness) { return; } mCurrentState.mForceDozeBrightness = forceDozeBrightness; apply(mCurrentState); } Loading Loading @@ -841,7 +852,6 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW boolean mLightRevealScrimOpaque; boolean mForceCollapsed; boolean mForceDozeBrightness; int mFaceAuthDisplayBrightness; boolean mForceUserActivity; boolean mLaunchingActivity; boolean mBackdropShowing; Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImplTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static org.mockito.Mockito.clearInvocations; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; import android.app.IActivityManager; Loading Loading @@ -103,6 +104,7 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase { mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView); mNotificationShadeWindowController.attach(); verify(mWindowManager).addView(eq(mNotificationShadeWindowView), any()); } @Test Loading Loading @@ -173,6 +175,14 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase { verify(mWindowManager, never()).updateViewLayout(any(), mLayoutParameters.capture()); } @Test public void setScrimsVisibility_earlyReturn() { clearInvocations(mWindowManager); mNotificationShadeWindowController.setScrimsVisibility(ScrimController.TRANSPARENT); // Abort early if value didn't change verify(mWindowManager, never()).updateViewLayout(any(), mLayoutParameters.capture()); } @Test public void attach_animatingKeyguardAndSurface_wallpaperVisible() { clearInvocations(mWindowManager); Loading Loading @@ -221,6 +231,8 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase { public void setPanelExpanded_notFocusable_altFocusable_whenPanelIsOpen() { mNotificationShadeWindowController.setPanelExpanded(true); clearInvocations(mWindowManager); mNotificationShadeWindowController.setPanelExpanded(true); verifyNoMoreInteractions(mWindowManager); mNotificationShadeWindowController.setNotificationShadeFocusable(true); verify(mWindowManager).updateViewLayout(any(), mLayoutParameters.capture()); Loading Loading @@ -287,6 +299,8 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase { public void batchApplyWindowLayoutParams_doesNotDispatchEvents() { mNotificationShadeWindowController.setForceDozeBrightness(true); verify(mWindowManager).updateViewLayout(any(), any()); mNotificationShadeWindowController.setForceDozeBrightness(true); verifyNoMoreInteractions(mWindowManager); clearInvocations(mWindowManager); mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeWindowController.java +0 −7 Original line number Diff line number Diff line Loading @@ -179,13 +179,6 @@ public interface NotificationShadeWindowController extends RemoteInputController */ default void setRequestTopUi(boolean requestTopUi, String componentTag) {} /** * Under low light conditions, we might want to increase the display brightness on devices that * don't have an IR camera. * @param brightness float from 0 to 1 or {@code LayoutParams.BRIGHTNESS_OVERRIDE_NONE} */ default void setFaceAuthDisplayBrightness(float brightness) {} /** * If {@link LightRevealScrim} obscures the UI. * @param opaque if the scrim is opaque Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java +20 −10 Original line number Diff line number Diff line Loading @@ -111,7 +111,6 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW private final SysuiColorExtractor mColorExtractor; private final ScreenOffAnimationController mScreenOffAnimationController; private float mFaceAuthDisplayBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE; /** * Layout params would be aggregated and dispatched all at once if this is > 0. * Loading Loading @@ -266,12 +265,6 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW mScreenBrightnessDoze = value / 255f; } @Override public void setFaceAuthDisplayBrightness(float brightness) { mFaceAuthDisplayBrightness = brightness; apply(mCurrentState); } private void setKeyguardDark(boolean dark) { int vis = mNotificationShadeView.getSystemUiVisibility(); if (dark) { Loading Loading @@ -455,7 +448,9 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW private void applyWindowLayoutParams() { if (mDeferWindowLayoutParams == 0 && mLp != null && mLp.copyFrom(mLpChanged) != 0) { Trace.beginSection("updateViewLayout"); mWindowManager.updateViewLayout(mNotificationShadeView, mLp); Trace.endSection(); } } Loading Loading @@ -523,7 +518,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW if (state.mForceDozeBrightness) { mLpChanged.screenBrightness = mScreenBrightnessDoze; } else { mLpChanged.screenBrightness = mFaceAuthDisplayBrightness; mLpChanged.screenBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE; } } Loading Loading @@ -572,6 +567,10 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW @Override public void setPanelVisible(boolean visible) { if (mCurrentState.mPanelVisible == visible && mCurrentState.mNotificationShadeFocusable == visible) { return; } mCurrentState.mPanelVisible = visible; mCurrentState.mNotificationShadeFocusable = visible; apply(mCurrentState); Loading Loading @@ -626,8 +625,14 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW @Override public void setScrimsVisibility(int scrimsVisibility) { if (scrimsVisibility == mCurrentState.mScrimsVisibility) { return; } boolean wasExpanded = isExpanded(mCurrentState); mCurrentState.mScrimsVisibility = scrimsVisibility; if (wasExpanded != isExpanded(mCurrentState)) { apply(mCurrentState); } mScrimsVisibilityListener.accept(scrimsVisibility); } Loading Loading @@ -687,6 +692,9 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW @Override public void setPanelExpanded(boolean isExpanded) { if (mCurrentState.mPanelExpanded == isExpanded) { return; } mCurrentState.mPanelExpanded = isExpanded; apply(mCurrentState); } Loading @@ -703,6 +711,9 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW */ @Override public void setForceDozeBrightness(boolean forceDozeBrightness) { if (mCurrentState.mForceDozeBrightness == forceDozeBrightness) { return; } mCurrentState.mForceDozeBrightness = forceDozeBrightness; apply(mCurrentState); } Loading Loading @@ -841,7 +852,6 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW boolean mLightRevealScrimOpaque; boolean mForceCollapsed; boolean mForceDozeBrightness; int mFaceAuthDisplayBrightness; boolean mForceUserActivity; boolean mLaunchingActivity; boolean mBackdropShowing; Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImplTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static org.mockito.Mockito.clearInvocations; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; import android.app.IActivityManager; Loading Loading @@ -103,6 +104,7 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase { mNotificationShadeWindowController.setNotificationShadeView(mNotificationShadeWindowView); mNotificationShadeWindowController.attach(); verify(mWindowManager).addView(eq(mNotificationShadeWindowView), any()); } @Test Loading Loading @@ -173,6 +175,14 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase { verify(mWindowManager, never()).updateViewLayout(any(), mLayoutParameters.capture()); } @Test public void setScrimsVisibility_earlyReturn() { clearInvocations(mWindowManager); mNotificationShadeWindowController.setScrimsVisibility(ScrimController.TRANSPARENT); // Abort early if value didn't change verify(mWindowManager, never()).updateViewLayout(any(), mLayoutParameters.capture()); } @Test public void attach_animatingKeyguardAndSurface_wallpaperVisible() { clearInvocations(mWindowManager); Loading Loading @@ -221,6 +231,8 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase { public void setPanelExpanded_notFocusable_altFocusable_whenPanelIsOpen() { mNotificationShadeWindowController.setPanelExpanded(true); clearInvocations(mWindowManager); mNotificationShadeWindowController.setPanelExpanded(true); verifyNoMoreInteractions(mWindowManager); mNotificationShadeWindowController.setNotificationShadeFocusable(true); verify(mWindowManager).updateViewLayout(any(), mLayoutParameters.capture()); Loading Loading @@ -287,6 +299,8 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase { public void batchApplyWindowLayoutParams_doesNotDispatchEvents() { mNotificationShadeWindowController.setForceDozeBrightness(true); verify(mWindowManager).updateViewLayout(any(), any()); mNotificationShadeWindowController.setForceDozeBrightness(true); verifyNoMoreInteractions(mWindowManager); clearInvocations(mWindowManager); mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> { Loading