am 3a0d77f4: Merge "Volume change intent carries stream alias" into mnc-dev

* commit '3a0d77f42aa8bbc3e3f81bb80a55324fc686e2a7':
  Volume change intent carries stream alias
This commit is contained in:
Jean-Michel Trivi
2015-06-29 22:19:43 +00:00
committed by Android Git Automerger
2 changed files with 13 additions and 0 deletions

View File

@@ -203,6 +203,17 @@ public class AudioManager {
*/
public static final String EXTRA_VOLUME_STREAM_TYPE = "android.media.EXTRA_VOLUME_STREAM_TYPE";
/**
* @hide
* The stream type alias for the volume changed intent.
* For instance the intent may indicate a change of the {@link #STREAM_NOTIFICATION} stream
* type (as indicated by the {@link #EXTRA_VOLUME_STREAM_TYPE} extra), but this is also
* reflected by a change of the volume of its alias, {@link #STREAM_RING} on some devices,
* {@link #STREAM_MUSIC} on others (e.g. a television).
*/
public static final String EXTRA_VOLUME_STREAM_TYPE_ALIAS =
"android.media.EXTRA_VOLUME_STREAM_TYPE_ALIAS";
/**
* @hide The volume associated with the stream for the volume changed intent.
*/

View File

@@ -3791,6 +3791,8 @@ public class AudioService extends IAudioService.Stub {
// fire changed intents for all streams
mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, index);
mVolumeChanged.putExtra(AudioManager.EXTRA_PREV_VOLUME_STREAM_VALUE, oldIndex);
mVolumeChanged.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE_ALIAS,
mStreamVolumeAlias[mStreamType]);
sendBroadcastToAll(mVolumeChanged);
}
return changed;