Commit Graph

399 Commits

Author SHA1 Message Date
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
Jeff Sharkey
52b9862f87 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script that
identifies relevant "include" directives.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
2020-12-08 08:36:28 -07:00
Xin Li
8836e88707 DO NOT MERGE - Merge RQ1A.201205.011
Bug: 172690556
Merged-In: I26bed08456197721d07f2fab563be0c54e43efd2
Change-Id: Ic1ac100efa50687ccfcbb87ee91a57703105afad
2020-12-07 00:39:42 -08:00
Ming-Shin Lu
4ba8484ffb Revert "Revert "Let IME#onFinishInput called without dup onStart..."
Revert^2 "Verify lifecycle test when screen on/off"

c2769e41ea17d7f0d261396d28ddde3563422701

Reason: Fix forward Bug 174512702 and Bug 174445559
        with CL[1].

CL[1]: Icf1504d40b25fc5f53eae65d4bab48a3070db1d6

Change-Id: Id4e71a822bfde5fe6a263bbe094c0d238017efe1
2020-12-04 11:40:20 +08:00
Jeff DeCew
13fa153e25 Merge "Revert "Let IME#onFinishInput called without dup onStartInput wh..."" 2020-12-04 01:02:15 +00:00
Jeff DeCew
3d62f739a8 Revert "Let IME#onFinishInput called without dup onStartInput wh..."
Revert "Verify lifecycle test when screen on/off"

Revert submission 12716106-ims_screenstate_lifecycle

Reason for revert: b/174512702
Reverted Changes:
Iba0332ed3:Verify lifecycle test when screen on/off
I8a657e75e:Let IME#onFinishInput called without dup onStartIn...

Change-Id: I16f4a34360a2f64b69978724648a9be741f140b5
2020-12-03 19:13:34 +00:00
TreeHugger Robot
9203d45c5b Merge "Measure and optimize IMF latency 6/n" 2020-12-03 16:38:38 +00:00
Ioana Stefan
0653b692d1 Add InputConnection app and service dump
This change dumps information through IME tracing for the getter methods
exposed by the InputConnection interface. The dump is done through the
ImeTracing interface and is triggered by events in the wrapper classes
used to handle InputConnection implementations corresponding to:
 - different apps
 - InputMethodService
The new data is available under inputConnectionCall in the clients
output proto.

Bug: 154348613
Test: flash a device
      start IME tracing by calling "adb shell ime tracing start"
      end IME tracing by calling "adb shell ime tracing stop"
      pull generated trace files and visualize in Winscope
      or start tracing directly through ADB Connect and visualize traces
Change-Id: Iabd6af1b858803030848a0ef5e7dd9ecfc562716
2020-12-02 14:08:04 +00:00
Xin Li
d31ee38811 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I78222391b83a4add8e964340ec08bb8a1306e1c6
Change-Id: I28bbf40820674675ccf765c912aa8140d3f74ab2
2020-12-02 00:38:58 -08:00
TreeHugger Robot
a0b6a8dbd8 Merge changes I48be0250,I58634142
* changes:
  Measure IMF latency 5/n
  Measure IMF latency 4/n
2020-12-01 19:10:15 +00:00
Ming-Shin Lu
152eacec4f Let IME#onFinishInput called without dup onStartInput when screen-off
Also called IME#onStartInput without dup onFinishInput when screen-on,
to fix the long-standing IME input connection lifecycle issue when
device screen state changes.

Bug: 156215187
Bug: 26851566
Test: atest InputMethodStartInputLifecycleTest
Test: manual as below steps
      0) Enable InputMethodService debug flag.
      0-1) In Settings -> Develop options -> AppCompatibility Changes,
           Select Gboard and then toggle
           "FINISH_INPUT_NO_FALLBACK_CONNECTION" change.
      1) Launch a app with focused a editor and show soft-input
      2) When device screen turned-off, will see InputMethodService only
         callbacks below logs:
           CALL: doFinishInput
           CALL: onFinishInputView
           CALL: onFinishInput
      3) When device screen turned-on, will see InputMethodService only
         callbacks below logs:
           CALL: onStartInput
           CALL: onStartInputView

