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

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

Merge "Disable parts of tuner from user builds" into oc-dev

parents 66c81e37 2ad83b94
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -19,9 +19,11 @@ import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v14.preference.PreferenceFragment;
import android.support.v7.preference.Preference;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@@ -43,6 +45,11 @@ public class TunerFragment extends PreferenceFragment {
    public static final String SETTING_SEEN_TUNER_WARNING = "seen_tuner_warning";

    private static final String WARNING_TAG = "tuner_warning";
    private static final String[] DEBUG_ONLY = new String[] {
            "nav_bar",
            "lockscreen",
            "picture_in_picture",
    };

    private static final int MENU_REMOVE = Menu.FIRST + 1;

@@ -68,6 +75,12 @@ public class TunerFragment extends PreferenceFragment {
        if (!alwaysOnAvailable()) {
            getPreferenceScreen().removePreference(findPreference(KEY_DOZE));
        }
        if (!Build.IS_DEBUGGABLE) {
            for (int i = 0; i < DEBUG_ONLY.length; i++) {
                Preference preference = findPreference(DEBUG_ONLY[i]);
                if (preference != null) getPreferenceScreen().removePreference(preference);
            }
        }

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