CEC: Remove listener records only if they are currently used

HdmiControlService manages listeners in listener record instances, and
remove them when binders become disconnected. However, if the listener
and its record are replaced due to new listener, the record for the new
listener should not be set as null by previous binder's disconnection
signal.

Bug: 28069465
Change-Id: I2984d8f93d6443048cf5d3f2988b3c6cf362f012
(cherry picked from commit f5c2a1f58dc95b9800ffb6ebf405c11acc6626b2)
This commit is contained in:
Donghyun Cho
2016-04-15 09:12:03 +09:00
parent 067f821ec8
commit fbbeb3e54a

View File

@@ -1189,7 +1189,9 @@ public final class HdmiControlService extends SystemService {
@Override
public void binderDied() {
synchronized (mLock) {
mRecordListenerRecord = null;
if (mRecordListenerRecord == this) {
mRecordListenerRecord = null;
}
}
}
}
@@ -1813,7 +1815,9 @@ public final class HdmiControlService extends SystemService {
@Override
public void binderDied() {
synchronized (mLock) {
mInputChangeListenerRecord = null;
if (mInputChangeListenerRecord == this) {
mInputChangeListenerRecord = null;
}
}
}
}