Change-Id: I8a657e75e274d842fb46b60375f6aeafeab96a59
2020-11-25 23:32:49 +08:00
Taran Singh
d663b62186 Measure IMF latency 4/n
Add more traces to measure cold IMF startup.

Bug: 167947940
Test: atest ImePerfTests

Change-Id: I586341426916f9b9e0f1efe988894621972da4ff
2020-11-18 17:09:24 -08:00
Tiger Huang
4b1cbf3844 Merge "Do let IME fit invisible insets" into rvc-qpr-dev am: edf2036691
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13070507

Change-Id: I9d087f60cd3244b763812895e33d110db8e559fc
2020-11-18 06:17:24 +00:00
Ioana Stefan
06f759835a Merge changes from topics "ime-tracing-interface", "optimized-ime-tracing-clients", "optimized-ime-tracing-imms", "optimized-ime-tracing-ims"
* changes:
  Log only current client data in IME tracing
  Optimized workflow for IME tracing on InputMethodManagerService side
  Optimized workflow for IME tracing on InputMethodService side
  Optimized workflow for IME tracing on clients side
2020-11-17 15:18:30 +00:00
Tiger Huang
604b284349 Do let IME fit invisible insets
Otherwise, the fullscreen IME won't cover the entire display while
there is a hidden system bar.

Fix: 168657591
Test: 1. Steps in the bug.
      2. Play WindowInsetsTests with combinations of system bar
         visibilities, navigation mode, screen orientation, and display
         cutout.
Merged-in: I6e7d665c55839dfbb14c8d2e5365537416f5f6c6
Change-Id: I6e7d665c55839dfbb14c8d2e5365537416f5f6c6
(cherry picked from commit 145f71182a)
2020-11-17 22:38:26 +08:00
Tiger Huang
f9125afce0 Merge "Do let IME fit invisible insets" 2020-11-17 14:19:38 +00:00
Taran Singh
a2b45708ef Measure and optimize IMF latency 6/n
Few low-hanging optimizations to improve IMF latency:
- Remove duplicate call to setImeWindowStatus when showWindow() is
called from showSoftInput() already.
- Remove redundant fancy animations preference check. IME window
animation is controlled by client.
- Cache mShowImeWithHardKeyboard early on.
- Remove rendundant removeOnComputeInternalInsetsListener() when called
from onCreate().

Refer to design doc in bug for amount of latency improvements caused by
this CL.

Bug: 167947940
Bug: 167948123
Test: atest CtsInputMethodTestCases
Change-Id: I0b0750f146634d8e90e0b0ac46e9208675626d0a
2020-11-13 13:31:20 -08:00
Ioana Stefan
8418bef70a Optimized workflow for IME tracing on InputMethodService side
Optimized the tracing logic for the IMS information. The
InputMethodService triggers a tracing dump through the new method
triggerServiceDump, exposed by the meTracing interface. This
change was done to be able to support custom dumps from clients
and custom dumps from InputMethodService.

This change only covers the IMS information. The IMMS
information will be dumped in next changes.

Bug: 154348613
Test: start IME tracing by calling "adb shell ime tracing start"
      end IME tracing by calling "adb shell ime tracing stop"
      pull trace using "adb pull /data/misc/wmtrace/ime_trace_service.pb ime_trace_service.pb"
Change-Id: Icda0f82d76fb7db5b2bd8d021069b1ff15a4e15b
2020-11-13 12:29:25 +00:00
Aurimas Liutikas
796760c56e Suppress all hidden abstract methods in constructable classes.
Having a hidden abstract method for a class that can be extended
means that public implementors cannot implement these hidden methods
posing a risk that custom implementations will not have required
abstract methods resulting in an exception.

Bug: 151134792
Test: make update-api
Change-Id: I758d12465fabc671be19bedeeceb16885de23c87
Exempt-From-Owner-Approval: large scale suppression of existing issues,
    no-op in terms of behavior
2020-11-11 23:16:32 +00:00
Tiger Huang
145f71182a Do let IME fit invisible insets
Otherwise, the fullscreen IME won't cover the entire display while
there is a hidden system bar.

