summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-02-02 09:33:30 -0800
committerEric Laurent <elaurent@google.com>2011-02-03 09:26:24 -0800
commit25101b0b9a84571ead15b26e9f4cd9c4298d7823 (patch)
tree8f339bdcc562671cd425144be54841f39c56754b /packages
parent1cee14f154aadabcd9990bd73a197fbd744660ad (diff)
downloadframeworks_base-25101b0b9a84571ead15b26e9f4cd9c4298d7823.zip
frameworks_base-25101b0b9a84571ead15b26e9f4cd9c4298d7823.tar.gz
frameworks_base-25101b0b9a84571ead15b26e9f4cd9c4298d7823.tar.bz2
Fix issue 3371080
Modified default volume control logic in AudioService: 1 IN_CALL volume if in video/audio chat 2 NOTIFICATION if notification is playing or was playing less than 5s ago. 3 MUSIC Modified silent mode: - now also affect MUSIC stream type - entering silent mode when VOL- hard key is pressed once while selected stream volume is already at 0 (except for VOICE_CALL stream). - exiting silent mode when pressing VOL+ hard key while in silent mode Play sound FX (audible selections, keyboard clicks) at a fixed volume. Modified audio framework: - isStreamActive() method now implemented in AudioPolicyManagerBase (previously AudioFlinger) - iStreamActive() now specifies a time window during which the stream is considered active after it actually stopped. Change-Id: I7e5a0724099450b9fc90825224180ac97322785f
Diffstat (limited to 'packages')
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java29
1 files changed, 26 insertions, 3 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 49b71e2..f336f06 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -61,7 +61,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 = 63;
+ private static final int DATABASE_VERSION = 64;
private Context mContext;
@@ -797,6 +797,28 @@ public class DatabaseHelper extends SQLiteOpenHelper {
upgradeVersion = 63;
}
+ if (upgradeVersion == 63) {
+ // This upgrade adds the STREAM_MUSIC type to the list of
+ // types affected by ringer modes (silent, vibrate, etc.)
+ db.beginTransaction();
+ try {
+ db.execSQL("DELETE FROM system WHERE name='"
+ + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "'");
+ int newValue = (1 << AudioManager.STREAM_RING)
+ | (1 << AudioManager.STREAM_NOTIFICATION)
+ | (1 << AudioManager.STREAM_SYSTEM)
+ | (1 << AudioManager.STREAM_SYSTEM_ENFORCED)
+ | (1 << AudioManager.STREAM_MUSIC);
+ db.execSQL("INSERT INTO system ('name', 'value') values ('"
+ + Settings.System.MODE_RINGER_STREAMS_AFFECTED + "', '"
+ + String.valueOf(newValue) + "')");
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ }
+ upgradeVersion = 64;
+ }
+
// *** Remember to update DATABASE_VERSION above!
if (upgradeVersion != currentVersion) {
@@ -1057,10 +1079,11 @@ public class DatabaseHelper extends SQLiteOpenHelper {
loadVibrateSetting(db, false);
- // By default, only the ring/notification and system streams are affected
+ // By default, only the ring/notification, system and music streams are affected
loadSetting(stmt, Settings.System.MODE_RINGER_STREAMS_AFFECTED,
(1 << AudioManager.STREAM_RING) | (1 << AudioManager.STREAM_NOTIFICATION) |
- (1 << AudioManager.STREAM_SYSTEM) | (1 << AudioManager.STREAM_SYSTEM_ENFORCED));
+ (1 << AudioManager.STREAM_SYSTEM) | (1 << AudioManager.STREAM_SYSTEM_ENFORCED) |
+ (1 << AudioManager.STREAM_MUSIC));
loadSetting(stmt, Settings.System.MUTE_STREAMS_AFFECTED,
((1 << AudioManager.STREAM_MUSIC) |