From ab8a4ec7fee79b72c54c67866ff427bcc989e103 Mon Sep 17 00:00:00 2001 From: Vaibhav Devmurari Date: Thu, 23 Mar 2023 15:44:34 +0000 Subject: [PATCH] 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 --- .../com/android/server/input/KeyboardBacklightController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/input/KeyboardBacklightController.java b/services/core/java/com/android/server/input/KeyboardBacklightController.java index e1e3dd9967e01..403323803fcae 100644 --- a/services/core/java/com/android/server/input/KeyboardBacklightController.java +++ b/services/core/java/com/android/server/input/KeyboardBacklightController.java @@ -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."); }