From 080fa34577ea4d461c91631986ede4a25877b305 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Sun, 31 Aug 2014 16:10:05 -0700 Subject: [PATCH] Fix illegal cast in a logging code This is a follow up CL for I19ad8542659bc092b92ee13eb9, which introduced a ClassCastException error in the logging code of MSG_SET_USER_ACTION_NOTIFICATION_SEQUENCE_NUMBER handler. With this CL, the protocol in question looks like: - what: MSG_SET_USER_ACTION_NOTIFICATION_SEQUENCE_NUMBER - arg1: sequence number to be passed to #setUserActionNotificationSequenceNumber(int) - arg2: not used - obj: ClientState BUG: 16238154 BUG: 7043015 Change-Id: I08d52d4564bae9e042a2eff359e92549a66e837b --- .../com/android/server/InputMethodManagerService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java index 122786f63b1ac..c8718e3e8d53f 100644 --- a/services/core/java/com/android/server/InputMethodManagerService.java +++ b/services/core/java/com/android/server/InputMethodManagerService.java @@ -2606,15 +2606,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return true; case MSG_SET_USER_ACTION_NOTIFICATION_SEQUENCE_NUMBER: { final int sequenceNumber = msg.arg1; - final IInputMethodClient client = (IInputMethodClient)msg.obj; + final ClientState clientState = (ClientState)msg.obj; try { - client.setUserActionNotificationSequenceNumber(sequenceNumber); + clientState.client.setUserActionNotificationSequenceNumber(sequenceNumber); } catch (RemoteException e) { Slog.w(TAG, "Got RemoteException sending " + "setUserActionNotificationSequenceNumber(" + sequenceNumber + ") notification to pid " - + ((ClientState)msg.obj).pid + " uid " - + ((ClientState)msg.obj).uid); + + clientState.pid + " uid " + + clientState.uid); } return true; } @@ -3036,7 +3036,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub if (mCurClient != null && mCurClient.client != null) { executeOrSendMessage(mCurClient.client, mCaller.obtainMessageIO( MSG_SET_USER_ACTION_NOTIFICATION_SEQUENCE_NUMBER, - mCurUserActionNotificationSequenceNumber, mCurClient.client)); + mCurUserActionNotificationSequenceNumber, mCurClient)); } // Set Subtype here