Merge "Fix Tv source audio device adjust volume, and audio is breaks up intermittently." am: 67dccd5e64 am: 9b17bea1e0 am: 812ab29002 am: 2a1e12794b am: 0e94c574ec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1008694 Change-Id: Ife6d41c473eeaf7e04c5a77bb74d49197a17e723
This commit is contained in:
@@ -1075,17 +1075,22 @@ class TvInputHardwareManager implements TvInputHal.Callback {
|
||||
}
|
||||
if (shouldRecreateAudioPatch) {
|
||||
mCommittedVolume = volume;
|
||||
if (mAudioPatch != null) {
|
||||
mAudioManager.releaseAudioPatch(mAudioPatch);
|
||||
}
|
||||
mAudioManager.createAudioPatch(
|
||||
// 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);
|
||||
mAudioPatch = audioPatchArray[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceGainConfig != null) {
|
||||
mAudioManager.setAudioPortGain(mAudioSource, sourceGainConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user