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

Commit 4d3d8db4 authored by LuK1337's avatar LuK1337 Committed by Luca Stefani
Browse files

SystemUI: AmbientTile: Actually start using SecureSetting

Change-Id: I5d94f6d2e596dbc6b44ae4f30f479d335a067661
parent 810cac87
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -53,6 +53,12 @@ public class AmbientDisplayTile extends QSTileImpl<BooleanState> {
        };
    }

    @Override
    protected void handleDestroy() {
        super.handleDestroy();
        mSetting.setListening(false);
    }

    @Override
    public boolean isAvailable() {
        String name = Build.IS_DEBUGGABLE ? SystemProperties.get("debug.doze.component") : null;
@@ -67,6 +73,18 @@ public class AmbientDisplayTile extends QSTileImpl<BooleanState> {
        return new BooleanState();
    }

    @Override
    public void handleSetListening(boolean listening) {
        super.handleSetListening(listening);
        mSetting.setListening(listening);
    }

    @Override
    protected void handleUserSwitch(int newUserId) {
        mSetting.setUserId(newUserId);
        handleRefreshState(mSetting.getValue());
    }

    @Override
    protected void handleClick() {
        mSetting.setValue(mState.value ? 0 : 1);
@@ -115,9 +133,4 @@ public class AmbientDisplayTile extends QSTileImpl<BooleanState> {
                    R.string.accessibility_quick_settings_ambient_display_changed_off);
        }
    }

    @Override
    public void handleSetListening(boolean listening) {
        // Do nothing
    }
}