Merge "Add config flag to enable/disable nav bar auto dim"

This commit is contained in:
TreeHugger Robot
2018-01-05 22:40:46 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 3 deletions

View File

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

View File

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