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

Commit 3107d99e authored by Matthew Ng's avatar Matthew Ng Committed by Tim Joines
Browse files

Add config flag to enable/disable nav bar auto dim

Added a configuration flag to enable whether to auto dim the navigation
bar when wallpaper changes to be invisible such as launching an opaque
app.

OLED devices should have this flag on to prevent/reduce burn and off for
everything else to avoid extra cpu cycles rendering an alpha animation.
By default this is on.

Test: manual
Change-Id: I57ab2a6414b5f6c34e11911346ad4c4d3aac33d0
Fixes: 68812918
(cherry picked from commit 4096e8d028da778f0afbda7df92d6de741650629)
parent d1dc3524
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() {