Commit Graph

444 Commits

Author SHA1 Message Date
Yohei Yukawa
ba8cdf5dcf Use CompletableFuture instead
This CL converts our inhouse Completable class with CompletableFuture.

One of downsides of switching into CompletableFuture is performance.
It creates much more objects, especially in unsuccessful cases
including timeout scenarios:

 * CompletableFuture#cancel() always creates a CancellationException
   object with full stack trace.  This is going to be problematic when
   we start cancelling pending InputConnection tasks in Bug 195115071
   from the IME client side.
 * Timeout cases always creates a TimeoutException object with a full
   stack trace.
 * Exception cases always creates a ExecutionException object with
   full stack trace.

Also, none of its getter methods directly fits our existing use cases
in the input method framework world.  We must always use
CompletableFutureUtil to retrieve the result value so as not to
accidentally break existing APIs.

Other than above, there should be no observable semantic behavior
changes in this CL.

Bug: 192412909
Bug: 195699814
Test: presubmit
Test: atest -c FrameworksCoreTests:CompletableFutureUtilTest
Change-Id: I215bbc870f952effa262fa431064b36ace28e8f4
2021-08-29 13:28:40 -07:00
Android Build Prod User
7deea106e4 Merge "Fix NPE in IMS#onEvaluateFullscreenMode" into sc-v2-dev am: cdda26f9c7 am: 757a2bc5bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15626298

Change-Id: I787b865c659c0c9ccf9947bf76236a282a07e612
2021-08-26 17:38:18 +00:00
Taran Singh
fabbcd1247 Fix NPE in IMS#onEvaluateFullscreenMode
Fix NPE when EditorInfo is null

Test: Manually using steps in bug
Fix: 197078413
Bug: 197258697

Change-Id: I7437dec66f2cfe7769b9448916998c40745c3ebc
2021-08-19 21:54:44 +00:00
Charles Chen
4b69612c7f Merge "Allow WPS to create windows with multiple type" into sc-v2-dev am: cc2f80f5a0 am: ddfa753ff0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15125751

Change-Id: I3e6c55f06e97c0a5e72cac7b181db4d0e2d0e624
2021-08-13 23:52:49 +00:00
Charles Chen
8bae39cab2 Allow WPS to create windows with multiple type
Before WindowProviderService, Service can add windows with several
window types. This is previously not allowed for WindowProviderService
because a context can only associate with a window container.
However, it may cause regressions because Service is used to add
windows with multiple types.
This CL allows WindowProviderService to do so, but WindowProviderService
can only associate with the window type returned by #getWindowType.
This CL also extracts some methods to WindowContext interface so that
WindowContext and WindowProviderService can reuse the same interface.

Test: atest WindowContextPolicyTests StrictModeTest
Test: atest ContextIsUiContextTest ContextGetDisplayTest
Test: atest WindowContextTest WindowContextTests
fixes: 191959013

Change-Id: Ie16916b370a4cbb8a17ccaec9870d47b4b089390
2021-08-11 23:43:01 +08:00
Yohei Yukawa
5693db4d66 Rename IInputConnectionWrapper to RemoteInputConnectionImpl
This is a mechanical refactoring CL that renames

  com.android.internal.view.IInputConnectionWrapper

to

  com.android.internal.inputmethod.RemoteInputConnectionImpl

with no observable behavior change.

Bug: 192412909
Test: presubmit
Test: No lint error under core/java/com/android/internal/inputmethod
Change-Id: I171106ad0b46fbb495a6bf08d10f33915c2d29ac
2021-08-03 14:34:36 -07:00
TreeHugger Robot
75b51f31d4 Merge "Use IBooleanResultCallback when appropriate in IInputContext" 2021-07-19 22:04:15 +00:00
TreeHugger Robot
83fbe443dd Merge "Finish renaming requestUpdateCursorAnchorInfo() to requestCursorUpdates()" 2021-07-19 21:45:34 +00:00
Yohei Yukawa
14add1cb74 Use IBooleanResultCallback when appropriate in IInputContext
This is a small code clean up in IInputContext, which should have no
observable behavior change for app/IME developers.

