Merge "Fix onStateChanged issue."

This commit is contained in:
Austin Shin
2021-09-15 03:57:16 +00:00
committed by Gerrit Code Review

View File

@@ -1265,12 +1265,14 @@ class TvInputHardwareManager implements TvInputHal.Callback {
if (inputId != null) { if (inputId != null) {
if (connection.updateCableConnectionStatusLocked(cableConnectionStatus)) { if (connection.updateCableConnectionStatusLocked(cableConnectionStatus)) {
if (previousCableConnectionStatus != connection.getInputStateLocked()) { if (previousCableConnectionStatus != connection.getInputStateLocked()) {
mListener.onStateChanged(inputId, connection.getInputStateLocked()); mHandler.obtainMessage(ListenerHandler.STATE_CHANGED,
connection.getInputStateLocked(), 0, inputId).sendToTarget();
} }
} else { } else {
if ((previousConfigsLength == 0) if ((previousConfigsLength == 0)
!= (connection.getConfigsLengthLocked() == 0)) { != (connection.getConfigsLengthLocked() == 0)) {
mListener.onStateChanged(inputId, connection.getInputStateLocked()); mHandler.obtainMessage(ListenerHandler.STATE_CHANGED,
connection.getInputStateLocked(), 0, inputId).sendToTarget();
} }
} }
} }