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

Commit 90a1fae6 authored by Luca Stefani's avatar Luca Stefani Committed by Michael Bestas
Browse files

SystemUI: AODTile: Use SecureSetting to change doze setting

Change-Id: Ic39d26ac8a37041b75862627a497274b24f3362c
parent 401638a7
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The OmniROM Project
 *               2020 The LineageOS Project
 *               2020-2021 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -75,8 +75,7 @@ public class AODTile extends QSTileImpl<BooleanState> implements

    @Override
    public void handleClick() {
        setEnabled(!mState.value);
        refreshState();
        mSetting.setValue(mState.value ? 0 : 1);
    }

    @Override
@@ -84,12 +83,6 @@ public class AODTile extends QSTileImpl<BooleanState> implements
        return null;
    }

    private void setEnabled(boolean enabled) {
        Settings.Secure.putInt(mContext.getContentResolver(),
                Settings.Secure.DOZE_ALWAYS_ON,
                enabled ? 1 : 0);
    }

    @Override
    public CharSequence getTileLabel() {
        if (mBatteryController.isAodPowerSave()) {