Fix: 168657591
Test: 1. Steps in the bug.
      2. Play WindowInsetsTests with combinations of system bar
         visibilities, navigation mode, screen orientation, and display
         cutout.
Change-Id: I6e7d665c55839dfbb14c8d2e5365537416f5f6c6
2020-11-08 19:12:36 +08:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Taran Singh
5c61eefbaf Measure baseline IMF latency (2/n)
Add methods to trace.
Refer to design doc in bug.

Bug: 167947940
Test: atest ImePerfTests and also refer to README.md
Change-Id: I423e4f3f9253707d9b6d3d5a2dee260f872b879f
2020-11-03 12:42:54 -08:00
TreeHugger Robot
0815de7ab6 Merge "Only use system gesture insets for exclusion rects with root ime view" into rvc-qpr-dev am: 68349e8aaf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12950872

Change-Id: I33e6ab4c4e4320b8e5e6d938d364d969ed5179fe
2020-11-03 20:06:09 +00:00
Winson Chung
3f5b1ef5c1 Only use system gesture insets for exclusion rects with root ime view
- Instead of using the whole IME frame, we should only exclude the
  left and right regions for excluding the back gesture (the intention
  of the original change), otherwise the full IME frame will exclude
  the bottom gesture area which is respected by Launcher to prevent
  quickswitch.

Bug: 171501996
Test: Dump exclusion rects received by SysUI with normal IME (only edges)
      floating IME (no exclusion requested) and extract mode (only edges)


Change-Id: Id8e01d56190f8fafdc2da1cf95203e597acdb970
Merged-In: Id8e01d56190f8fafdc2da1cf95203e597acdb970
(cherry picked from commit 72e6319254)
2020-11-03 18:04:38 +00:00
TreeHugger Robot
9da1385292 Merge "Remove preRender input" 2020-11-02 22:35:24 +00:00
Mathew Inwood
5f0edaaaf5 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I8285daa8530260251ecad6f3f38f98e263629ca7
Change-Id: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
2020-11-02 10:30:09 +00:00
Winson Chung
5f17ad28c8 Merge "Only use system gesture insets for exclusion rects with root ime view" 2020-10-29 18:57:26 +00:00
Winson Chung
72e6319254 Only use system gesture insets for exclusion rects with root ime view
- Instead of using the whole IME frame, we should only exclude the
  left and right regions for excluding the back gesture (the intention
  of the original change), otherwise the full IME frame will exclude
  the bottom gesture area which is respected by Launcher to prevent
  quickswitch.

Bug: 171501996
Test: Dump exclusion rects received by SysUI with normal IME (only edges)
      floating IME (no exclusion requested) and extract mode (only edges)


Change-Id: Id8e01d56190f8fafdc2da1cf95203e597acdb970
2020-10-29 10:12:10 -07:00
Mathew Inwood
bb05958365 Merge "Add maxTargetSdk restriction to unused APIs." 2020-10-29 15:23:24 +00:00
Taran Singh
72de8ead9e Remove preRender input
Cleanup unused pre-render input. We've no plans to enable it.
It adds unnecessary complexity.

Bug: 159201509
Bug: 167948123
Bug: 118599175

Test: atest CtsInputMethodTestCases

Change-Id: I32fe3759b9aeb56c868f9abf42bab124b9b83374
2020-10-29 07:57:00 -07:00
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Tiger Huang
11d7861456 DO NOT MERGE: Revert "Don't let IME window fit status bar"
This reverts commit 3cd311415b.

Reason for revert: The CL causes the regression b/170474494
And it also makes status bar color incorrect while
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS is cleared
Fix: 170474494

Change-Id: I26bed08456197721d07f2fab563be0c54e43efd2
(cherry picked from commit 427bdc1c86)
2020-10-14 23:09:58 +00:00
Tiger Huang
cbf92727c1 DO NOT MERGE: Revert "Don't let IME window fit status bar" am: 427bdc1c86
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12835126

