Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96e622cd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 42f9e527 3107d99e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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>

+5 −3
Original line number Diff line number Diff line
@@ -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() {