Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f52ef25a authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by android-build-merger
Browse files

Merge "Revert "AudioAttributes: remove static getVolumeControlStream method""...

Merge "Revert "AudioAttributes: remove static getVolumeControlStream method"" into oc-dev am: 6cf445bd
am: f81f4c09

Change-Id: Id0163eb6545d772bb13ade341064310bcd7aed43
parents 4d6141c2 f81f4c09
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20914,6 +20914,7 @@ 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
+1 −0
Original line number Diff line number Diff line
@@ -22657,6 +22657,7 @@ 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
+1 −0
Original line number Diff line number Diff line
@@ -21028,6 +21028,7 @@ 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
+23 −0
Original line number Diff line number Diff line
@@ -913,6 +913,29 @@ 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)}.
     * <BR>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 <code>AudioAttributes</code> instead.
     * @param aa non-null AudioAttributes.
     * @return a valid stream type for <code>Activity</code> or stream volume control that matches
     *     the attributes, or {@link AudioManager#USE_DEFAULT_STREAM_TYPE} if there isn't a direct
     *     match. Note that <code>USE_DEFAULT_STREAM_TYPE</code> 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