OSDN Git Service

Settings: Move Global settings to CMSettings
authord34d <clark@cyngn.com>
Thu, 12 Nov 2015 21:00:17 +0000 (13:00 -0800)
committerGerrit Code Review <gerrit@cyanogenmod.org>
Fri, 13 Nov 2015 02:03:34 +0000 (18:03 -0800)
Change-Id: I73e3477ccc3c804de0f32974d926e6bc9df9b227

src/com/android/settings/DisplaySettings.java
src/com/android/settings/notification/OtherSoundSettings.java

index 3a89a4e..f4503f2 100644 (file)
@@ -397,8 +397,8 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
         boolean wakeUpWhenPluggedOrUnpluggedConfig = getResources().getBoolean(
                 com.android.internal.R.bool.config_unplugTurnsOnScreen);
 
-        mWakeWhenPluggedOrUnplugged.setChecked(Settings.Global.getInt(getContentResolver(),
-                Settings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED,
+        mWakeWhenPluggedOrUnplugged.setChecked(CMSettings.Global.getInt(getContentResolver(),
+                CMSettings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED,
                 (wakeUpWhenPluggedOrUnpluggedConfig ? 1 : 0)) == 1);
 
         updateState();
@@ -507,8 +507,8 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
     @Override
     public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
         if (preference == mWakeWhenPluggedOrUnplugged) {
-            Settings.Global.putInt(getContentResolver(),
-                    Settings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED,
+            CMSettings.Global.putInt(getContentResolver(),
+                    CMSettings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED,
                     mWakeWhenPluggedOrUnplugged.isChecked() ? 1 : 0);
             return true;
         }
index 259b049..9e24c34 100644 (file)
@@ -236,25 +236,25 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
 
         // power state change notification sounds
         mPowerSounds = (SwitchPreference) findPreference(KEY_POWER_NOTIFICATIONS);
-        mPowerSounds.setChecked(Global.getInt(getContentResolver(),
-                Global.POWER_NOTIFICATIONS_ENABLED, 0) != 0);
+        mPowerSounds.setChecked(CMSettings.Global.getInt(getContentResolver(),
+                CMSettings.Global.POWER_NOTIFICATIONS_ENABLED, 0) != 0);
         mPowerSoundsVibrate = (SwitchPreference) findPreference(KEY_POWER_NOTIFICATIONS_VIBRATE);
-        mPowerSoundsVibrate.setChecked(Global.getInt(getContentResolver(),
-                Global.POWER_NOTIFICATIONS_VIBRATE, 0) != 0);
+        mPowerSoundsVibrate.setChecked(CMSettings.Global.getInt(getContentResolver(),
+                CMSettings.Global.POWER_NOTIFICATIONS_VIBRATE, 0) != 0);
         Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
         if (vibrator == null || !vibrator.hasVibrator()) {
             removePreference(KEY_POWER_NOTIFICATIONS_VIBRATE);
         }
 
         mPowerSoundsRingtone = findPreference(KEY_POWER_NOTIFICATIONS_RINGTONE);
-        String currentPowerRingtonePath =
-                Global.getString(getContentResolver(), Global.POWER_NOTIFICATIONS_RINGTONE);
+        String currentPowerRingtonePath = CMSettings.Global.getString(getContentResolver(),
+                CMSettings.Global.POWER_NOTIFICATIONS_RINGTONE);
 
         // set to default notification if we don't yet have one
         if (currentPowerRingtonePath == null) {
                 currentPowerRingtonePath = System.DEFAULT_NOTIFICATION_URI.toString();
-                Global.putString(getContentResolver(),
-                        Global.POWER_NOTIFICATIONS_RINGTONE, currentPowerRingtonePath);
+            CMSettings.Global.putString(getContentResolver(),
+                    CMSettings.Global.POWER_NOTIFICATIONS_RINGTONE, currentPowerRingtonePath);
         }
         // is it silent ?
         if (currentPowerRingtonePath.equals(POWER_NOTIFICATIONS_SILENT_URI)) {
@@ -288,19 +288,19 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
     @Override
     public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
         if (preference == mPowerSounds) {
-            Global.putInt(getContentResolver(),
-                    Global.POWER_NOTIFICATIONS_ENABLED,
+            CMSettings.Global.putInt(getContentResolver(),
+                    CMSettings.Global.POWER_NOTIFICATIONS_ENABLED,
                     mPowerSounds.isChecked() ? 1 : 0);
 
         } else if (preference == mPowerSoundsVibrate) {
-            Global.putInt(getContentResolver(),
-                    Global.POWER_NOTIFICATIONS_VIBRATE,
+            CMSettings.Global.putInt(getContentResolver(),
+                    CMSettings.Global.POWER_NOTIFICATIONS_VIBRATE,
                     mPowerSoundsVibrate.isChecked() ? 1 : 0);
 
         } else if (preference == mPowerSoundsRingtone) {
             launchNotificationSoundPicker(REQUEST_CODE_POWER_NOTIFICATIONS_RINGTONE,
-                    Global.getString(getContentResolver(),
-                            Global.POWER_NOTIFICATIONS_RINGTONE));
+                    CMSettings.Global.getString(getContentResolver(),
+                            CMSettings.Global.POWER_NOTIFICATIONS_RINGTONE));
         } else {
             // If we didn't handle it, let preferences handle it.
             return super.onPreferenceTreeClick(preferenceScreen, preference);
@@ -407,8 +407,8 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In
         }
 
         mPowerSoundsRingtone.setSummary(toneName);
-        Global.putString(getContentResolver(),
-                Global.POWER_NOTIFICATIONS_RINGTONE, toneUriPath);
+        CMSettings.Global.putString(getContentResolver(),
+                CMSettings.Global.POWER_NOTIFICATIONS_RINGTONE, toneUriPath);
     }
 
     @Override