Fix IllegalStateException in KeyboardBaclightController

IListener object changes in the binder transaction so need to compare
object as binder object instead otherwise will always mismatch and
throw exception.

Test: manual
Bug: 274132086
Change-Id: I265632151e0e877fff88ebd9b5a27cdef7b93b9c
This commit is contained in:
Vaibhav Devmurari
2023-03-23 15:44:34 +00:00
parent dcd1f47a04
commit ab8a4ec7fe

View File

@@ -344,7 +344,7 @@ final class KeyboardBacklightController implements
throw new IllegalStateException("The calling process has no registered "
+ "KeyboardBacklightListener.");
}
if (record.mListener != listener) {
if (record.mListener.asBinder() != listener.asBinder()) {
throw new IllegalStateException("The calling process has a different registered "
+ "KeyboardBacklightListener.");
}