summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Amy Zhang <amyjojo@google.com> 2019-03-30 01:23:42 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-03-30 01:23:42 +0000
commit5bf6f81361dd8ab1dcc96af14fee9467ccda4e90 (patch)
treebae44a9aafc14c4113b730806dad18f3a049354d
parentd727a138708b1dee91bdf1f998381ad0b779828e (diff)
parent613330ef617ad2b5a841b68bb0abdb17a8ee87cf (diff)
Merge "Make mTvSystemAudioModeSupport originally null and fix related logic"
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
index a2882de7ee7a..9e2fd4e9e91e 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
@@ -74,7 +74,15 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
@GuardedBy("mLock")
private boolean mSystemAudioControlFeatureEnabled;
- private boolean mTvSystemAudioModeSupport;
+ /**
+ * Indicates if the TV that the current device is connected to supports System Audio Mode or not
+ *
+ * <p>If the current device has no information on this, keep mTvSystemAudioModeSupport null
+ *
+ * <p>The boolean will be reset to null every time when the current device goes to standby
+ * or loses its physical address.
+ */
+ private Boolean mTvSystemAudioModeSupport = null;
// Whether ARC is available or not. "true" means that ARC is established between TV and
// AVR as audio receiver.
@@ -321,7 +329,7 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
@ServiceThreadOnly
protected void onStandby(boolean initiatedByCec, int standbyAction) {
assertRunOnServiceThread();
- mTvSystemAudioModeSupport = false;
+ mTvSystemAudioModeSupport = null;
// Record the last state of System Audio Control before going to standby
synchronized (mLock) {
mService.writeStringSystemProperty(
@@ -1029,12 +1037,11 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
* <p>The result of the query may be cached until Audio device type is put in standby or loses
* its physical address.
*/
- // TODO(amyjojo): making mTvSystemAudioModeSupport null originally and fix the logic.
void queryTvSystemAudioModeSupport(TvSystemAudioModeSupportedCallback callback) {
- if (!mTvSystemAudioModeSupport) {
+ if (mTvSystemAudioModeSupport == null) {
addAndStartAction(new DetectTvSystemAudioModeSupportAction(this, callback));
} else {
- callback.onResult(true);
+ callback.onResult(mTvSystemAudioModeSupport);
}
}