diff options
| author | Taran Singh <tarandeep@google.com> | 2021-03-19 15:34:02 +0000 |
|---|---|---|
| committer | Taran Singh <tarandeep@google.com> | 2021-03-30 20:03:55 +0000 |
| commit | 71ab752fc59e3db45e12d6ed9c922eb1ffca84a7 (patch) | |
| tree | ee6a9b0704e6483fb6f97c2cf7b26189475f14fd /core/java/android/inputmethodservice/IInputMethodWrapper.java | |
| parent | 3bff4d5edc64f96ce73bfde1a4359381ab8de7ec (diff) | |
Avoid IME restart for configChanges
Handle onConfigurationChanged() in order to prevent restarting
InputMethodService everytime. We introduce a new API attribute
"configChanges" in InputMethod(attrs.xml) which when declared
by IME, will be responsible for handling mentioned
configuration changes.
This CL re-introduces [1] with fix: Use new Configuration instance for
IMS#mLastKnownConfig and also handle followup comments.
[1] Ib94fddadb0dae648cf73a4c1642e51edebd19f50
Note: this change has no impact for devices not using DisplayAreas.
Bug: 167948419
Test: atest InputMethodServiceTest
Manually:
1. Patch Ie91e7a8e06b80864ef9409031e8543858552d70d to use dual
display area.
2. Open applications with editors on both display areas.
3. Attach a debug point for IMS#onConfigurationChanged().
4. Make sure IMS#resetStateForNewConfiguration() is not called
when IME moves between these two identical DisplayAreas
Also verify that bug 182604598 don't happen.
Change-Id: I43b6b80cdb35410554412ee1d3b0917ee3198272
Diffstat (limited to 'core/java/android/inputmethodservice/IInputMethodWrapper.java')
| -rw-r--r-- | core/java/android/inputmethodservice/IInputMethodWrapper.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/inputmethodservice/IInputMethodWrapper.java b/core/java/android/inputmethodservice/IInputMethodWrapper.java index 5cfcd667632b..9198eb74d1f8 100644 --- a/core/java/android/inputmethodservice/IInputMethodWrapper.java +++ b/core/java/android/inputmethodservice/IInputMethodWrapper.java @@ -171,7 +171,7 @@ class IInputMethodWrapper extends IInputMethod.Stub SomeArgs args = (SomeArgs) msg.obj; try { inputMethod.initializeInternal((IBinder) args.arg1, msg.arg1, - (IInputMethodPrivilegedOperations) args.arg2); + (IInputMethodPrivilegedOperations) args.arg2, (int) args.arg3); } finally { args.recycle(); } @@ -280,9 +280,10 @@ class IInputMethodWrapper extends IInputMethod.Stub @BinderThread @Override public void initializeInternal(IBinder token, int displayId, - IInputMethodPrivilegedOperations privOps) { + IInputMethodPrivilegedOperations privOps, int configChanges) { mCaller.executeOrSendMessage( - mCaller.obtainMessageIOO(DO_INITIALIZE_INTERNAL, displayId, token, privOps)); + mCaller.obtainMessageIOOO(DO_INITIALIZE_INTERNAL, displayId, token, privOps, + configChanges)); } @BinderThread |
