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

Commit f712a7ba authored by Yixiao Luo's avatar Yixiao Luo
Browse files

Add synchronization when handling TVINPUT_INFO_ADDED messages in

TvInputHardwareManager.ListenerHandler

Bug: 319176501
Test: mmm
Change-Id: I0c22b0c21f42af31b7df78066b718871dc1c1458
parent f63e2bd3
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -1339,16 +1339,22 @@ class TvInputHardwareManager implements TvInputHal.Callback {
                    String inputId = mHardwareInputIdMap.get(deviceId);

                    if (inputId != null) {
                        if (connection.updateCableConnectionStatusLocked(cableConnectionStatus)) {
                            if (previousCableConnectionStatus != connection.getInputStateLocked()) {
                        synchronized (mLock) {
                            if (connection.updateCableConnectionStatusLocked(
                                        cableConnectionStatus)) {
                                if (previousCableConnectionStatus
                                        != connection.getInputStateLocked()) {
                                    mHandler.obtainMessage(ListenerHandler.STATE_CHANGED,
                                    connection.getInputStateLocked(), 0, inputId).sendToTarget();
                                                    connection.getInputStateLocked(), 0, inputId)
                                            .sendToTarget();
                                }
                            } else {
                                if ((previousConfigsLength == 0)
                                        != (connection.getConfigsLengthLocked() == 0)) {
                                    mHandler.obtainMessage(ListenerHandler.STATE_CHANGED,
                                    connection.getInputStateLocked(), 0, inputId).sendToTarget();
                                                    connection.getInputStateLocked(), 0, inputId)
                                            .sendToTarget();
                                }
                            }
                        }
                    }