Loading services/core/java/com/android/server/audio/AudioService.java +29 −4 Original line number Diff line number Diff line Loading @@ -4177,6 +4177,12 @@ public class AudioService extends IAudioService.Stub // Stream mute changed, fire the intent. Intent intent = new Intent(AudioManager.STREAM_MUTE_CHANGED_ACTION); intent.putExtra(AudioManager.EXTRA_STREAM_VOLUME_MUTED, isMuted); if (replaceStreamBtSco() && isStreamBluetoothSco(streamType)) { intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, AudioSystem.STREAM_BLUETOOTH_SCO); // in this case broadcast for both sco and voice_call streams the mute status sendBroadcastToAll(intent, null /* options */); } intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, streamType); sendBroadcastToAll(intent, null /* options */); } Loading Loading @@ -9670,9 +9676,16 @@ public class AudioService extends IAudioService.Stub mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, index); mVolumeChanged.putExtra(AudioManager.EXTRA_PREV_VOLUME_STREAM_VALUE, oldIndex); int extraStreamType = mStreamType; // TODO: remove this when deprecating STREAM_BLUETOOTH_SCO if (isStreamBluetoothSco(mStreamType)) { mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, AudioSystem.STREAM_BLUETOOTH_SCO); extraStreamType = AudioSystem.STREAM_BLUETOOTH_SCO; } else { mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, mStreamType); } mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE_ALIAS, streamAlias); Loading @@ -9682,10 +9695,22 @@ public class AudioService extends IAudioService.Stub aliasStreamIndexesString = " aliased streams: " + aliasStreamIndexes; } AudioService.sVolumeLogger.enqueue(new VolChangedBroadcastEvent( extraStreamType, aliasStreamIndexesString, index, oldIndex)); if (extraStreamType != mStreamType) { AudioService.sVolumeLogger.enqueue(new VolChangedBroadcastEvent( mStreamType, aliasStreamIndexesString, index, oldIndex)); } } sendBroadcastToAll(mVolumeChanged, mVolumeChangedOptions); if (extraStreamType != mStreamType) { // send multiple intents in case we merged voice call and bt sco streams mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, mStreamType); // do not use the options in thid case which could discard // the previous intent sendBroadcastToAll(mVolumeChanged, null); } } } } Loading Loading
services/core/java/com/android/server/audio/AudioService.java +29 −4 Original line number Diff line number Diff line Loading @@ -4177,6 +4177,12 @@ public class AudioService extends IAudioService.Stub // Stream mute changed, fire the intent. Intent intent = new Intent(AudioManager.STREAM_MUTE_CHANGED_ACTION); intent.putExtra(AudioManager.EXTRA_STREAM_VOLUME_MUTED, isMuted); if (replaceStreamBtSco() && isStreamBluetoothSco(streamType)) { intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, AudioSystem.STREAM_BLUETOOTH_SCO); // in this case broadcast for both sco and voice_call streams the mute status sendBroadcastToAll(intent, null /* options */); } intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, streamType); sendBroadcastToAll(intent, null /* options */); } Loading Loading @@ -9670,9 +9676,16 @@ public class AudioService extends IAudioService.Stub mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, index); mVolumeChanged.putExtra(AudioManager.EXTRA_PREV_VOLUME_STREAM_VALUE, oldIndex); int extraStreamType = mStreamType; // TODO: remove this when deprecating STREAM_BLUETOOTH_SCO if (isStreamBluetoothSco(mStreamType)) { mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, AudioSystem.STREAM_BLUETOOTH_SCO); extraStreamType = AudioSystem.STREAM_BLUETOOTH_SCO; } else { mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, mStreamType); } mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE_ALIAS, streamAlias); Loading @@ -9682,10 +9695,22 @@ public class AudioService extends IAudioService.Stub aliasStreamIndexesString = " aliased streams: " + aliasStreamIndexes; } AudioService.sVolumeLogger.enqueue(new VolChangedBroadcastEvent( extraStreamType, aliasStreamIndexesString, index, oldIndex)); if (extraStreamType != mStreamType) { AudioService.sVolumeLogger.enqueue(new VolChangedBroadcastEvent( mStreamType, aliasStreamIndexesString, index, oldIndex)); } } sendBroadcastToAll(mVolumeChanged, mVolumeChangedOptions); if (extraStreamType != mStreamType) { // send multiple intents in case we merged voice call and bt sco streams mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, mStreamType); // do not use the options in thid case which could discard // the previous intent sendBroadcastToAll(mVolumeChanged, null); } } } } Loading