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

Commit 62cc2758 authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

Frameworks: QS performance profiles tile



Patchset 2: Fix not null comparation
Patchset 3: xxhdpi drawables
Patchset 4: Fix xxhdpi drawables (thx blunden)
            Rebased
Patchset 5: Add suggestions
            Sync on boot the system property with the setting
Patchset 6: Rebased

Change-Id: Ib32d3734b63f88a3473e0ab10d8edf30dae9ceb6
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent c8900d18
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3295,6 +3295,13 @@ public final class Settings {
         */
        public static final String VOLUME_KEYS_CONTROL_RING_STREAM = "volume_keys_control_ring_stream";

        /**
         * Performance profile
         * @see config_perf_profile_prop in frameworks/base/core/res/res/values/config.xml
         * @hide
         */
        public static final String PERFORMANCE_PROFILE = "performance_profile";

        /**
         * Settings to backup. This is here so that it's in the same place as the settings
         * keys and easy to update.
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ public class QSConstants {
        public static final String TILE_LTE = "toggleLte";
        public static final String TILE_WIMAX = "toggleWimax";
        public static final String TILE_PROFILE = "toggleProfile";
        public static final String TILE_PERFORMANCE_PROFILE = "togglePerformanceProfile";
        public static final String TILE_NFC = "toggleNfc";
        public static final String TILE_USBTETHER = "toggleUsbTether";
        public static final String TILE_QUIETHOURS = "toggleQuietHours";
+8 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ import android.nfc.NfcAdapter;
import android.os.UserHandle;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;

import com.android.internal.telephony.PhoneConstants;

@@ -46,6 +47,13 @@ public class QSUtils {
            return (Settings.System.getInt(resolver, Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1);
        }

        public static boolean deviceSupportsPerformanceProfiles(Context ctx) {
            Resources res = ctx.getResources();
            String perfProfileProp = res.getString(
                    com.android.internal.R.string.config_perf_profile_prop);
            return !TextUtils.isEmpty(perfProfileProp);
        }

        public static boolean expandedDesktopEnabled(ContentResolver resolver) {
            return (Settings.System.getIntForUser(resolver, Settings.System.EXPANDED_DESKTOP_STYLE, 0,
                    UserHandle.USER_CURRENT_OR_SELF) != 0);
+4 −0
Original line number Diff line number Diff line
@@ -89,4 +89,8 @@
    <string name="policydesc_enforceSelinux">Přepnutí politiky SELinux na vynucující (enforcing) nebo tolerantní (permissive).</string>
    <string name="policylab_enforceMmac">Vynucení MMAC</string>
    <string name="policydesc_enforceMmac">Přepnutí politiky MMAC na vynucující (enforcing) nebo tolerantní (permissive).</string>

    <string name="perf_profile_pwrsv">Úsporný</string>
    <string name="perf_profile_bal">Vyvážený</string>
    <string name="perf_profile_perf">Výkonný</string>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -71,4 +71,7 @@
    <string name="policydesc_enforceSelinux">Ermöglicht der App, die Anwendung der SELinux-Richtlinie zwischen strikt und moderat zu wechseln.</string>
    <string name="policylab_enforceMmac">MMAC-Richtlinie wechseln</string>
    <string name="policydesc_enforceMmac">Ermöglicht der App, die Anwendung der MMAC-Richtlinie zwischen strikt und moderat zu wechseln.</string>
    <string name="perf_profile_pwrsv">Energie sparen</string>
    <string name="perf_profile_bal">Ausgeglichen</string>
    <string name="perf_profile_perf">Mehr Leistung</string>
</resources>
Loading