Remove blur from power menu

These were reminiscent from Q style and should not be part of the new
design language.

Fixes: 191736895
Test: manual
Test: atest GlobalActionsDialogLiteTest
Test: atest GlobalActionsDialogTest
Test: atest NotificationShadeDepthControllerTest
Change-Id: I047be8271c1ceff0749450a89eefe16bb07c2b0f
This commit is contained in:
Lucas Dupin
2021-06-23 14:49:35 -07:00
parent eade039113
commit c2f8bab01e
6 changed files with 6 additions and 73 deletions

View File

@@ -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<GlobalActionsPanelPlugin.PanelViewController> 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 =

View File

@@ -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();

View File

@@ -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<out String>) {
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")

View File

@@ -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,

View File

@@ -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,

View File

@@ -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)