diff options
author | d34d <clark@cyngn.com> | 2015-11-12 12:55:23 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-11-12 18:03:00 -0800 |
commit | a16992359a19dd3fd9cc921edc981c8966556e1b (patch) | |
tree | f1bfd39a233af3e053eb09daa48c4185379c4e88 | |
parent | 11feb561aa1b34263ce200d696a02c0e6f8234a5 (diff) | |
download | frameworks_base-a16992359a19dd3fd9cc921edc981c8966556e1b.zip frameworks_base-a16992359a19dd3fd9cc921edc981c8966556e1b.tar.gz frameworks_base-a16992359a19dd3fd9cc921edc981c8966556e1b.tar.bz2 |
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
6 files changed, 14 insertions, 74 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index e914aa9..9f32eed 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -6464,13 +6464,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. */ public static final String ADB_ENABLED = "adb_enabled"; @@ -7541,9 +7534,6 @@ public final class Settings { 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} */ public static final String @@ -7644,14 +7634,6 @@ public final class Settings { } /** - * 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 @@ -7907,12 +7871,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. * * See {@link android.view.WindowManagerPolicyControl} for value definitions. @@ -8064,14 +8022,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, diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index ff695fd..22fcb46 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -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> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index ec2dea6..694eda5 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -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(); diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java index 4c1a16c..a1a11ca 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java @@ -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); diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index c2ea249..97758c7 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -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(); } } diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index a8fbf6e..76d4a27 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -687,8 +687,8 @@ public final class PowerManagerService extends SystemService resolver.registerContentObserver(CMSettings.System.getUriFor( CMSettings.System.PROXIMITY_ON_WAKE), false, mSettingsObserver, UserHandle.USER_ALL); - resolver.registerContentObserver(Settings.Global.getUriFor( - Settings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED), + resolver.registerContentObserver(CMSettings.Global.getUriFor( + CMSettings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED), false, mSettingsObserver, UserHandle.USER_ALL); // Go. @@ -776,8 +776,8 @@ public final class PowerManagerService extends SystemService Settings.Global.STAY_ON_WHILE_PLUGGED_IN, 0); mTheaterModeEnabled = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.THEATER_MODE_ON, 0) == 1; - mWakeUpWhenPluggedOrUnpluggedSetting = Settings.Global.getInt(resolver, - Settings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED, + mWakeUpWhenPluggedOrUnpluggedSetting = CMSettings.Global.getInt(resolver, + CMSettings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED, (mWakeUpWhenPluggedOrUnpluggedConfig ? 1 : 0)); mProximityWakeEnabled = CMSettings.System.getInt(resolver, CMSettings.System.PROXIMITY_ON_WAKE, mProximityWakeEnabledByDefaultConfig ? 1 : 0) == 1; |