Change-Id: I97bd59bdde0633e3f77e3728312e2869ae2fe17e
2020-10-14 19:26:14 +00:00
Tiger Huang
427bdc1c86 DO NOT MERGE: Revert "Don't let IME window fit status bar"
This reverts commit 3cd311415b.

Reason for revert: The CL causes the regression b/170474494
And it also makes status bar color incorrect while
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS is cleared
Fix: 170474494

Change-Id: I26bed08456197721d07f2fab563be0c54e43efd2
2020-10-14 15:00:38 +00:00
Ioana Stefan
121bd084b9 Improve latency of IME tracing
Improve latency of IME tracing by increasing the priority of the
tracing thread and adding the dump of the debugging information
at the beginning of the execution queue.

The Design Doc for IME tracing is found here: go/ime-tracing

Bug: 154348613
Test: start trace by calling "adb shell ime tracing start"
      end trace by calling "adb shell ime tracing stop"
      pull trace using "adb pull /data/misc/wmtrace/ime_trace.pb ime_trace.pb"
Change-Id: I153ccac6d8b93f86f3180b0a23240c6a63758ed6
2020-10-12 18:35:38 +02:00
Anmol Gupta
5e68eeac86 Add proto-based InputMethodService and server side dumping for IME
This CL implements a mechanism to dump InputMethodService and IME
related server states into a proto file which can later be imported
to Winscope to allow easy debugging.

The Design Doc for the IME tracing project is: go/ime-tracing

Bug: 154348613
Test: start trace by calling "adb shell ime tracing start"
      end trace by calling "adb shell ime tracing stop"
      pull trace using "adb pull /data/misc/wmtrace/ime_trace.pb ime_trace.pb"
Change-Id: Icbfb8c11e882f29eb45dea9d4c23315c48e9d619
2020-10-07 20:27:32 +02:00
Tiger Huang
2ca936f4f0 Merge "Don't let IME window fit status bar" into rvc-qpr-dev am: 022e779ae5 am: 8fa94341e0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12629660

Change-Id: I23e8c432b52df33c17024c4f87679784b43f7c79
2020-09-23 17:08:09 +00:00
Tiger Huang
8fa94341e0 Merge "Don't let IME window fit status bar" into rvc-qpr-dev am: 022e779ae5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12629660

Change-Id: I2882852ce7cd8e4c8b9061227f32220b96cf8264
2020-09-23 16:31:05 +00:00
Tiger Huang
3cd311415b Don't let IME window fit status bar
1. So that the IME position won't be affected by the status bar
   position.
2. When status bar is hidden, the fullscreen IME can fill the status bar
   area.

Since IME can be behind status bar now, we set the status bar color to
be transparent, so that there won't be a visible color view at the
status bar area.

Fix: 168657591
Test: 1. Steps in the bug.
      2. Play WindowInsetsTests with combinations of system bar
         visibilities, navigation mode, screen orientation, and display
         cutout.
      3. Show/hide status bar while IME is visible, and see if there is
         any flicker.
Change-Id: Ia133a62cfa98c47c0d3f8d118947a18246dd8d4f
2020-09-23 01:13:54 +08:00
Tiger Huang
6ef3b6e137 Remove the legacy insets mode
This CL also refines the color view logic which checks the system bar
appearance instead of system UI flags.

Bug: 149813814
Test: atest InsetsAnimationControlImplTest InsetsControllerTest
            InsetsStateTest InsetsPolicyTest InsetsStateControllerTest
Change-Id: I26d93b3508c84e436133085bd316ade54d00d76a
2020-09-18 15:13:12 +08:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
Jeff Sharkey
487d394296 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I79488866c538bf9e76d0a6429e30262978f6fdab
2020-09-15 00:13:08 +00:00
Jeff Sharkey
6516a83886 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: Ifce5239991e3b78dd4757712e3b88093ad7161f0
2020-09-14 10:00:02 -06:00
Heemin Seog
026c5e70ba Merge "Smooth out IME animation for automotive devices" into rvc-qpr-dev am: d9892a1fac am: bab4e2077c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12404434

Change-Id: I1271f81fb84bf404613d26a9bfe747ba9cb1072d
2020-08-27 17:25:54 +00:00