From b1af5d91b98fc7c267d82c812414c662d68b64f0 Mon Sep 17 00:00:00 2001 From: Galia Peycheva Date: Tue, 22 Sep 2020 16:36:35 +0200 Subject: [PATCH] Remove change of tint on volume dialog hide on TV On TV we don't want the volume dialog to change tint when it is being dismissed. So we introduce a new config value for this. Bug: 167732325 Test: m && flash && verify that tinting is no longer there Change-Id: I127f0891951662f8db31adc863cd5e05f000d685 --- packages/SystemUI/res/values-television/config.xml | 3 +++ packages/SystemUI/res/values/config.xml | 3 +++ .../src/com/android/systemui/volume/VolumeDialogImpl.java | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/packages/SystemUI/res/values-television/config.xml b/packages/SystemUI/res/values-television/config.xml index 981a953127369..29c3ad4bb77bb 100644 --- a/packages/SystemUI/res/values-television/config.xml +++ b/packages/SystemUI/res/values-television/config.xml @@ -45,4 +45,7 @@ true + + + false diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index ab09a967bc266..446ed3eee3d20 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -562,4 +562,7 @@ false + + + true diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java index 78f83d3c09b42..43754a2e94ae9 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java @@ -155,6 +155,7 @@ public class VolumeDialogImpl implements VolumeDialog, private boolean mShowA11yStream; private final boolean mShowLowMediaVolumeIcon; + private final boolean mChangeVolumeRowTintWhenInactive; private int mActiveStream; private int mPrevActiveStream; @@ -183,6 +184,8 @@ public class VolumeDialogImpl implements VolumeDialog, Prefs.getBoolean(context, Prefs.Key.HAS_SEEN_ODI_CAPTIONS_TOOLTIP, false); mShowLowMediaVolumeIcon = mContext.getResources().getBoolean(R.bool.config_showLowMediaVolumeIcon); + mChangeVolumeRowTintWhenInactive = + mContext.getResources().getBoolean(R.bool.config_changeVolumeRowTintWhenInactive); } @Override @@ -1154,6 +1157,9 @@ public class VolumeDialogImpl implements VolumeDialog, row.slider.requestFocus(); } boolean useActiveColoring = isActive && row.slider.isEnabled(); + if (!useActiveColoring && !mChangeVolumeRowTintWhenInactive) { + return; + } final ColorStateList tint = useActiveColoring ? Utils.getColorAccent(mContext) : Utils.getColorAttr(mContext, android.R.attr.colorForeground);