summaryrefslogtreecommitdiffstats
path: root/packages/SettingsProvider
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2013-10-08 16:02:16 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-08 16:02:16 -0700
commit32bc10303c0141eebc4f39298e1b6c4bae058498 (patch)
tree25fc0512bd01c5d418f8585ac7e2d50cf78559cd /packages/SettingsProvider
parent1eaac4559f4c2e5ed66cc2f17dab98bb3015540e (diff)
parent4be3db7018154406ab74e029482a7d82dbcd3a5a (diff)
downloadframeworks_base-32bc10303c0141eebc4f39298e1b6c4bae058498.zip
frameworks_base-32bc10303c0141eebc4f39298e1b6c4bae058498.tar.gz
frameworks_base-32bc10303c0141eebc4f39298e1b6c4bae058498.tar.bz2
am 4be3db70: am f3a56199: am 40bacdf4: Merge "Don\'t wake users up with low battery sounds." into klp-dev
* commit '4be3db7018154406ab74e029482a7d82dbcd3a5a': Don't wake users up with low battery sounds.
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r--packages/SettingsProvider/res/values/defaults.xml5
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java23
2 files changed, 27 insertions, 1 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index bfb0931..a1d8f22 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -168,4 +168,9 @@
<!-- Default for Settings.Secure.USER_SETUP_COMPLETE -->
<bool name="def_user_setup_complete">false</bool>
+
+ <!-- Default for Settings.Global.LOW_BATTERY_SOUND_TIMEOUT.
+ 0 means no timeout; battery sounds will always play
+ >0 is milliseconds of screen-off time after which battery sounds will not play -->
+ <integer name="def_low_battery_sound_timeout">0</integer>
</resources>
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 120b28f..09c21f3 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -72,7 +72,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
// database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
// is properly propagated through your change. Not doing so will result in a loss of user
// settings.
- private static final int DATABASE_VERSION = 97;
+ private static final int DATABASE_VERSION = 98;
private Context mContext;
private int mUserHandle;
@@ -1541,6 +1541,24 @@ public class DatabaseHelper extends SQLiteOpenHelper {
upgradeVersion = 97;
}
+ if (upgradeVersion == 97) {
+ if (mUserHandle == UserHandle.USER_OWNER) {
+ db.beginTransaction();
+ SQLiteStatement stmt = null;
+ try {
+ stmt = db.compileStatement("INSERT OR REPLACE INTO global(name,value)"
+ + " VALUES(?,?);");
+ loadIntegerSetting(stmt, Settings.Global.LOW_BATTERY_SOUND_TIMEOUT,
+ R.integer.def_low_battery_sound_timeout);
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ if (stmt != null) stmt.close();
+ }
+ }
+ upgradeVersion = 98;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {
@@ -2253,6 +2271,9 @@ public class DatabaseHelper extends SQLiteOpenHelper {
CdmaSubscriptionSourceManager.PREFERRED_CDMA_SUBSCRIPTION);
loadSetting(stmt, Settings.Global.CDMA_SUBSCRIPTION_MODE, type);
+ loadIntegerSetting(stmt, Settings.Global.LOW_BATTERY_SOUND_TIMEOUT,
+ R.integer.def_low_battery_sound_timeout);
+
// --- New global settings start here
} finally {
if (stmt != null) stmt.close();