From fa97222e87baeaf09d9e3d53a513a5ae87245b7d Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Wed, 19 Apr 2017 18:36:48 +0000 Subject: [PATCH] Revert "Revert "AudioAttributes: remove static getVolumeControlStream method"" This reverts commit e4a9911b68d847cd720a7b506dc705f97bd1c3f0. Change-Id: Id260024dbf926a1defc1c5302a86b694e3c7f8c9 Bug: 36724262 --- api/current.txt | 1 - api/system-current.txt | 1 - api/test-current.txt | 1 - media/java/android/media/AudioAttributes.java | 23 ------------------- 4 files changed, 26 deletions(-) diff --git a/api/current.txt b/api/current.txt index d18d88137720e..0d34d6492383e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -20888,7 +20888,6 @@ package android.media { method public int getContentType(); method public int getFlags(); method public int getUsage(); - method public static deprecated int getVolumeControlStream(android.media.AudioAttributes); method public int getVolumeControlStream(); method public void writeToParcel(android.os.Parcel, int); field public static final int CONTENT_TYPE_MOVIE = 3; // 0x3 diff --git a/api/system-current.txt b/api/system-current.txt index 13e843f84f029..93840ebc61c84 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -22628,7 +22628,6 @@ package android.media { method public int getContentType(); method public int getFlags(); method public int getUsage(); - method public static deprecated int getVolumeControlStream(android.media.AudioAttributes); method public int getVolumeControlStream(); method public void writeToParcel(android.os.Parcel, int); field public static final int CONTENT_TYPE_MOVIE = 3; // 0x3 diff --git a/api/test-current.txt b/api/test-current.txt index 414c4b31fbf04..758a133f08ee3 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -21001,7 +21001,6 @@ package android.media { method public int getContentType(); method public int getFlags(); method public int getUsage(); - method public static deprecated int getVolumeControlStream(android.media.AudioAttributes); method public int getVolumeControlStream(); method public void writeToParcel(android.os.Parcel, int); field public static final int CONTENT_TYPE_MOVIE = 3; // 0x3 diff --git a/media/java/android/media/AudioAttributes.java b/media/java/android/media/AudioAttributes.java index 77a82ec8cacdd..e36ceb8a3e131 100644 --- a/media/java/android/media/AudioAttributes.java +++ b/media/java/android/media/AudioAttributes.java @@ -913,29 +913,6 @@ public final class AudioAttributes implements Parcelable { } } - // TODO remove, replaced by non-static API getVolumeControlStream() - /** - * Returns the stream type matching the given attributes for volume control. - * Use this method to derive the stream type needed to configure the volume - * control slider in an {@link android.app.Activity} with - * {@link android.app.Activity#setVolumeControlStream(int)}. - *
Do not use this method to set the stream type on an audio player object - * (e.g. {@link AudioTrack}, {@link MediaPlayer}) as this is deprecated, - * use AudioAttributes instead. - * @param aa non-null AudioAttributes. - * @return a valid stream type for Activity or stream volume control that matches - * the attributes, or {@link AudioManager#USE_DEFAULT_STREAM_TYPE} if there isn't a direct - * match. Note that USE_DEFAULT_STREAM_TYPE is not a valid value - * for {@link AudioManager#setStreamVolume(int, int, int)}. - * @deprecated use {@link #getVolumeControlStream()} - */ - public static int getVolumeControlStream(@NonNull AudioAttributes aa) { - if (aa == null) { - throw new IllegalArgumentException("Invalid null audio attributes"); - } - return toVolumeStreamType(true /*fromGetVolumeControlStream*/, aa); - } - /** * Returns the stream type matching this {@code AudioAttributes} instance for volume control. * Use this method to derive the stream type needed to configure the volume