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

Commit 812ab290 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix Tv source audio device adjust volume, and audio is breaks up...

Merge "Fix Tv source audio device adjust volume, and audio is breaks up intermittently." am: 67dccd5e am: 9b17bea1

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1008694

Change-Id: I4a6e139abc89c479926ffa651dec2a12f3ee5e98
parents 38f8607d 9b17bea1
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -1075,19 +1075,24 @@ class TvInputHardwareManager implements TvInputHal.Callback {
            }
            if (shouldRecreateAudioPatch) {
                mCommittedVolume = volume;
                // only recreate if  something was updated or audioPath is null
                if (mAudioPatch == null || sinkUpdated ||sourceUpdated ) {
                    if (mAudioPatch != null) {
                        mAudioManager.releaseAudioPatch(mAudioPatch);
                        audioPatchArray[0] = null;
                    }
                    mAudioManager.createAudioPatch(
                        audioPatchArray,
                        new AudioPortConfig[] { sourceConfig },
                        sinkConfigs.toArray(new AudioPortConfig[sinkConfigs.size()]));
                    mAudioPatch = audioPatchArray[0];
                }
             }

            if (sourceGainConfig != null) {
                mAudioManager.setAudioPortGain(mAudioSource, sourceGainConfig);
            }
        }
        }

        @Override
        public void setStreamVolume(float volume) throws RemoteException {