In the following two methods we have used IIntResultCallback to return
a boolean value in a synchronous manner by using 0 to represent false
and 1 to represent true.

 * IInputContext#requestCursorUpdates
 * IInputContext#commitContent

Now that we have IBooleanResultCallback, we can just use true and
false without any conversion.

Bug: 192412909
Test: presubmit
Change-Id: Id6beaf3c9350b70138eb77f406be86fe2c8b679f
2021-07-18 23:48:23 -07:00
Yohei Yukawa
ca490fc879 Finish renaming requestUpdateCursorAnchorInfo() to requestCursorUpdates()
This is a follow up CL to my previous CL [1] in Android L, which
renamed

  InputConnection#requestUpdateCursorAnchorInfo()

to

  InputConnection#requestCursorUpdates()

per API council feedback before that API was finally published.

Although its API surface has been correctly renamed, there have been
several uses of its older name in our internal code.  This CL also
updates such internal uses to avoid confusions.

As this is a purely mechanical renaming, there should be no behavior
change in this CL.

 [1]: I772c48ff18918e48a81e807b48ff907614485c09
      d8636ea7ca

Bug: 192412909
Test: atest
Change-Id: I75701a5a32d52283497208013c28ceb75c1adfa9
2021-07-18 23:38:16 -07:00
Yohei Yukawa
3f7c4a3c0d Check MissingMethodFlags.COMMIT_CORRECTION at the right place
This is a follow up CL to my previous CL [1], which aimed to put an
early-exit check for

  InputConnection#commitCorrection(CorrectionInfo)

but mistakenly put it in

  InputConnection#commitCompletion(CompletionInfo).

With this CL the early-exit check will be placed at the right place.

 [1]: I3c58fadd924fad72cb984f0c23d3099fd0295c64
      19a80a1e80

Fix: 193907158
Test: atest CtsInputMethodTestCases:InputConnectionEndToEndTest
Change-Id: I497628165072c73d0e279f89afe0d8730531ecfc
2021-07-16 12:09:37 -07:00
Yohei Yukawa
a975bfc447 Introduce InputMethodServiceInternal for better abstraction
This is a mechanical refactoring CL that has no behavior change.

This CL removes the direct dependency on AbstractInputMethodService
from whenever possible.  As a result, the following classes no longer
directly depend on AbstractInputMethodService.

 * android.inputmethodservice.IInputMethodWrapper
 * android.inputmethodservice.RemoteInputConnection
 * com.android.internal.inputmethod.ImeTracing
 * com.android.internal.inputmethod.ImeTracingClientImpl
 * com.android.internal.inputmethod.ImeTracingServerImpl

This is still a purely mechanical refactoring.  There should be no
observable behavior change.

Bug: 192412909
Test: atest CtsInputMethodTestCases
Test: Manually verified that IME tracing still works
Change-Id: I2aeeeacd27195ce10059d6590e098a4a969e774d
2021-07-13 15:54:10 +00:00
Yohei Yukawa
26b594af10 Optimize InputConnectionProtoDumper a bit
This is a mechanical refactoring CL that has no behavior change.

Currently all the utility methods defined in
InputConnectionProtoDumper return ProtoOutputStream, while the
returned instances will always be converted into byte[] eventually.
With this CL, those utility methods return byte[] instances directly,
which is expected to make it easier for ART/dexpreopt to do more
optimizations such as code inlining because instances of
ProtoOutputStream will no longer be escaped from those methods.

Bug: 192412909
Test: atest CtsInputMethodTestCases
Test: Manually verified that IME tracing still works
Change-Id: I7b24aee5428da312972aa86b8658429b421490f8
2021-07-09 09:46:47 -07:00
Yohei Yukawa
3beeb3e3c7 Merge android.util.imetracing into com.android.internal.inputmethod
This CL renames classes related to IME tracing as follows

 * android.util.imetracing.ImeTracing
     => com.android.internal.inputmethod.ImeTracing
 * android.util.imetracing.ImeTracingClientImpl
     => com.android.internal.inputmethod.ImeTracingClientImpl
 * android.util.imetracing.InputConnectionHelper
     => com.android.internal.inputmethod.InputConnectionProtoDumper

Other than those renamings, there should be no observable chagnes.

