diff options
author | Amith Yamasani <yamasani@google.com> | 2011-07-22 10:34:27 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2011-08-01 16:45:28 -0700 |
commit | 42722bfa136f5616872a2c4e199813e804621c81 (patch) | |
tree | 5565d49a2860b018d62ccfcb27491f178e51a91b /packages/SettingsProvider | |
parent | 34e1fb1ee229a7e033dcd42f4efd194e1614d5ce (diff) | |
download | frameworks_base-42722bfa136f5616872a2c4e199813e804621c81.zip frameworks_base-42722bfa136f5616872a2c4e199813e804621c81.tar.gz frameworks_base-42722bfa136f5616872a2c4e199813e804621c81.tar.bz2 |
Volume panel changes.
Combined volume panel only in tablets. On phones show active volume.
Added dummy assets for ring+notification icon.
Deprecated the NOTIFICATION_USES_RING_VOLUME. Now they are always
tied together. Audio manager changes still required to ensure that.
Initialize all feedback sounds to true.
Change-Id: I3ad7890c9be9334eedb5f3b709a4b6995fe24638
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 6 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 92 |
2 files changed, 57 insertions, 41 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index c61da4e..12dbdf9 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -67,7 +67,7 @@ <string name="def_desk_undock_sound" translatable="false">/system/media/audio/ui/Undock.ogg</string> <string name="def_car_dock_sound" translatable="false">/system/media/audio/ui/Dock.ogg</string> <string name="def_car_undock_sound" translatable="false">/system/media/audio/ui/Undock.ogg</string> - <integer name="def_lockscreen_sounds_enabled">0</integer> + <integer name="def_lockscreen_sounds_enabled">1</integer> <string name="def_lock_sound" translatable="false">/system/media/audio/ui/Lock.ogg</string> <string name="def_unlock_sound" translatable="false">/system/media/audio/ui/Unlock.ogg</string> @@ -129,4 +129,8 @@ <!-- Default for Settings.System.POINTER_SPEED --> <integer name="def_pointer_speed">0</integer> + <!-- Default for DTMF tones enabled --> + <bool name="def_dtmf_tones_enabled">true</bool> + <!-- Default for UI touch sounds enabled --> + <bool name="def_sound_effects_enabled">true</bool> </resources> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index 7fecc9c..f527447 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -63,7 +63,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 = 68; + private static final int DATABASE_VERSION = 69; private Context mContext; @@ -862,34 +862,29 @@ public class DatabaseHelper extends SQLiteOpenHelper { } if (upgradeVersion == 66) { - // This upgrade makes sure that MODE_RINGER_STREAMS_AFFECTED and - // NOTIFICATIONS_USE_RING_VOLUME settings are set according to device voice capability - db.beginTransaction(); - try { - int ringerModeAffectedStreams = (1 << AudioManager.STREAM_RING) | - (1 << AudioManager.STREAM_NOTIFICATION) | - (1 << AudioManager.STREAM_SYSTEM) | - (1 << AudioManager.STREAM_SYSTEM_ENFORCED); - if (!mContext.getResources().getBoolean( - com.android.internal.R.bool.config_voice_capable)) { - ringerModeAffectedStreams |= (1 << AudioManager.STREAM_MUSIC); - - db.execSQL("DELETE FROM system WHERE name='" - + Settings.System.NOTIFICATIONS_USE_RING_VOLUME + "'"); - db.execSQL("INSERT INTO system ('name', 'value') values ('" - + Settings.System.NOTIFICATIONS_USE_RING_VOLUME + "', '1')"); - } - db.execSQL("DELETE FROM system WHERE name='" - + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "'"); - db.execSQL("INSERT INTO system ('name', 'value') values ('" - + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "', '" - + String.valueOf(ringerModeAffectedStreams) + "')"); - db.setTransactionSuccessful(); - } finally { - db.endTransaction(); - } - upgradeVersion = 67; - } + // This upgrade makes sure that MODE_RINGER_STREAMS_AFFECTED is set + // according to device voice capability + db.beginTransaction(); + try { + int ringerModeAffectedStreams = (1 << AudioManager.STREAM_RING) | + (1 << AudioManager.STREAM_NOTIFICATION) | + (1 << AudioManager.STREAM_SYSTEM) | + (1 << AudioManager.STREAM_SYSTEM_ENFORCED); + if (!mContext.getResources().getBoolean( + com.android.internal.R.bool.config_voice_capable)) { + ringerModeAffectedStreams |= (1 << AudioManager.STREAM_MUSIC); + } + db.execSQL("DELETE FROM system WHERE name='" + + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "'"); + db.execSQL("INSERT INTO system ('name', 'value') values ('" + + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "', '" + + String.valueOf(ringerModeAffectedStreams) + "')"); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + } + upgradeVersion = 67; + } if (upgradeVersion == 67) { // New setting to enable touch exploration. @@ -909,6 +904,26 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 68; } + if (upgradeVersion == 68) { + // Enable all system sounds by default + db.beginTransaction(); + SQLiteStatement stmt = null; + try { + stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)" + + " VALUES(?,?);"); + loadDefaultHapticSettings(stmt); + loadUISoundEffectsSettings(stmt); + db.execSQL("DELETE FROM system WHERE name='" + + Settings.System.NOTIFICATIONS_USE_RING_VOLUME + "'"); + stmt.close(); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + if (stmt != null) + stmt.close(); + } + upgradeVersion = 69; + } // *** Remember to update DATABASE_VERSION above! @@ -1284,21 +1299,12 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadSetting(stmt, Settings.Secure.SET_INSTALL_LOCATION, 0); loadSetting(stmt, Settings.Secure.DEFAULT_INSTALL_LOCATION, PackageHelper.APP_INSTALL_AUTO); - + loadUISoundEffectsSettings(stmt); - + loadBooleanSetting(stmt, Settings.System.VIBRATE_IN_SILENT, R.bool.def_vibrate_in_silent); - // Set notification volume to follow ringer volume by default - if (mContext.getResources().getBoolean( - com.android.internal.R.bool.config_voice_capable)) { - loadBooleanSetting(stmt, Settings.System.NOTIFICATIONS_USE_RING_VOLUME, - R.bool.def_notifications_use_ring_volume); - } else { - loadSetting(stmt, Settings.System.NOTIFICATIONS_USE_RING_VOLUME, "1"); - } - loadIntegerSetting(stmt, Settings.System.POINTER_SPEED, R.integer.def_pointer_speed); @@ -1312,6 +1318,12 @@ public class DatabaseHelper extends SQLiteOpenHelper { R.integer.def_power_sounds_enabled); loadStringSetting(stmt, Settings.System.LOW_BATTERY_SOUND, R.string.def_low_battery_sound); + loadBooleanSetting(stmt, Settings.System.DTMF_TONE_WHEN_DIALING, + R.bool.def_dtmf_tones_enabled); + loadBooleanSetting(stmt, Settings.System.SOUND_EFFECTS_ENABLED, + R.bool.def_sound_effects_enabled); + loadBooleanSetting(stmt, Settings.System.HAPTIC_FEEDBACK_ENABLED, + R.bool.def_haptic_feedback); loadIntegerSetting(stmt, Settings.System.DOCK_SOUNDS_ENABLED, R.integer.def_dock_sounds_enabled); |