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

Commit 3901cbdf authored by Eric Laurent's avatar Eric Laurent Committed by android-build-merger
Browse files

Merge "AudioAttributes: fix setInternalLegacyStreamType()" into qt-dev

am: 935f4e8d

Change-Id: I927b299f2a2da403389c3e01b74341cdea46cdfe
parents 509956d6 935f4e8d
Loading
Loading
Loading
Loading
+45 −40
Original line number Diff line number Diff line
@@ -816,6 +816,8 @@ public final class AudioAttributes implements Parcelable {
         */
        @UnsupportedAppUsage
        public Builder setInternalLegacyStreamType(int streamType) {
            mContentType = CONTENT_TYPE_UNKNOWN;
            mUsage = USAGE_UNKNOWN;
            if (AudioProductStrategy.getAudioProductStrategies().size() > 0) {
                AudioAttributes attributes =
                        AudioProductStrategy.getAudioAttributesForStrategyWithLegacyStreamType(
@@ -828,9 +830,9 @@ public final class AudioAttributes implements Parcelable {
                    mTags = attributes.mTags;
                    mBundle = attributes.mBundle;
                    mSource = attributes.mSource;
                    return this;
                }
            }
            if (mContentType == CONTENT_TYPE_UNKNOWN) {
                switch (streamType) {
                    case AudioSystem.STREAM_VOICE_CALL:
                        mContentType = CONTENT_TYPE_SPEECH;
@@ -870,7 +872,10 @@ public final class AudioAttributes implements Parcelable {
                    default:
                        Log.e(TAG, "Invalid stream type " + streamType + " for AudioAttributes");
                }
            }
            if (mUsage == USAGE_UNKNOWN) {
                mUsage = usageForStreamType(streamType);
            }
            return this;
        }