diff options
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index b6e1b1f1fa3f..adf2759a8cd8 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -578,6 +578,7 @@ public class InputMethodService extends AbstractInputMethodService { private boolean mImeSurfaceScheduledForRemoval; private ImsConfigurationTracker mConfigTracker = new ImsConfigurationTracker(); private boolean mDestroyed; + private boolean mOnPreparedStylusHwCalled; /** Stylus handwriting Ink window. */ private InkWindow mInkWindow; @@ -919,9 +920,10 @@ public class InputMethodService extends AbstractInputMethodService { Log.d(TAG, "Input should have started before starting Stylus handwriting."); return; } - if (!mInkWindow.isInitialized()) { + if (!mOnPreparedStylusHwCalled) { // prepare hasn't been called by Stylus HOVER. onPrepareStylusHandwriting(); + mOnPreparedStylusHwCalled = true; } if (onStartStylusHandwriting()) { mPrivOps.onStylusHandwritingReady(requestId); @@ -976,6 +978,7 @@ public class InputMethodService extends AbstractInputMethodService { public void initInkWindow() { mInkWindow.initOnly(); onPrepareStylusHandwriting(); + mOnPreparedStylusHwCalled = true; } /** @@ -2354,7 +2357,7 @@ public class InputMethodService extends AbstractInputMethodService { /** * Called to prepare stylus handwriting. - * The system calls this before the first {@link #onStartStylusHandwriting} request. + * The system calls this before the {@link #onStartStylusHandwriting} request. * * <p>Note: The system tries to call this as early as possible, when it detects that * handwriting stylus input is imminent. However, that a subsequent call to @@ -2438,6 +2441,7 @@ public class InputMethodService extends AbstractInputMethodService { mInkWindow.hide(false /* remove */); mPrivOps.finishStylusHandwriting(requestId); + mOnPreparedStylusHwCalled = false; onFinishStylusHandwriting(); } |
