From d6ce2ccac7d972f52d247507b373f952e152edf9 Mon Sep 17 00:00:00 2001 From: Robert Horvath Date: Fri, 27 Mar 2020 13:09:26 +0100 Subject: [PATCH 1/2] Opaque background for shutdown UI on TV The background of the shutdown UI was transparent. This lead to the text on the shutdown UI being hard to read, as text from underneath might shine through. This change makes the background of the shutdown UI opaque for TVs. Bug: 152509487 Test: flash build and then factory reset / reboot the device Change-Id: I620224b9c7b289fbf4db3ffec78007653bea0d71 --- .../SystemUI/res/values-television/dimens.xml | 20 +++++++++++++++++++ packages/SystemUI/res/values/dimens.xml | 3 +++ .../globalactions/GlobalActionsImpl.java | 6 +++--- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 packages/SystemUI/res/values-television/dimens.xml diff --git a/packages/SystemUI/res/values-television/dimens.xml b/packages/SystemUI/res/values-television/dimens.xml new file mode 100644 index 0000000000000..6da0c693f3897 --- /dev/null +++ b/packages/SystemUI/res/values-television/dimens.xml @@ -0,0 +1,20 @@ + + + + + 1.0 + \ No newline at end of file diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 432cd749abbd8..85da9262d5f2f 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -1265,4 +1265,7 @@ 5dp 16sp + + + 0.95 diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java index 12955a153360c..43584a52a8712 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java @@ -49,8 +49,6 @@ import dagger.Lazy; public class GlobalActionsImpl implements GlobalActions, CommandQueue.Callbacks { - private static final float SHUTDOWN_SCRIM_ALPHA = 0.95f; - private final Context mContext; private final Lazy mGlobalActionsDialogLazy; private final KeyguardStateController mKeyguardStateController; @@ -153,7 +151,9 @@ public class GlobalActionsImpl implements GlobalActions, CommandQueue.Callbacks mBlurUtils.applyBlur(d.getWindow().getDecorView().getViewRootImpl(), mBlurUtils.blurRadiusOfRatio(1)); } else { - background.setAlpha((int) (SHUTDOWN_SCRIM_ALPHA * 255)); + float backgroundAlpha = mContext.getResources().getFloat( + com.android.systemui.R.dimen.shutdown_scrim_behind_alpha); + background.setAlpha((int) (backgroundAlpha * 255)); } d.show(); From 2f58649bff1df9662217210ef90ce2d0d036bf1c Mon Sep 17 00:00:00 2001 From: Robert Horvath Date: Fri, 27 Mar 2020 14:10:05 +0100 Subject: [PATCH 2/2] Remove window animations for shutdown UI on TV If reboot happens too quickly, the video output freezes during the fade in window enter animation. This leads to the text on the shutdown UI being hard to read, as the window is still transparent and text from underneath might shine through. To resolve this, this change removes the window animations from the shutdown UI for TVs, so that the UI appears instantly without a fade. Bug: 152509487 Test: flash build and reboot / factory reset Change-Id: I28153a56f3b5cfc4f89b06fcc8fe6fba935eb30b --- packages/SystemUI/res/values-television/styles.xml | 5 +++++ packages/SystemUI/res/values/styles.xml | 3 +++ .../android/systemui/globalactions/GlobalActionsImpl.java | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/res/values-television/styles.xml b/packages/SystemUI/res/values-television/styles.xml index b59f0072b8c3b..b01c5d88e3b30 100644 --- a/packages/SystemUI/res/values-television/styles.xml +++ b/packages/SystemUI/res/values-television/styles.xml @@ -17,4 +17,9 @@ diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 1233d4dc73e71..9f1e63e0aa27b 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -305,6 +305,9 @@ @null + + diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java index 43584a52a8712..ce29859f12caa 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java @@ -122,7 +122,7 @@ public class GlobalActionsImpl implements GlobalActions, CommandQueue.Callbacks | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); window.setBackgroundDrawable(background); - window.setWindowAnimations(R.style.Animation_Toast); + window.setWindowAnimations(com.android.systemui.R.style.Animation_ShutdownUi); d.setContentView(R.layout.shutdown_dialog); d.setCancelable(false);