Loading core/java/android/view/inputmethod/InputMethodManager.java +26 −15 Original line number Diff line number Diff line Loading @@ -827,7 +827,7 @@ public final class InputMethodManager { void finishInputLocked() { mNextServedView = null; if (mServedView != null) { if (DEBUG) Log.v(TAG, "FINISH INPUT: " + mServedView); if (DEBUG) Log.v(TAG, "FINISH INPUT: mServedView=" + dumpViewInfo(mServedView)); if (mCurrentTextBoxAttribute != null) { try { mService.finishInput(mClient); Loading Loading @@ -1139,7 +1139,7 @@ public final class InputMethodManager { // Make sure we have a window token for the served view. if (DEBUG) { Log.v(TAG, "Starting input: view=" + view + Log.v(TAG, "Starting input: view=" + dumpViewInfo(view) + " reason=" + InputMethodClient.getStartInputReason(startInputReason)); } if (view == null) { Loading Loading @@ -1193,8 +1193,9 @@ public final class InputMethodManager { if (mServedView != view || !mServedConnecting) { // Something else happened, so abort. if (DEBUG) Log.v(TAG, "Starting input: finished by someone else (view=" + mServedView + " conn=" + mServedConnecting + ")"); "Starting input: finished by someone else. view=" + dumpViewInfo(view) + " mServedView=" + dumpViewInfo(mServedView) + " mServedConnecting=" + mServedConnecting); return false; } Loading Loading @@ -1238,7 +1239,7 @@ public final class InputMethodManager { mServedInputConnectionWrapper = servedContext; try { if (DEBUG) Log.v(TAG, "START INPUT: " + view + " ic=" if (DEBUG) Log.v(TAG, "START INPUT: view=" + dumpViewInfo(view) + " ic=" + ic + " tba=" + tba + " controlFlags=#" + Integer.toHexString(controlFlags)); final InputBindResult res = mService.startInputOrWindowGainedFocus( Loading Loading @@ -1304,7 +1305,7 @@ public final class InputMethodManager { } void focusInLocked(View view) { if (DEBUG) Log.v(TAG, "focusIn: " + view); if (DEBUG) Log.v(TAG, "focusIn: " + dumpViewInfo(view)); if (mCurRootView != view.getRootView()) { // This is a request from a window that isn't in the window with Loading @@ -1323,9 +1324,8 @@ public final class InputMethodManager { */ public void focusOut(View view) { synchronized (mH) { if (DEBUG) Log.v(TAG, "focusOut: " + view + " mServedView=" + mServedView + " winFocus=" + view.hasWindowFocus()); if (DEBUG) Log.v(TAG, "focusOut: view=" + dumpViewInfo(view) + " mServedView=" + dumpViewInfo(mServedView)); if (mServedView != view) { // The following code would auto-hide the IME if we end up // with no more views with focus. This can happen, however, Loading @@ -1346,9 +1346,8 @@ public final class InputMethodManager { */ public void onViewDetachedFromWindow(View view) { synchronized (mH) { if (DEBUG) Log.v(TAG, "onViewDetachedFromWindow: " + view + " mServedView=" + mServedView + " hasWindowFocus=" + view.hasWindowFocus()); if (DEBUG) Log.v(TAG, "onViewDetachedFromWindow: view=" + dumpViewInfo(view) + " mServedView=" + dumpViewInfo(mServedView)); if (mServedView == view && view.hasWindowFocus()) { mNextServedView = null; scheduleCheckFocusLocked(view); Loading Loading @@ -2306,4 +2305,16 @@ public final class InputMethodManager { } } } private static String dumpViewInfo(@Nullable final View view) { if (view == null) { return "null"; } final StringBuilder sb = new StringBuilder(); sb.append(view); sb.append(",focus=" + view.hasFocus()); sb.append(",windowFocus=" + view.hasWindowFocus()); sb.append(",window=" + view.getWindowToken()); return sb.toString(); } } Loading
core/java/android/view/inputmethod/InputMethodManager.java +26 −15 Original line number Diff line number Diff line Loading @@ -827,7 +827,7 @@ public final class InputMethodManager { void finishInputLocked() { mNextServedView = null; if (mServedView != null) { if (DEBUG) Log.v(TAG, "FINISH INPUT: " + mServedView); if (DEBUG) Log.v(TAG, "FINISH INPUT: mServedView=" + dumpViewInfo(mServedView)); if (mCurrentTextBoxAttribute != null) { try { mService.finishInput(mClient); Loading Loading @@ -1139,7 +1139,7 @@ public final class InputMethodManager { // Make sure we have a window token for the served view. if (DEBUG) { Log.v(TAG, "Starting input: view=" + view + Log.v(TAG, "Starting input: view=" + dumpViewInfo(view) + " reason=" + InputMethodClient.getStartInputReason(startInputReason)); } if (view == null) { Loading Loading @@ -1193,8 +1193,9 @@ public final class InputMethodManager { if (mServedView != view || !mServedConnecting) { // Something else happened, so abort. if (DEBUG) Log.v(TAG, "Starting input: finished by someone else (view=" + mServedView + " conn=" + mServedConnecting + ")"); "Starting input: finished by someone else. view=" + dumpViewInfo(view) + " mServedView=" + dumpViewInfo(mServedView) + " mServedConnecting=" + mServedConnecting); return false; } Loading Loading @@ -1238,7 +1239,7 @@ public final class InputMethodManager { mServedInputConnectionWrapper = servedContext; try { if (DEBUG) Log.v(TAG, "START INPUT: " + view + " ic=" if (DEBUG) Log.v(TAG, "START INPUT: view=" + dumpViewInfo(view) + " ic=" + ic + " tba=" + tba + " controlFlags=#" + Integer.toHexString(controlFlags)); final InputBindResult res = mService.startInputOrWindowGainedFocus( Loading Loading @@ -1304,7 +1305,7 @@ public final class InputMethodManager { } void focusInLocked(View view) { if (DEBUG) Log.v(TAG, "focusIn: " + view); if (DEBUG) Log.v(TAG, "focusIn: " + dumpViewInfo(view)); if (mCurRootView != view.getRootView()) { // This is a request from a window that isn't in the window with Loading @@ -1323,9 +1324,8 @@ public final class InputMethodManager { */ public void focusOut(View view) { synchronized (mH) { if (DEBUG) Log.v(TAG, "focusOut: " + view + " mServedView=" + mServedView + " winFocus=" + view.hasWindowFocus()); if (DEBUG) Log.v(TAG, "focusOut: view=" + dumpViewInfo(view) + " mServedView=" + dumpViewInfo(mServedView)); if (mServedView != view) { // The following code would auto-hide the IME if we end up // with no more views with focus. This can happen, however, Loading @@ -1346,9 +1346,8 @@ public final class InputMethodManager { */ public void onViewDetachedFromWindow(View view) { synchronized (mH) { if (DEBUG) Log.v(TAG, "onViewDetachedFromWindow: " + view + " mServedView=" + mServedView + " hasWindowFocus=" + view.hasWindowFocus()); if (DEBUG) Log.v(TAG, "onViewDetachedFromWindow: view=" + dumpViewInfo(view) + " mServedView=" + dumpViewInfo(mServedView)); if (mServedView == view && view.hasWindowFocus()) { mNextServedView = null; scheduleCheckFocusLocked(view); Loading Loading @@ -2306,4 +2305,16 @@ public final class InputMethodManager { } } } private static String dumpViewInfo(@Nullable final View view) { if (view == null) { return "null"; } final StringBuilder sb = new StringBuilder(); sb.append(view); sb.append(",focus=" + view.hasFocus()); sb.append(",windowFocus=" + view.hasWindowFocus()); sb.append(",window=" + view.getWindowToken()); return sb.toString(); } }