ClientState mCurClient;
/**
- * The last window token that gained focus.
+ * The last window token that we confirmed to be focused. This is always updated upon reports
+ * from the input method client. If the window state is already changed before the report is
+ * handled, this field just keeps the last value.
*/
IBinder mCurFocusedWindow;
/**
+ * The client by which {@link #mCurFocusedWindow} was reported. Used only for debugging.
+ */
+ ClientState mCurFocusedWindowClient;
+
+ /**
* The input context last provided by the current client.
*/
IInputContext mCurInputContext;
if (mCurClient == cs) {
mCurClient = null;
}
+ if (mCurFocusedWindowClient == cs) {
+ mCurFocusedWindowClient = null;
+ }
}
}
}
return null;
}
mCurFocusedWindow = windowToken;
+ mCurFocusedWindowClient = cs;
// Should we auto-show the IME even if the caller has not
// specified what should be done with it?
IInputMethod method;
ClientState client;
+ ClientState focusedWindowClient;
final Printer p = new PrintWriterPrinter(pw);
client = mCurClient;
p.println(" mCurClient=" + client + " mCurSeq=" + mCurSeq);
p.println(" mCurFocusedWindow=" + mCurFocusedWindow);
+ focusedWindowClient = mCurFocusedWindowClient;
+ p.println(" mCurFocusedWindowClient=" + focusedWindowClient);
p.println(" mCurId=" + mCurId + " mHaveConnect=" + mHaveConnection
+ " mBoundToMethod=" + mBoundToMethod);
p.println(" mCurToken=" + mCurToken);
p.println("No input method client.");
}
+ if (focusedWindowClient != null && client != focusedWindowClient) {
+ p.println(" ");
+ p.println("Warning: Current input method client doesn't match the last focused. "
+ + "window.");
+ p.println("Dumping input method client in the last focused window just in case.");
+ p.println(" ");
+ pw.flush();
+ try {
+ focusedWindowClient.client.asBinder().dump(fd, args);
+ } catch (RemoteException e) {
+ p.println("Input method client in focused window dead: " + e);
+ }
+ }
+
p.println(" ");
if (method != null) {
pw.flush();