summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2018-01-05 22:40:46 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-01-05 22:40:46 +0000
commit96e622cd82e48d76e00ed04450b5ba5be1310168 (patch)
treec777d91e263d762cfb47d8ec81a3df48d94925e8
parent42f9e527dbd5af9d18b76d06a344438d63190979 (diff)
parent3107d99e54795a4fadc5448014ffe2a1f8de7ce3 (diff)
Merge "Add config flag to enable/disable nav bar auto dim"
-rw-r--r--packages/SystemUI/res/values/config.xml6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java8
2 files changed, 11 insertions, 3 deletions
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index e313e868022d..b5abb4576147 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -95,6 +95,12 @@
<bool name="config_dead_zone_flash">false</bool>
+ <!-- Whether to enable dimming navigation buttons when wallpaper is not visible, should be
+ enabled for OLED devices to reduce/prevent burn in on the navigation bar (because of the
+ black background and static button placements) and disabled for all other devices to
+ prevent wasting cpu cycles on the dimming animation -->
+ <bool name="config_navigation_bar_enable_auto_dim_no_visible_wallpaper">true</bool>
+
<!-- Whether QuickSettings is in a phone landscape -->
<bool name="quick_settings_wide">false</bool>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java
index b81a3b0416a4..bd6421c20980 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java
@@ -26,7 +26,6 @@ import android.view.IWallpaperVisibilityListener;
import android.view.IWindowManager;
import android.view.MotionEvent;
import android.view.View;
-import android.view.WindowManagerGlobal;
import com.android.internal.statusbar.IStatusBarService;
import com.android.systemui.Dependency;
@@ -37,6 +36,7 @@ public final class NavigationBarTransitions extends BarTransitions {
private final NavigationBarView mView;
private final IStatusBarService mBarService;
private final LightBarTransitionsController mLightTransitionsController;
+ private final boolean mAllowAutoDimWallpaperNotVisible;
private boolean mWallpaperVisible;
private boolean mLightsOut;
@@ -49,6 +49,8 @@ public final class NavigationBarTransitions extends BarTransitions {
ServiceManager.getService(Context.STATUS_BAR_SERVICE));
mLightTransitionsController = new LightBarTransitionsController(view.getContext(),
this::applyDarkIntensity);
+ mAllowAutoDimWallpaperNotVisible = view.getContext().getResources()
+ .getBoolean(R.bool.config_navigation_bar_enable_auto_dim_no_visible_wallpaper);
IWindowManager windowManagerService = Dependency.get(IWindowManager.class);
Handler handler = Handler.getMain();
@@ -80,8 +82,8 @@ public final class NavigationBarTransitions extends BarTransitions {
@Override
protected boolean isLightsOut(int mode) {
- return super.isLightsOut(mode) || (mAutoDim && !mWallpaperVisible
- && mode != MODE_WARNING);
+ return super.isLightsOut(mode) || (mAllowAutoDimWallpaperNotVisible && mAutoDim
+ && !mWallpaperVisible && mode != MODE_WARNING);
}
public LightBarTransitionsController getLightTransitionsController() {