TIF: fix loud volume after input switch when volume is 0
Bug: 19134440
Change-Id: I6291f299a27315e79b505ea36bf96c79437e6b53
diff --git a/services/core/java/com/android/server/tv/TvInputHardwareManager.java b/services/core/java/com/android/server/tv/TvInputHardwareManager.java
index 2af56fe..50b2262 100644
--- a/services/core/java/com/android/server/tv/TvInputHardwareManager.java
+++ b/services/core/java/com/android/server/tv/TvInputHardwareManager.java
@@ -677,7 +677,9 @@
private AudioDevicePort mAudioSource;
private List<AudioDevicePort> mAudioSink = new ArrayList<>();
private AudioPatch mAudioPatch = null;
- private float mCommittedVolume = 0.0f;
+ // Set to an invalid value for a volume, so that current volume can be applied at the
+ // first call to updateAudioConfigLocked().
+ private float mCommittedVolume = -1f;
private float mSourceVolume = 0.0f;
private TvStreamConfig mActiveConfig = null;