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

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

Merge "AOD: readd AOD settings on debuggable builds"

parents f5da2311 5cd29e41
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -121,7 +121,6 @@

    </PreferenceScreen>

    <!--
    <PreferenceScreen
      android:key="doze"
      android:title="@string/tuner_doze">
@@ -137,7 +136,6 @@
          sysui:defValue="false" />

    </PreferenceScreen>
    -->

    <Preference
        android:key="nav_bar"
+4 −3
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import java.io.PrintWriter;
public class DozeParameters {
    private static final int MAX_DURATION = 60 * 1000;
    public static final String DOZE_SENSORS_WAKE_UP_FULLY = "doze_sensors_wake_up_fully";
    public static final boolean ALWAYS_ON_AVAILABLE = Build.IS_DEBUGGABLE;

    private final Context mContext;

@@ -57,7 +58,7 @@ public class DozeParameters {
        pw.print("    getPickupVibrationThreshold(): "); pw.println(getPickupVibrationThreshold());
        pw.print("    getPickupSubtypePerformsProxCheck(): ");pw.println(
                dumpPickupSubtypePerformsProxCheck());
        if (Build.IS_DEBUGGABLE) {
        if (ALWAYS_ON_AVAILABLE) {
            pw.print("    getAlwaysOn(): "); pw.println(getAlwaysOn());
            pw.print("    getSensorsWakeUpFully(): "); pw.println(getSensorsWakeUpFully());
        }
@@ -118,13 +119,13 @@ public class DozeParameters {
    }

    public boolean getAlwaysOn() {
        return Build.IS_DEBUGGABLE
        return ALWAYS_ON_AVAILABLE
                && Settings.Secure.getIntForUser(mContext.getContentResolver(),
                Settings.Secure.DOZE_ALWAYS_ON, 0, UserHandle.USER_CURRENT) != 0;
    }

    public boolean getSensorsWakeUpFully() {
        return Build.IS_DEBUGGABLE
        return ALWAYS_ON_AVAILABLE
                && Settings.Secure.getIntForUser(mContext.getContentResolver(),
                DOZE_SENSORS_WAKE_UP_FULLY, 0, UserHandle.USER_CURRENT) != 0;
    }
+5 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.systemui.R;
import com.android.systemui.plugins.PluginPrefs;
import com.android.systemui.statusbar.phone.DozeParameters;

public class TunerFragment extends PreferenceFragment {

@@ -37,6 +38,7 @@ public class TunerFragment extends PreferenceFragment {

    private static final String KEY_BATTERY_PCT = "battery_pct";
    private static final String KEY_PLUGINS = "plugins";
    private static final CharSequence KEY_DOZE = "doze";

    public static final String SETTING_SEEN_TUNER_WARNING = "seen_tuner_warning";

@@ -63,6 +65,9 @@ public class TunerFragment extends PreferenceFragment {
        if (!PluginPrefs.hasPlugins(getContext())) {
            getPreferenceScreen().removePreference(findPreference(KEY_PLUGINS));
        }
        if (!DozeParameters.ALWAYS_ON_AVAILABLE) {
            getPreferenceScreen().removePreference(findPreference(KEY_DOZE));
        }

        if (Settings.Secure.getInt(getContext().getContentResolver(), SETTING_SEEN_TUNER_WARNING,
                0) == 0) {