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

Commit 20b80ee1 authored by dianlujitao's avatar dianlujitao Committed by Bruno Martins
Browse files

TunerServiceImpl: Blacklist Lineage settings from tuner reset

 * They use the tunable infrastructure but are real user settings and
   shouldn't be reset with tuner settings. Moreover, setting them to
   null would cause a IllegalArgumentException.

Change-Id: Ie05910efaee867632a3bd2e84625d7735259130e
parent 44071449
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ public class ClockController implements TunerService.Tunable {
    private static final int CLOCK_POSITION_CENTER = 1;
    private static final int CLOCK_POSITION_LEFT = 2;

    private static final String CLOCK_POSITION = "lineagesystem:status_bar_clock";
    public static final String CLOCK_POSITION = "lineagesystem:status_bar_clock";

    private Clock mActiveClock, mCenterClock, mLeftClock, mRightClock;
    private View mCenterClockLayout, mRightClockLayout;
+2 −2
Original line number Diff line number Diff line
@@ -106,9 +106,9 @@ public class NotificationPanelView extends PanelView implements
    static final String COUNTER_PANEL_OPEN_QS = "panel_open_qs";
    private static final String COUNTER_PANEL_OPEN_PEEK = "panel_open_peek";

    private static final String STATUS_BAR_QUICK_QS_PULLDOWN =
    public static final String STATUS_BAR_QUICK_QS_PULLDOWN =
            "lineagesystem:" + LineageSettings.System.STATUS_BAR_QUICK_QS_PULLDOWN;
    private static final String DOUBLE_TAP_SLEEP_GESTURE =
    public static final String DOUBLE_TAP_SLEEP_GESTURE =
            "lineagesystem:" + LineageSettings.System.DOUBLE_TAP_SLEEP_GESTURE;

    private static final Rect mDummyDirtyRect = new Rect(0, 0, 1, 1);
+4 −4
Original line number Diff line number Diff line
@@ -280,15 +280,15 @@ public class StatusBar extends SystemUI implements DemoMode, TunerService.Tunabl
    public static final String SYSTEM_DIALOG_REASON_RECENT_APPS = "recentapps";
    static public final String SYSTEM_DIALOG_REASON_SCREENSHOT = "screenshot";

    private static final String SCREEN_BRIGHTNESS_MODE =
    public static final String SCREEN_BRIGHTNESS_MODE =
            "system:" + Settings.System.SCREEN_BRIGHTNESS_MODE;
    private static final String STATUS_BAR_BRIGHTNESS_CONTROL =
    public static final String STATUS_BAR_BRIGHTNESS_CONTROL =
            "lineagesystem:" + LineageSettings.System.STATUS_BAR_BRIGHTNESS_CONTROL;
    private static final String LOCKSCREEN_MEDIA_METADATA =
            "lineagesecure:" + LineageSettings.Secure.LOCKSCREEN_MEDIA_METADATA;
    private static final String FORCE_SHOW_NAVBAR =
    public static final String FORCE_SHOW_NAVBAR =
            "lineagesystem:" + LineageSettings.System.FORCE_SHOW_NAVBAR;
    private static final String BERRY_GLOBAL_STYLE =
    public static final String BERRY_GLOBAL_STYLE =
            "lineagesystem:" + LineageSettings.System.BERRY_GLOBAL_STYLE;

    private static final String BANNER_ACTION_CANCEL =
+13 −1
Original line number Diff line number Diff line
@@ -37,7 +37,11 @@ import com.android.systemui.DemoMode;
import com.android.systemui.Dependency;
import com.android.systemui.qs.QSTileHost;
import com.android.systemui.settings.CurrentUserTracker;
import com.android.systemui.statusbar.phone.ClockController;
import com.android.systemui.statusbar.phone.NotificationPanelView;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.phone.StatusBarIconController;
import com.android.systemui.statusbar.policy.Clock;
import com.android.systemui.util.leak.LeakDetector;

import lineageos.providers.LineageSettings;
@@ -56,8 +60,16 @@ public class TunerServiceImpl extends TunerService {
    // Things that use the tunable infrastructure but are now real user settings and
    // shouldn't be reset with tuner settings.
    private static final String[] RESET_BLACKLIST = new String[] {
            Clock.CLOCK_STYLE,
            ClockController.CLOCK_POSITION,
            NotificationPanelView.DOUBLE_TAP_SLEEP_GESTURE,
            NotificationPanelView.STATUS_BAR_QUICK_QS_PULLDOWN,
            QSTileHost.TILES_SETTING,
            Settings.Secure.DOZE_ALWAYS_ON
            Settings.Secure.DOZE_ALWAYS_ON,
            StatusBar.BERRY_GLOBAL_STYLE,
            StatusBar.FORCE_SHOW_NAVBAR,
            StatusBar.SCREEN_BRIGHTNESS_MODE,
            StatusBar.STATUS_BAR_BRIGHTNESS_CONTROL
    };

    private final Observer mObserver = new Observer();