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

Commit 69ab110b authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android (Google) Code Review
Browse files

Merge "Fix AudioProductStrategy#getLegacyStreamTypeForStrategyWithAudioAttributes documentation"

parents bd50cea7 3960123b
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -134,9 +134,11 @@ public final class AudioProductStrategy implements Parcelable {

    /**
     * @hide
     * @param audioAttributes to identify AudioProductStrategy with
     * @return legacy stream type associated with matched AudioProductStrategy
     *              Defaults to STREAM_MUSIC if no match is found, or if matches is STREAM_DEFAULT
     * @param audioAttributes to identify {@link AudioProductStrategy} with
     * @return legacy stream type associated with matched {@link AudioProductStrategy}. If no
     *              strategy found or found {@link AudioProductStrategy} does not have associated
     *              legacy stream (i.e. associated with {@link AudioSystem#STREAM_DEFAULT}) defaults
     *              to {@link AudioSystem#STREAM_MUSIC}
     */
    public static int getLegacyStreamTypeForStrategyWithAudioAttributes(
            @NonNull AudioAttributes audioAttributes) {
@@ -147,9 +149,9 @@ public final class AudioProductStrategy implements Parcelable {
                int streamType = productStrategy.getLegacyStreamTypeForAudioAttributes(
                        audioAttributes);
                if (streamType == AudioSystem.STREAM_DEFAULT) {
                    Log.w(TAG, "Attributes " + audioAttributes.toString() + " ported by strategy "
                            + productStrategy.getId() + " has no stream type associated, "
                            + "DO NOT USE STREAM TO CONTROL THE VOLUME");
                    Log.w(TAG, "Attributes " + audioAttributes + " supported by strategy "
                            + productStrategy.getId() + " have no associated stream type, "
                            + "therefore falling back to STREAM_MUSIC");
                    return AudioSystem.STREAM_MUSIC;
                }
                if (streamType < AudioSystem.getNumStreamTypes()) {