am a241a83d: am 720c772a: am d5ceabd3: Merge changes Id38bcf7c,I54f156d9 into lmp-dev

* commit 'a241a83d18530d3bb9010a36f8cc89e50ad20c7b':
  Update MediaController comment to mention notification listeners
  Don't play a sound when adjusting volume while telephony is active
This commit is contained in:
RoboErik
2014-09-03 13:49:21 +00:00
committed by Android Git Automerger
2 changed files with 4 additions and 3 deletions

View File

@@ -48,8 +48,9 @@ import java.util.List;
* receive updates from the session, such as metadata and play state changes.
* <p>
* A MediaController can be created through {@link MediaSessionManager} if you
* hold the "android.permission.MEDIA_CONTENT_CONTROL" permission or directly if
* you have a {@link MediaSession.Token} from the session owner.
* hold the "android.permission.MEDIA_CONTENT_CONTROL" permission or are an
* enabled notification listener or by getting a {@link MediaSession.Token}
* directly from the session owner.
* <p>
* MediaController objects are thread-safe.
*/

View File

@@ -235,7 +235,7 @@ public class MediaSessionRecord implements IBinder.DeathRecipient {
* @param direction The direction to adjust volume in.
*/
public void adjustVolume(int direction, int flags, String packageName, int uid) {
if (isPlaybackActive(false)) {
if (isPlaybackActive(false) || hasFlag(MediaSession.FLAG_EXCLUSIVE_GLOBAL_PRIORITY)) {
flags &= ~AudioManager.FLAG_PLAY_SOUND;
}
if (direction > 1) {