diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java index 4f5d71a3cb62a..98fb3c9b91070 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java @@ -71,7 +71,6 @@ import com.android.systemui.model.SysUiState; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.GlobalActions.GlobalActionsManager; import com.android.systemui.plugins.GlobalActionsPanelPlugin; -import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.ConfigurationController; @@ -103,7 +102,6 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite private final LockPatternUtils mLockPatternUtils; private final KeyguardStateController mKeyguardStateController; - private final NotificationShadeDepthController mDepthController; private final SysUiState mSysUiState; private final ActivityStarter mActivityStarter; private final SysuiColorExtractor mSysuiColorExtractor; @@ -164,7 +162,6 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite IActivityManager iActivityManager, @Nullable TelecomManager telecomManager, MetricsLogger metricsLogger, - NotificationShadeDepthController depthController, SysuiColorExtractor colorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, @@ -196,7 +193,6 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite iActivityManager, telecomManager, metricsLogger, - depthController, colorExtractor, statusBarService, notificationShadeWindowController, @@ -211,7 +207,6 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite mLockPatternUtils = lockPatternUtils; mKeyguardStateController = keyguardStateController; - mDepthController = depthController; mSysuiColorExtractor = colorExtractor; mStatusBarService = statusBarService; mNotificationShadeWindowController = notificationShadeWindowController; @@ -266,9 +261,8 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite protected ActionsDialogLite createDialog() { initDialogItems(); - mDepthController.setShowingHomeControls(true); ActionsDialog dialog = new ActionsDialog(getContext(), mAdapter, mOverflowAdapter, - this::getWalletViewController, mDepthController, mSysuiColorExtractor, + this::getWalletViewController, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, mSysUiState, this::onRotate, isKeyguardShowing(), mPowerAdapter, getEventLogger(), getStatusBar()); @@ -335,17 +329,15 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite ActionsDialog(Context context, MyAdapter adapter, MyOverflowAdapter overflowAdapter, Provider walletFactory, - NotificationShadeDepthController depthController, SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, SysUiState sysuiState, Runnable onRotateCallback, boolean keyguardShowing, MyPowerOptionsAdapter powerAdapter, UiEventLogger uiEventLogger, StatusBar statusBar) { super(context, com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActions, - adapter, overflowAdapter, depthController, sysuiColorExtractor, - statusBarService, notificationShadeWindowController, sysuiState, - onRotateCallback, keyguardShowing, powerAdapter, uiEventLogger, - statusBar); + adapter, overflowAdapter, sysuiColorExtractor, statusBarService, + notificationShadeWindowController, sysuiState, onRotateCallback, + keyguardShowing, powerAdapter, uiEventLogger, statusBar); mWalletFactory = walletFactory; // Update window attributes @@ -493,8 +485,6 @@ public class GlobalActionsDialog extends GlobalActionsDialogLite float animatedValue = animation.getAnimatedFraction(); int alpha = (int) (animatedValue * mScrimAlpha * 255); mBackgroundDrawable.setAlpha(alpha); - mDepthController.updateGlobalDialogVisibility(animatedValue, - mGlobalActionsLayout); }); ObjectAnimator xAnimator = diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java index 91e4ea6d79058..2afce719c4060 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java @@ -119,7 +119,6 @@ import com.android.systemui.model.SysUiState; import com.android.systemui.plugins.GlobalActions.GlobalActionsManager; import com.android.systemui.plugins.GlobalActionsPanelPlugin; import com.android.systemui.scrim.ScrimDrawable; -import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.ConfigurationController; @@ -190,7 +189,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene private final TelecomManager mTelecomManager; private final MetricsLogger mMetricsLogger; private final UiEventLogger mUiEventLogger; - private final NotificationShadeDepthController mDepthController; private final SysUiState mSysUiState; // Used for RingerModeTracker @@ -328,7 +326,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene IActivityManager iActivityManager, @Nullable TelecomManager telecomManager, MetricsLogger metricsLogger, - NotificationShadeDepthController depthController, SysuiColorExtractor colorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, @@ -359,7 +356,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mTelecomManager = telecomManager; mMetricsLogger = metricsLogger; mUiEventLogger = uiEventLogger; - mDepthController = depthController; mSysuiColorExtractor = colorExtractor; mStatusBarService = statusBarService; mNotificationShadeWindowController = notificationShadeWindowController; @@ -649,11 +645,9 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene protected ActionsDialogLite createDialog() { initDialogItems(); - mDepthController.setShowingHomeControls(false); ActionsDialogLite dialog = new ActionsDialogLite(mContext, com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActionsLite, - mAdapter, mOverflowAdapter, - mDepthController, mSysuiColorExtractor, + mAdapter, mOverflowAdapter, mSysuiColorExtractor, mStatusBarService, mNotificationShadeWindowController, mSysUiState, this::onRotate, mKeyguardShowing, mPowerAdapter, mUiEventLogger, mStatusBar); @@ -2122,7 +2116,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene protected boolean mShowing; protected float mScrimAlpha; protected final NotificationShadeWindowController mNotificationShadeWindowController; - protected final NotificationShadeDepthController mDepthController; protected final SysUiState mSysUiState; private ListPopupWindow mOverflowPopup; private Dialog mPowerOptionsDialog; @@ -2177,7 +2170,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene ActionsDialogLite(Context context, int themeRes, MyAdapter adapter, MyOverflowAdapter overflowAdapter, - NotificationShadeDepthController depthController, SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, SysUiState sysuiState, Runnable onRotateCallback, boolean keyguardShowing, @@ -2188,7 +2180,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene mAdapter = adapter; mOverflowAdapter = overflowAdapter; mPowerOptionsAdapter = powerAdapter; - mDepthController = depthController; mColorExtractor = sysuiColorExtractor; mStatusBarService = statusBarService; mNotificationShadeWindowController = notificationShadeWindowController; @@ -2400,7 +2391,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene float animatedValue = animation.getAnimatedFraction(); int alpha = (int) (animatedValue * mScrimAlpha * 255); mBackgroundDrawable.setAlpha(alpha); - mDepthController.updateGlobalDialogVisibility(animatedValue, mGlobalActionsLayout); }); ObjectAnimator xAnimator = @@ -2430,7 +2420,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene float animatedValue = 1f - animation.getAnimatedFraction(); int alpha = (int) (animatedValue * mScrimAlpha * 255); mBackgroundDrawable.setAlpha(alpha); - mDepthController.updateGlobalDialogVisibility(animatedValue, mGlobalActionsLayout); }); float xOffset = mGlobalActionsLayout.getAnimationOffsetX(); @@ -2467,7 +2456,6 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene dismissOverflow(true); dismissPowerOptions(true); mNotificationShadeWindowController.setRequestTopUi(false, TAG); - mDepthController.updateGlobalDialogVisibility(0, null /* view */); mSysUiState.setFlag(SYSUI_STATE_GLOBAL_ACTIONS_SHOWING, false) .commitUpdate(mContext.getDisplayId()); super.dismiss(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt index f03a9a8f3589c..e5c3b82d06cd6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt @@ -92,10 +92,6 @@ class NotificationShadeDepthController @Inject constructor( var shadeSpring = DepthAnimation() var shadeAnimation = DepthAnimation() - @VisibleForTesting - var globalActionsSpring = DepthAnimation() - var showingHomeControls: Boolean = false - @VisibleForTesting var brightnessMirrorSpring = DepthAnimation() var brightnessMirrorVisible: Boolean = false @@ -186,13 +182,7 @@ class NotificationShadeDepthController @Inject constructor( } } - // Home controls have black background, this means that we should not have blur when they - // are fully visible, otherwise we'll enter Client Composition unnecessarily. - var globalActionsRadius = globalActionsSpring.radius - if (showingHomeControls) { - globalActionsRadius = 0 - } - var blur = max(shadeRadius.toInt(), globalActionsRadius) + var blur = shadeRadius.toInt() // Make blur be 0 if it is necessary to stop blur effect. if (scrimsVisible || !blurUtils.supportsBlursOnWindows()) { @@ -271,7 +261,6 @@ class NotificationShadeDepthController @Inject constructor( if (isDozing) { shadeSpring.finishIfRunning() shadeAnimation.finishIfRunning() - globalActionsSpring.finishIfRunning() brightnessMirrorSpring.finishIfRunning() } } @@ -427,17 +416,12 @@ class NotificationShadeDepthController @Inject constructor( !keyguardStateController.isKeyguardFadingAway } - fun updateGlobalDialogVisibility(visibility: Float, dialogView: View?) { - globalActionsSpring.animateTo(blurUtils.blurRadiusOfRatio(visibility), dialogView) - } - override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array) { IndentingPrintWriter(pw, " ").let { it.println("StatusBarWindowBlurController:") it.increaseIndent() it.println("shadeRadius: ${shadeSpring.radius}") it.println("shadeAnimation: ${shadeAnimation.radius}") - it.println("globalActionsRadius: ${globalActionsSpring.radius}") it.println("brightnessMirrorRadius: ${brightnessMirrorSpring.radius}") it.println("wakeAndUnlockBlur: $wakeAndUnlockBlurRadius") it.println("ignoreShadeBlurUntilHidden: $ignoreShadeBlurUntilHidden") diff --git a/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java b/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java index bcc4ee09b2eca..32abbc755c560 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java @@ -57,7 +57,6 @@ import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.model.SysUiState; import com.android.systemui.plugins.GlobalActions; import com.android.systemui.settings.UserContextProvider; -import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.ConfigurationController; @@ -99,7 +98,6 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { @Mock private TrustManager mTrustManager; @Mock private IActivityManager mActivityManager; @Mock private MetricsLogger mMetricsLogger; - @Mock private NotificationShadeDepthController mDepthController; @Mock private SysuiColorExtractor mColorExtractor; @Mock private IStatusBarService mStatusBarService; @Mock private NotificationShadeWindowController mNotificationShadeWindowController; @@ -146,7 +144,6 @@ public class GlobalActionsDialogLiteTest extends SysuiTestCase { mActivityManager, null, mMetricsLogger, - mDepthController, mColorExtractor, mStatusBarService, mNotificationShadeWindowController, diff --git a/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogTest.java index e5c104e7d377a..2fa67cc0be600 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogTest.java @@ -64,7 +64,6 @@ import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.GlobalActions; import com.android.systemui.plugins.GlobalActionsPanelPlugin; import com.android.systemui.settings.UserTracker; -import com.android.systemui.statusbar.NotificationShadeDepthController; import com.android.systemui.statusbar.NotificationShadeWindowController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.ConfigurationController; @@ -111,7 +110,6 @@ public class GlobalActionsDialogTest extends SysuiTestCase { @Mock private TrustManager mTrustManager; @Mock private IActivityManager mActivityManager; @Mock private MetricsLogger mMetricsLogger; - @Mock private NotificationShadeDepthController mDepthController; @Mock private SysuiColorExtractor mColorExtractor; @Mock private IStatusBarService mStatusBarService; @Mock private NotificationShadeWindowController mNotificationShadeWindowController; @@ -161,7 +159,6 @@ public class GlobalActionsDialogTest extends SysuiTestCase { mActivityManager, null, mMetricsLogger, - mDepthController, mColorExtractor, mStatusBarService, mNotificationShadeWindowController, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt index 60b38892e7767..d9f14263abcf2 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt @@ -71,7 +71,6 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Mock private lateinit var windowToken: IBinder @Mock private lateinit var shadeSpring: NotificationShadeDepthController.DepthAnimation @Mock private lateinit var shadeAnimation: NotificationShadeDepthController.DepthAnimation - @Mock private lateinit var globalActionsSpring: NotificationShadeDepthController.DepthAnimation @Mock private lateinit var brightnessSpring: NotificationShadeDepthController.DepthAnimation @Mock private lateinit var listener: NotificationShadeDepthController.DepthListener @Mock private lateinit var dozeParameters: DozeParameters @@ -106,7 +105,6 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { notificationShadeDepthController.shadeSpring = shadeSpring notificationShadeDepthController.shadeAnimation = shadeAnimation notificationShadeDepthController.brightnessMirrorSpring = brightnessSpring - notificationShadeDepthController.globalActionsSpring = globalActionsSpring notificationShadeDepthController.root = root val captor = ArgumentCaptor.forClass(StatusBarStateController.StateListener::class.java) @@ -205,27 +203,6 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { verify(blurUtils).applyBlur(any(), eq(0), eq(false)) } - @Test - fun updateGlobalDialogVisibility_animatesBlur() { - notificationShadeDepthController.updateGlobalDialogVisibility(0.5f, root) - verify(globalActionsSpring).animateTo(eq(maxBlur / 2), eq(root)) - } - - @Test - fun updateGlobalDialogVisibility_appliesBlur_withoutHomeControls() { - `when`(globalActionsSpring.radius).thenReturn(maxBlur) - notificationShadeDepthController.updateBlurCallback.doFrame(0) - verify(blurUtils).applyBlur(any(), eq(maxBlur), eq(false)) - } - - @Test - fun updateGlobalDialogVisibility_appliesBlur_unlessHomeControls() { - notificationShadeDepthController.showingHomeControls = true - `when`(globalActionsSpring.radius).thenReturn(maxBlur) - notificationShadeDepthController.updateBlurCallback.doFrame(0) - verify(blurUtils).applyBlur(any(), eq(0), eq(false)) - } - @Test fun updateBlurCallback_setsBlurAndZoom() { notificationShadeDepthController.addListener(listener)