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

Commit a1699235 authored by d34d's avatar d34d Committed by Gerrit Code Review
Browse files

fw: Move Global settings to CMSettings

This moves all Settings.Global.* settings, that were added to
CyanogenMod and not used in boot classpath, to CMSettings.

 * WAKE_WHEN_PLUGGED_OR_UNPLUGGED
 * BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX
 * POWER_NOTIFICATIONS_ENABLED
 * POWER_NOTIFICATIONS_VIBRATE
 * POWER_NOTIFICATIONS_RINGTONE
 * ZEN_DISABLE_DUCKING_DURING_MEDIA_PLAYBACK
 * WIFI_AUTO_PRIORITIES_CONFIGURATION

Change-Id: I5a23971b278d150c633d2b4ade49a143c4423c26
parent 11feb561
Loading
Loading
Loading
Loading
+0 −51
Original line number Diff line number Diff line
@@ -6463,13 +6463,6 @@ public final class Settings {
         */
        public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";

        /**
         * Whether to wake the display when plugging or unplugging the charger
         *
         * @hide
         */
        public static final String WAKE_WHEN_PLUGGED_OR_UNPLUGGED = "wake_when_plugged_or_unplugged";

        /**
         * Whether ADB is enabled.
         */
@@ -7540,9 +7533,6 @@ public final class Settings {
        public static final String
                BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX = "bluetooth_a2dp_sink_priority_";
        /** {@hide} */
        public static final String
                BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX = "bluetooth_a2dp_src_priority_";
        /** {@hide} */
        public static final String
                BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX = "bluetooth_input_device_priority_";
        /** {@hide} */
@@ -7643,14 +7633,6 @@ public final class Settings {
            return BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
        }

        /**
         * Get the key that retrieves a bluetooth a2dp src's priority.
         * @hide
         */
        public static final String getBluetoothA2dpSrcPriorityKey(String address) {
            return BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX + address.toUpperCase(Locale.ROOT);
        }

        /**
         * Get the key that retrieves a bluetooth Input Device's priority.
         * @hide
@@ -7763,24 +7745,6 @@ public final class Settings {
         */
        public static final String LOW_POWER_MODE_TRIGGER_LEVEL = "low_power_trigger_level";

        /**
         * Whether to sound when charger power is connected/disconnected
         * @hide
         */
        public static final String POWER_NOTIFICATIONS_ENABLED = "power_notifications_enabled";

        /**
         * Whether to vibrate when charger power is connected/disconnected
         * @hide
         */
        public static final String POWER_NOTIFICATIONS_VIBRATE = "power_notifications_vibrate";

        /**
         * URI for power notification sounds
         * @hide
         */
        public static final String POWER_NOTIFICATIONS_RINGTONE = "power_notifications_ringtone";

         /**
         * If 1, the activity manager will aggressively finish activities and
         * processes as soon as they are no longer needed.  If 0, the normal
@@ -7906,12 +7870,6 @@ public final class Settings {
         */
        public static final String POLICY_CONTROL = "policy_control";

        /**
         * @hide
         */
        public static final String ZEN_DISABLE_DUCKING_DURING_MEDIA_PLAYBACK =
                "zen_disable_ducking_during_media_playback";

        /**
         * Defines global runtime overrides to window policy style.
         *
@@ -8063,14 +8021,6 @@ public final class Settings {
         */
        public static final String LTE_SERVICE_FORCED = "lte_service_forced";

        /**
         * Whether the system auto-configure the priority of the wifi ap's or use
         * the manual settings established by the user.
         * <> 0 to autoconfigure, 0 to manual settings. Default is <> 0.
         * @hide
         */
        public static final String WIFI_AUTO_PRIORITIES_CONFIGURATION = "wifi_auto_priority";

        /**
         * Settings to backup. This is here so that it's in the same place as the settings
         * keys and easy to update.
@@ -8090,7 +8040,6 @@ public final class Settings {
        public static final String[] SETTINGS_TO_BACKUP = {
            BUGREPORT_IN_POWER_MENU,
            STAY_ON_WHILE_PLUGGED_IN,
            WAKE_WHEN_PLUGGED_OR_UNPLUGGED,
            AUTO_TIME,
            AUTO_TIME_ZONE,
            POWER_SOUNDS_ENABLED,
+0 −4
Original line number Diff line number Diff line
@@ -93,10 +93,6 @@
    <string name="def_trusted_sound" translatable="false">/system/media/audio/ui/Trusted.ogg</string>
    <string name="def_wireless_charging_started_sound" translatable="false">/system/media/audio/ui/WirelessChargingStarted.ogg</string>

    <bool name="def_power_notifications_enabled">false</bool>
    <bool name="def_power_notifications_vibrate">false</bool>
    <string name="def_power_notifications_ringtone" translatable="false">content://settings/system/notification_sound</string>

    <bool name="def_lockscreen_disabled">false</bool>
    <bool name="def_device_provisioned">false</bool>
    <integer name="def_dock_audio_media_enabled">1</integer>
+0 −6
Original line number Diff line number Diff line
@@ -1558,12 +1558,6 @@ class DatabaseHelper extends SQLiteOpenHelper {
                            + " VALUES(?,?);");
                    loadStringSetting(stmt, Settings.Global.WIRELESS_CHARGING_STARTED_SOUND,
                            R.string.def_wireless_charging_started_sound);
                    loadBooleanSetting(stmt, Settings.Global.POWER_NOTIFICATIONS_ENABLED,
                            R.bool.def_power_notifications_enabled);
                    loadBooleanSetting(stmt, Settings.Global.POWER_NOTIFICATIONS_VIBRATE,
                            R.bool.def_power_notifications_vibrate);
                    loadStringSetting(stmt, Settings.Global.POWER_NOTIFICATIONS_RINGTONE,
                            R.string.def_power_notifications_ringtone);
                    db.setTransactionSuccessful();
                } finally {
                    db.endTransaction();
+6 −5
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.util.Slog;

import com.android.systemui.SystemUI;
import com.android.systemui.statusbar.phone.PhoneStatusBar;
import cyanogenmod.providers.CMSettings;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -236,8 +237,8 @@ public class PowerUI extends SystemUI {
                if (mIgnoreFirstPowerEvent) {
                    mIgnoreFirstPowerEvent = false;
                } else {
                    if (Settings.Global.getInt(cr,
                            Settings.Global.POWER_NOTIFICATIONS_ENABLED, 0) == 1) {
                    if (CMSettings.Global.getInt(cr,
                            CMSettings.Global.POWER_NOTIFICATIONS_ENABLED, 0) == 1) {
                        playPowerNotificationSound();
                    }
                }
@@ -250,7 +251,7 @@ public class PowerUI extends SystemUI {
    void playPowerNotificationSound() {
        final ContentResolver cr = mContext.getContentResolver();
        final String soundPath =
                Settings.Global.getString(cr, Settings.Global.POWER_NOTIFICATIONS_RINGTONE);
                CMSettings.Global.getString(cr, CMSettings.Global.POWER_NOTIFICATIONS_RINGTONE);

        if (soundPath != null) {
            Ringtone powerRingtone = RingtoneManager.getRingtone(mContext, Uri.parse(soundPath));
@@ -258,8 +259,8 @@ public class PowerUI extends SystemUI {
                powerRingtone.play();
            }
        }
        if (Settings.Global.getInt(cr,
                Settings.Global.POWER_NOTIFICATIONS_VIBRATE, 0) == 1) {
        if (CMSettings.Global.getInt(cr,
                CMSettings.Global.POWER_NOTIFICATIONS_VIBRATE, 0) == 1) {
            Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
            if (vibrator != null) {
                vibrator.vibrate(250);
+4 −4
Original line number Diff line number Diff line
@@ -996,8 +996,8 @@ public class NotificationManagerService extends SystemService {
            resolver.registerContentObserver(CMSettings.System.getUriFor(
                    CMSettings.System.NOTIFICATION_LIGHT_SCREEN_ON),
                    false, this, UserHandle.USER_ALL);
            resolver.registerContentObserver(Settings.Global.getUriFor(
                    Settings.Global.ZEN_DISABLE_DUCKING_DURING_MEDIA_PLAYBACK), false,
            resolver.registerContentObserver(CMSettings.Global.getUriFor(
                    CMSettings.Global.ZEN_DISABLE_DUCKING_DURING_MEDIA_PLAYBACK), false,
                    this, UserHandle.USER_ALL);
            if (mAdjustableNotificationLedBrightness) {
                resolver.registerContentObserver(CMSettings.System.getUriFor(
@@ -1069,8 +1069,8 @@ public class NotificationManagerService extends SystemService {

            updateNotificationPulse();

            mDisableDuckingWhileMedia = Settings.Global.getInt(resolver,
                    Settings.Global.ZEN_DISABLE_DUCKING_DURING_MEDIA_PLAYBACK, 0) == 1;
            mDisableDuckingWhileMedia = CMSettings.Global.getInt(resolver,
                    CMSettings.Global.ZEN_DISABLE_DUCKING_DURING_MEDIA_PLAYBACK, 0) == 1;
            updateDisableDucking();
        }
    }
Loading