Use shared value for default muteable streams.

Change-Id: Ib8fa7aee3bed83fc26945fd0caf0cbd9f4f8af3a
This commit is contained in:
John Spurlock
2015-02-05 12:30:36 -05:00
parent dec7d3893f
commit 24c0518723
2 changed files with 9 additions and 9 deletions

View File

@@ -356,6 +356,12 @@ public class AudioService extends IAudioService.Stub {
"STREAM_TTS"
};
public static final int DEFAULT_MUTE_STREAMS_AFFECTED =
(1 << AudioSystem.STREAM_MUSIC) |
(1 << AudioSystem.STREAM_RING) |
(1 << AudioSystem.STREAM_NOTIFICATION) |
(1 << AudioSystem.STREAM_SYSTEM);
private final AudioSystem.ErrorCallback mAudioSystemCallback = new AudioSystem.ErrorCallback() {
public void onError(int error) {
switch (error) {
@@ -899,11 +905,8 @@ public class AudioService extends IAudioService.Stub {
}
mMuteAffectedStreams = System.getIntForUser(cr,
System.MUTE_STREAMS_AFFECTED,
((1 << AudioSystem.STREAM_MUSIC)|
(1 << AudioSystem.STREAM_RING)|
(1 << AudioSystem.STREAM_SYSTEM)),
UserHandle.USER_CURRENT);
System.MUTE_STREAMS_AFFECTED, DEFAULT_MUTE_STREAMS_AFFECTED,
UserHandle.USER_CURRENT);
boolean masterMute = System.getIntForUser(cr, System.VOLUME_MASTER_MUTE,
0, UserHandle.USER_CURRENT) == 1;

View File

@@ -2236,10 +2236,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
ringerModeAffectedStreams);
loadSetting(stmt, Settings.System.MUTE_STREAMS_AFFECTED,
((1 << AudioManager.STREAM_MUSIC) |
(1 << AudioManager.STREAM_RING) |
(1 << AudioManager.STREAM_NOTIFICATION) |
(1 << AudioManager.STREAM_SYSTEM)));
AudioService.DEFAULT_MUTE_STREAMS_AFFECTED);
} finally {
if (stmt != null) stmt.close();
}