summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 7b5dd55f385b..795eb4a737ef 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -1019,8 +1019,9 @@ public class InputMethodService extends AbstractInputMethodService {
if (!mOnPreparedStylusHwCalled) {
// prepare hasn't been called by Stylus HOVER.
onPrepareStylusHandwriting();
- mOnPreparedStylusHwCalled = true;
}
+ // reset flag as it's not relevant after onStartStylusHandwriting().
+ mOnPreparedStylusHwCalled = false;
if (onStartStylusHandwriting()) {
cancelStylusWindowIdleTimeout();
mPrivOps.onStylusHandwritingReady(requestId, Process.myPid());
@@ -3089,7 +3090,8 @@ public class InputMethodService extends AbstractInputMethodService {
mInputStarted = false;
mStartedInputConnection = null;
mCurCompletions = null;
- if (mInkWindow != null) {
+ if (!mOnPreparedStylusHwCalled) {
+ // If IME didn't prepare to show InkWindow for current handwriting session.
finishStylusHandwriting();
}
// Back callback is typically unregistered in {@link #hideWindow()}, but it's possible