Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +3 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.Interpolators import com.android.systemui.dump.DumpManager import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK import com.android.systemui.statusbar.phone.NotificationShadeWindowController import com.android.systemui.statusbar.phone.PanelExpansionListener import com.android.systemui.statusbar.policy.KeyguardStateController import java.io.FileDescriptor Loading @@ -50,6 +51,7 @@ class NotificationShadeDepthController @Inject constructor( private val keyguardStateController: KeyguardStateController, private val choreographer: Choreographer, private val wallpaperManager: WallpaperManager, private val notificationShadeWindowController: NotificationShadeWindowController, dumpManager: DumpManager ) : PanelExpansionListener, Dumpable { companion object { Loading @@ -62,7 +64,6 @@ class NotificationShadeDepthController @Inject constructor( private var keyguardAnimator: Animator? = null private var notificationAnimator: Animator? = null private var updateScheduled: Boolean = false private var shadeExpansion = 1.0f private val shadeSpring = SpringAnimation(this, object : FloatPropertyCompat<NotificationShadeDepthController>("shadeBlurRadius") { override fun setValue(rect: NotificationShadeDepthController?, value: Float) { Loading Loading @@ -100,6 +101,7 @@ class NotificationShadeDepthController @Inject constructor( val rawZoom = max(blurUtils.ratioOfBlurRadius(blur), globalDialogVisibility) wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomInterpolator.getInterpolation(rawZoom)) notificationShadeWindowController.setBackgroundBlurRadius(blur) } /** Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowController.java +16 −1 Original line number Diff line number Diff line Loading @@ -309,7 +309,8 @@ public class NotificationShadeWindowController implements Callback, Dumpable, return !state.mForceCollapsed && (state.isKeyguardShowingAndNotOccluded() || state.mPanelVisible || state.mKeyguardFadingAway || state.mBouncerShowing || state.mHeadsUpShowing || state.mBubblesShowing || state.mScrimsVisibility != ScrimController.TRANSPARENT); || state.mScrimsVisibility != ScrimController.TRANSPARENT) || state.mBackgroundBlurRadius > 0; } private void applyFitsSystemWindows(State state) { Loading Loading @@ -478,6 +479,19 @@ public class NotificationShadeWindowController implements Callback, Dumpable, apply(mCurrentState); } /** * Current blur level, controller by * {@link com.android.systemui.statusbar.NotificationShadeDepthController}. * @param backgroundBlurRadius Radius in pixels. */ public void setBackgroundBlurRadius(int backgroundBlurRadius) { if (mCurrentState.mBackgroundBlurRadius == backgroundBlurRadius) { return; } mCurrentState.mBackgroundBlurRadius = backgroundBlurRadius; apply(mCurrentState); } public void setHeadsUpShowing(boolean showing) { mCurrentState.mHeadsUpShowing = showing; apply(mCurrentState); Loading Loading @@ -665,6 +679,7 @@ public class NotificationShadeWindowController implements Callback, Dumpable, boolean mForcePluginOpen; boolean mDozing; int mScrimsVisibility; int mBackgroundBlurRadius; private boolean isKeyguardShowingAndNotOccluded() { return mKeyguardShowing && !mKeyguardOccluded; Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; Loading @@ -27,6 +28,7 @@ import static org.mockito.Mockito.when; import android.app.IActivityManager; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper.RunWithLooper; import android.view.View; import android.view.WindowManager; import androidx.test.filters.SmallTest; Loading Loading @@ -110,4 +112,13 @@ public class NotificationShadeWindowControllerTest extends SysuiTestCase { public void testSetForcePluginOpen_beforeStatusBarInitialization() { mNotificationShadeWindowController.setForcePluginOpen(true); } @Test public void setBackgroundBlurRadius_expandedWithBlurs() { mNotificationShadeWindowController.setBackgroundBlurRadius(10); verify(mNotificationShadeWindowView).setVisibility(eq(View.VISIBLE)); mNotificationShadeWindowController.setBackgroundBlurRadius(0); verify(mNotificationShadeWindowView).setVisibility(eq(View.INVISIBLE)); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +3 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.Interpolators import com.android.systemui.dump.DumpManager import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK import com.android.systemui.statusbar.phone.NotificationShadeWindowController import com.android.systemui.statusbar.phone.PanelExpansionListener import com.android.systemui.statusbar.policy.KeyguardStateController import java.io.FileDescriptor Loading @@ -50,6 +51,7 @@ class NotificationShadeDepthController @Inject constructor( private val keyguardStateController: KeyguardStateController, private val choreographer: Choreographer, private val wallpaperManager: WallpaperManager, private val notificationShadeWindowController: NotificationShadeWindowController, dumpManager: DumpManager ) : PanelExpansionListener, Dumpable { companion object { Loading @@ -62,7 +64,6 @@ class NotificationShadeDepthController @Inject constructor( private var keyguardAnimator: Animator? = null private var notificationAnimator: Animator? = null private var updateScheduled: Boolean = false private var shadeExpansion = 1.0f private val shadeSpring = SpringAnimation(this, object : FloatPropertyCompat<NotificationShadeDepthController>("shadeBlurRadius") { override fun setValue(rect: NotificationShadeDepthController?, value: Float) { Loading Loading @@ -100,6 +101,7 @@ class NotificationShadeDepthController @Inject constructor( val rawZoom = max(blurUtils.ratioOfBlurRadius(blur), globalDialogVisibility) wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomInterpolator.getInterpolation(rawZoom)) notificationShadeWindowController.setBackgroundBlurRadius(blur) } /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowController.java +16 −1 Original line number Diff line number Diff line Loading @@ -309,7 +309,8 @@ public class NotificationShadeWindowController implements Callback, Dumpable, return !state.mForceCollapsed && (state.isKeyguardShowingAndNotOccluded() || state.mPanelVisible || state.mKeyguardFadingAway || state.mBouncerShowing || state.mHeadsUpShowing || state.mBubblesShowing || state.mScrimsVisibility != ScrimController.TRANSPARENT); || state.mScrimsVisibility != ScrimController.TRANSPARENT) || state.mBackgroundBlurRadius > 0; } private void applyFitsSystemWindows(State state) { Loading Loading @@ -478,6 +479,19 @@ public class NotificationShadeWindowController implements Callback, Dumpable, apply(mCurrentState); } /** * Current blur level, controller by * {@link com.android.systemui.statusbar.NotificationShadeDepthController}. * @param backgroundBlurRadius Radius in pixels. */ public void setBackgroundBlurRadius(int backgroundBlurRadius) { if (mCurrentState.mBackgroundBlurRadius == backgroundBlurRadius) { return; } mCurrentState.mBackgroundBlurRadius = backgroundBlurRadius; apply(mCurrentState); } public void setHeadsUpShowing(boolean showing) { mCurrentState.mHeadsUpShowing = showing; apply(mCurrentState); Loading Loading @@ -665,6 +679,7 @@ public class NotificationShadeWindowController implements Callback, Dumpable, boolean mForcePluginOpen; boolean mDozing; int mScrimsVisibility; int mBackgroundBlurRadius; private boolean isKeyguardShowingAndNotOccluded() { return mKeyguardShowing && !mKeyguardOccluded; Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; Loading @@ -27,6 +28,7 @@ import static org.mockito.Mockito.when; import android.app.IActivityManager; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper.RunWithLooper; import android.view.View; import android.view.WindowManager; import androidx.test.filters.SmallTest; Loading Loading @@ -110,4 +112,13 @@ public class NotificationShadeWindowControllerTest extends SysuiTestCase { public void testSetForcePluginOpen_beforeStatusBarInitialization() { mNotificationShadeWindowController.setForcePluginOpen(true); } @Test public void setBackgroundBlurRadius_expandedWithBlurs() { mNotificationShadeWindowController.setBackgroundBlurRadius(10); verify(mNotificationShadeWindowView).setVisibility(eq(View.VISIBLE)); mNotificationShadeWindowController.setBackgroundBlurRadius(0); verify(mNotificationShadeWindowView).setVisibility(eq(View.INVISIBLE)); } }