Fix: 175761228
Test: presubmit
Test: Manually verified that IME tracing still works
Change-Id: I6518d946e1832037f240f57aa900d3447083f1fa
2021-07-09 09:46:36 -07:00
Yohei Yukawa
8426bd7d02 Rename InputConnectionWrapper to RemoteInputConnection
This is a purely mechanical refactoring with no behavior change.

An existing non-API class

  com.android.internal.view.InputConnectionWrapper

has been used only from another non-API class

  android.inputmethodservice.IInputMethodWrapper.

By moving it to android.inputmethodservice package we can make it a
package-private class, which is what this CL is intended
to achieve.

Furthermore, there is another public API class with the same name:

  android.view.inputmethod.InputConnectionWrapper

, which has been confusing with this internal one.  To avoid such a
confusion, this CL also renames this internal one to
RemoteInputConnection.

Other than those mechanical changes, there should be no observable
behavior changes.

Bug: 192412909
Test: atest CtsInputMethodTestCases
Change-Id: Ic0babecd34a6bc80b917050370abc2db5c03d84e
2021-07-07 09:03:34 -07:00
Charles Chen
73c59237fe Merge "Remove updateImeDisplayId" into sc-v2-dev am: 56e17bfcd8 am: ebf2e81d46
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15065650

Change-Id: I15b4412061117df48156736a4536bb7d43ddd3f6
2021-07-02 03:52:03 +00:00
Wilson Wu
28429a218b Merge "Remove multi-client IME" 2021-06-30 01:34:37 +00:00
Charles Chen
cbf1be8150 Remove updateImeDisplayId
After InputMethodService migrated to WindowProviderService,
the display is initialized by getInitialDisplayId().
Therefore, we don't need updateImeDisplayId() to initialize
InputMethodService's Display anymore.

Test: atest CtsInputMethodTestCases MultiDisplaySystemDecorationTests
Bug: 149463653

Change-Id: Ia78139b5defc48c8b0354fc1e212eeb38fd71ba4
2021-06-24 20:26:19 +08:00
Charles Chen
fc7a1b5b34 Migrate InputMethodService to WindowProviderService
Also introduce IWindowManager#getDisplayIdToLaunchIme to make IMS
be aware of the launched display to prevent extra onConfigurationChanged
callback

Bug: 149463653
Test: atest MultiDisplaySystemDecorationTests CtsInputMethodTestCases
Test: atest ContextTest ContextIsUiContextTest
Test: manual - moving IME between 2 displays and displayArea within
      display - config change received
Test: manual - the app to show IME crashed and focus is set to the
      next task - no config change

Change-Id: Ie565e30ed5dd3f2cfe27355a6dded76dc3adc14b
2021-06-18 11:44:30 +08:00
Wilson Wu
34091a5066 Remove multi-client IME
Design doc: go/multi-session-ime-removal

We no longer require this mechanism to support
multi-clients IME, remove it completely.

Bug: 173341412
Test: atest CtsInputMethodTestCases
Change-Id: I0bdc8fe3d32ccabc8ea7996fc689543c3f99331a
2021-06-16 18:10:34 +08:00
Taran Singh
d661177926 Don't cache IME surface in fullscreen mode
Dont cache IME surface when IME was in fullscreen mode. This is done in
order to fix IME closing when it is used with RecyclerView. There can be
a special case where RecyclerView detaches the view holding mServedView
when IME is in fullscreen mode

While exact reason is still a mystery, short term solution is to not
cache IME when it was in fullscreen mode.

Fix: 187772544
Bug: 188818557
Bug: 167948123

Test: Manually using steps in bug
Change-Id: I1194d08a00622f1dfa232209a70dcb0797ba192b
2021-05-20 20:16:58 +00:00
Tiger Huang
f0cf73d84b Merge "Let IME receive insets ignoring z-order" into sc-dev 2021-05-11 10:55:03 +00:00
Tiger Huang
ea491da863 Let IME receive insets ignoring z-order
When IME is targeting notification shade, IME will be above status bar,
and IME won't receive status bar insets anymore. The surface position of
the control of IME will be changed because IME fits status bar. If the
IME control target receives the new IME control (new surface position)
after the IME animation starts, the IME position will be stale until the
next IME animation, because the controls would be copied before playing
the insets animation.

