diff options
| author | Yohei Yukawa <yukawa@google.com> | 2016-05-05 21:55:48 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-05-05 21:55:50 +0000 |
| commit | 9f76abc8ab9db3306c8061e9719dbe2a998031f3 (patch) | |
| tree | bdecb8a03e3daf440131d52df1afef5c1ac6f734 /core/java/android | |
| parent | 7be089b74e4c8be473caa6fc2c2b0268c5e9d83c (diff) | |
| parent | 1544def0facda69c210b0ae64b17394ea2860d39 (diff) | |
Merge "Fix stale InputMethodManager#mFullscreenMode." into nyc-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/inputmethod/InputMethodManager.java | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 1ce804342c43..5a9a212538b6 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -39,6 +39,7 @@ import android.os.RemoteException; import android.os.ResultReceiver; import android.os.ServiceManager; import android.os.Trace; +import android.text.TextUtils; import android.text.style.SuggestionSpan; import android.util.Log; import android.util.Pools.Pool; @@ -553,8 +554,9 @@ public final class InputMethodManager { } @Override - protected void onReportFullscreenMode(boolean enabled) { - mParentInputMethodManager.setFullscreenMode(enabled); + protected void onReportFullscreenMode(boolean enabled, boolean calledInBackground) { + mParentInputMethodManager.onReportFullscreenMode(enabled, calledInBackground, + getInputMethodId()); } @Override @@ -563,6 +565,7 @@ public final class InputMethodManager { + "connection=" + getInputConnection() + " finished=" + isFinished() + " mParentInputMethodManager.mActive=" + mParentInputMethodManager.mActive + + " mInputMethodId=" + getInputMethodId() + "}"; } } @@ -718,8 +721,13 @@ public final class InputMethodManager { } /** @hide */ - public void setFullscreenMode(boolean fullScreen) { - mFullscreenMode = fullScreen; + public void onReportFullscreenMode(boolean fullScreen, boolean calledInBackground, + String inputMethodId) { + synchronized (mH) { + if (!calledInBackground || TextUtils.equals(mCurId, inputMethodId)) { + mFullscreenMode = fullScreen; + } + } } /** @hide */ @@ -746,9 +754,11 @@ public final class InputMethodManager { * your UI, else returns false. */ public boolean isFullscreenMode() { - return mFullscreenMode; + synchronized (mH) { + return mFullscreenMode; + } } - + /** * Return true if the given view is the currently active view for the * input method. @@ -1254,6 +1264,9 @@ public final class InputMethodManager { mCurId = res.id; mNextUserActionNotificationSequenceNumber = res.userActionNotificationSequenceNumber; + if (mServedInputConnectionWrapper != null) { + mServedInputConnectionWrapper.setInputMethodId(mCurId); + } } else { if (res.channel != null && res.channel != mCurChannel) { res.channel.dispose(); |
