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

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

Merge "Don't allow Settings to change its own standby bucket."

parents 286c3948 778d38a5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.TextUtils;

import androidx.preference.ListPreference;
import androidx.preference.Preference;
@@ -82,6 +83,7 @@ public class InactiveApps extends SettingsPreferenceFragment
        final Context context = getActivity();
        final PackageManager pm = context.getPackageManager();
        final UsageStatsManager usm = context.getSystemService(UsageStatsManager.class);
        final String settingsPackage = context.getPackageName();

        Intent launcherIntent = new Intent(Intent.ACTION_MAIN);
        launcherIntent.addCategory(Intent.CATEGORY_LAUNCHER);
@@ -95,6 +97,10 @@ public class InactiveApps extends SettingsPreferenceFragment
            p.setEntries(SETTABLE_BUCKETS_NAMES);
            p.setEntryValues(SETTABLE_BUCKETS_VALUES);
            updateSummary(p);
            // Don't allow Settings to change its own standby bucket.
            if (TextUtils.equals(packageName, settingsPackage)) {
                p.setEnabled(false);
            }
            p.setOnPreferenceChangeListener(this);

            screen.addPreference(p);