This CL lets IME receive insets no matter what z-order IME has. So the
IME position will stay the same while it is moved above system bars, and
the IME behavior will be the same as before Android S (receiving status
bar insets while targeting notification shade).

Fix: 186178729
Test: Steps as below:
1. Make, install, and open EditTextVariations.
2. Open menu, and select Direct Reply.
3. Expand notification shade.
4. Expand the notification of EditTextVariations.
5. Click Direct Teply Test.
6. See if IME is overlapped with (button-based) navigation bar.
   If no, press home button and repeat 3-6 for several times.
Change-Id: I53c64a5598f246ad577f652156903e4666a30cd9
2021-05-10 17:02:39 +00:00
Wilson Wu
37051aef38 Make IInputMethodPrivilegedOperations to async (6/N)
-. Remove VoidResultCallback of applyImeVisibility.
   and let it be truly asynchronous.
-. Rename this method to applyImeVisibilityAsync.

Bug: 183587528
Test: atest CtsInputMethodTestCases
Change-Id: Ica564c526223d32641a2485c0c0f3490fe4bfd39
2021-04-29 16:05:05 +08:00
Yohei Yukawa
c09a657113 Merge "Make IInputMethodPrivilegedOperations to async (5/N)" into sc-dev 2021-04-29 00:45:17 +00:00
Yohei Yukawa
1d14a33860 Merge "Make IInputMethodPrivilegedOperations to async (4/N)" into sc-dev 2021-04-28 15:45:58 +00:00
Wilson Wu
e702c9d381 Make IInputMethodPrivilegedOperations to async (5/N)
-. Remove VoidResultCallback of notifyUserAction.
   and let it be truly asynchronous.
-. Rename this method to notifyUserActionAsync.

Bug: 183587528
Test: atest CtsInputMethodTestCases
Change-Id: I384fd689b6bd1d418ff5208444fbba2c1eac6f85
2021-04-28 14:40:08 +08:00
Wilson Wu
78a23141be Make IInputMethodPrivilegedOperations to async (4/N)
-. Remove VoidResultCallback of updateStatusIcon
   and let it be truly asynchronous.
-. Rename this method to updateStatusIconAsync.

Bug: 183587528
Test: atest CtsInputMethodTestCases
Change-Id: Ic7759354ec06a3293ea370ab7afe7422eb2d9356
2021-04-28 12:56:38 +08:00
Ming-Shin Lu
2c8068c98a Consolidate InputMethodManager#toggleSoftInput reliability
As previously InputMethodManager#toggleSoftInput is designed to tell
InputMethodService directly through IInputMethodSession to toggle
soft-keyboard visibility, this could be happened some unexpected IME
visibility issues that when the app calling this method in the wrong
state like the app toggling IME visibility when the app is off-screen
but unexpectedly it ends up showing soft-keyboard when the IME is in
invisible state.

To minimize the app compatibility without changing the public API
surface and reducing unexpected IME visibilty been toggled behavior
especially happens when switching the apps, changed the internal IPC
protocols to call IMMS#showSoftInput or IMMS#hideSoftInput directly
according the previous IME consumer requested visibility state,
so that in IMMS side can validate to see if the token user is
still focused and ready to toggle the IME visibility to show or hide.

As the result, we deprecated toggleSoftInput and
toggleSoftInputFromWindow to state the reason as the above, and
recommand to use showSoftInput or hideSoftInputFromWindow instead,
so that framework side no longer has to call {InputMethodSessionWrapper,
InputMethodSessionImpl}#toggleSoftInput.

Bug: 182071625
Test: m checkapi doc-comment-check-docs
Test: atest KeyboardVisibilityControlTest#testToggleSoftInput
Change-Id: I390dc029e7bcc30c200926a9bfbbbd0268a1f714
2021-04-27 01:34:12 +08:00
Wilson Wu
75f46d33c8 Merge "Make IInputMethodPrivilegedOperations to async (3/N)" into sc-dev 2021-04-22 04:50:11 +00:00
Wilson Wu
c84b3e15df Make IInputMethodPrivilegedOperations to async (3/N)
-. Remove VoidResultCallback of reportFullscreenMode
   and let it be truly asynchronous.
-. Rename this method to reportFullscreenModeAsync.

Bug: 183587528
Test: atest CtsInputMethodTestCases
Test: Manually verified as follows.
   1. Build flame-userdebug and flash it.
   2. Make sure that the screen rotation is enabled.
   3. make -j SoftKeyboard
   4. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
   5. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
   6. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
   7. make -j EditTextVariations
   8. adb install -r $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/arm64/EditTextVariations.apk
   9. adb shell am start -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
  10. Make sure that the device is in the landscape mode,
      and the SoftKeyboard sample IME is not yet shown.
  11. adb shell dumpsys input_method | grep mFullscreenMode
      Then make sure the mFullscreenMode is "false"
  12. Tap the first edit field then make sure that SoftKeyboard
      sample IME becomes visible in the fullscreen mode.
  13. adb shell dumpsys input_method | grep mFullscreenMode
      Then make sure the mFullscreenMode is "true"
  14. Tap the down button on the navbar to hide the SoftKeyboard
      sample IME.
  15. adb shell dumpsys input_method | grep mFullscreenMode
      Then make sure the mFullscreenMode is "false"

Change-Id: I92e8b0d420be3dd16cc4f3ba29e0bde5f12ab2ce
2021-04-20 17:46:27 +08:00
Ming-Shin Lu
c66dd0af02 Fix not invoke setImeWindowStatus when unlocked by PIN lock
CL[1] removed setImeWindowStatatus call in showSoftInput()
since showWindow() has a call.

Howerver, the call invokes only when the IME visibility has changed.
It overlooked the case that when the screen unlocked by PIN
lock, since the focused app and IME visiblity is the same, so
the setImeWindowStatus in showWindow() doesn't invoked.

When then keyguard shown, IMMS side will invoke updateSystemUiLocked to
update navbar icon as invisible, so after the user unlocked, user won't
see the navbar icon set visible back.

As the result, we still need setImeWindowStatus called in showSoftInput
to fix this case.

[1]: I0b0750f146634d8e90e0b0ac46e9208675626d0a

Fix: 181294561
Test: manual as below steps:
  0) setup PIN lock for the device
  1) launch an app (e.g. Messaging) and show IME
  2) turn-off the screen and unlock the screen with PIN
  3) verify if the keyboard is visible and the navbar icon is visible
Change-Id: I168fda76c1c7bdcabe94f7c2550c6b5c7c41e5e0
2021-04-19 13:06:35 +00:00
Wilson Wu
738468ba17 Make IInputMethodPrivilegedOperations to async (2/N)
-. Remove VoidResultCallback of reportStartInput
   and let it be truly asynchronous.
-. Rename this method to reportStartInputAsync.

Bug: 183587528
Test: atest CtsInputMethodTestCases
Change-Id: Ic8e7f888f78f7c536a9228db02a8b355555d7220
2021-04-15 19:02:53 +08:00
Wilson Wu
889e3d63bb Merge "Make IInputMethodPrivilegedOperations to async (1/N)" into sc-dev 2021-03-31 10:17:25 +00:00
Taran Singh
71ab752fc5 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
2021-03-30 20:03:55 +00:00
Wilson Wu
1b8593fdfe Make IInputMethodPrivilegedOperations to async (1/N)
-. Remove VoidResultCallback of setImeWindowStatus
   and let it be asynchronous.
-. Rename function naming to setImeWindowStatusAsync.

Bug: 183587528
Test: atest CtsInputMethodTestCases
Change-Id: Ia9f19ca5ae418089ce43816dcd50487e1b1172f1
2021-03-29 11:53:42 +08:00
Yohei Yukawa
1e7d125662 Revert "Avoid IME restart for configChanges"
Revert "Add cts for InputMethodService configChanges"

Revert submission 13727407-167948419

Reason for revert:
Possible root cause of Bug 182604598.

Reverted Changes:
Ib94fddadb:Avoid IME restart for configChanges
Ieca327b2e:Add cts for InputMethodService configChanges

Bug: 167948419
Bug: 182604598
Test: presubmit
Change-Id: I3accc55ac65d0e2ec30c3f6023680fda27ad3e97
2021-03-13 01:08:48 +00:00
Taran Singh
9a2eed9f49 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

[1] Iff88b768c6b06cf5cf1fe9e97ee97f8f78e6f0bd

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

Change-Id: Ib94fddadb0dae648cf73a4c1642e51edebd19f50
2021-03-10 08:22:42 +00:00
Taran Singh
712fc24a34 Revert "Avoid IME restart for configChanges"
Revert "Add cts for InputMethodService configChanges"

Revert submission 13417792-b/167948419

Reason for revert: Causes bugs like b/181195100
Reverted Changes:
Iff88b768c:Avoid IME restart for configChanges
Ib7ce13340:Add cts for InputMethodService configChanges

Bug: 167948419
Fix: 181195100
Change-Id: I36bca545b09b4f870560964ec61fa6bb344fceaf
2021-03-01 18:28:10 +00:00
Taran Singh
d6f8a1ada1 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.

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

Change-Id: Iff88b768c6b06cf5cf1fe9e97ee97f8f78e6f0bd
2021-02-18 18:22:27 +00:00
TreeHugger Robot
4b0a9bd7dd Merge "Make EditorInfo.internalImeOptions parcelable." into sc-dev 2021-02-06 04:53:22 +00:00
Treehugger Robot
3ae343dfd8 Merge "OWNERS for InlineSuggestion* in view/inputmethod" am: 2745c788a0 am: a42ad625ac am: a13d5a3cba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1562186

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3a018097be211007dc599da7eaee41250f4b58b9
2021-02-04 01:11:37 +00:00
Treehugger Robot
a13d5a3cba Merge "OWNERS for InlineSuggestion* in view/inputmethod" am: 2745c788a0 am: a42ad625ac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1562186

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2c009ee37657466cc94974af0331d922aa413279
2021-02-04 00:40:33 +00:00
Ahaan Ugale
4aa50a2f0f OWNERS for InlineSuggestion* in view/inputmethod
Change-Id: I4eec1c36afeb563ff050e0d0ee570cdeea80916f
2021-02-02 18:38:42 +00:00
Taran Singh
2b4bd4c6fb Make EditorInfo.internalImeOptions parcelable.
Followup to I5a5e73e1dec776665f28a7e2eb091b555198001b.
internalImeOptions field should be parcelable.

Fix: 157870379
Test: Manually using steps in bug
Change-Id: I12b442b8b2d8cf83aa4cc789133b42251ad2c191
2021-01-29 16:29:04 +00:00
Taran Singh
533596c71d Retain IME surface with a timeout
As of today, IME surface is removed immidiately after its hidden.
This causes IME surface to be recreated when next time its requested,
which takes noticeable amount of time ~30ms on a typical phone [1]
In order to improve IME latency, we keep the surface in memory a little
longer.
This is ideal for use cases where IME has to move between DisplayAreas
OR when IME is closed only briefly.
While there could be other strategies to hold IME surface in memory,
timeout is simplistic and is also unaffected by IMF lifecycle, which
could vary when moving between DisplayAreas or Displays.

Bug: 167948419
Bug: 167948123
Test: atest CtsInputMethodTestCases

[1] refer design doc in bug 167947940

Change-Id: Ib062640b68164efbb647e7bf27b7f8eb5ed252dc
2021-01-12 18:58:44 +00:00
Taran Singh
dc211bfac3 Prevent Fullscreen IME when app is in portrait.
When an app is running in portrait orientation, regardless of
what orientation display is in, IME shouldn't use fullscreen-mode.

Setting IME_FLAG_NO_FULLSCREEN in EditorInfo makes sure IME doesn't go
fullscreen.

Bug: 157870379
Test: Manually using steps in bug
Change-Id: I5a5e73e1dec776665f28a7e2eb091b555198001b
2020-12-21 05:57:47 -08:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Jeff Sharkey
358f0d4fc8 Merge changes from topic "dec5" am: c2793cf12b am: 9af6ac78b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519384

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2776a545a24f007ccb4b9ee14705978571265ef3
2020-12-08 16:43:19 +00:00
Jeff Sharkey
9af6ac78b0 Merge changes from topic "dec5" am: c2793cf12b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519384

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifdc390f5ae046c515a30158f3f55b831be147547
2020-12-08 16:05:11 +00:00