Commit Graph

15161 Commits

Author SHA1 Message Date
Pablo Gamito
9b68a1d091 Merge "Add intDef annotation processor to generate mapping" 2020-07-16 12:18:55 +00:00
TreeHugger Robot
af00656abe Merge "Fixed ContentCaptureSession javadoc." 2020-07-16 02:26:30 +00:00
Yinglei Wang
fba2b3264f Merge "Delay sending accessibility events a little for temporarily detached view" 2020-07-15 17:34:45 +00:00
Wale Ogunwale
f98cf3bfe2 Merge "Remove Type.statusBars from compatInsetsTypes if FLAG_FULLSCREEN" into rvc-dev am: 0b237bb06f am: 2346053033 am: 2cff1f32fc am: 1563e67c5e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12157384

Change-Id: I006720e0aedbaff7e20bcaeead0e8d855a326de1
2020-07-15 14:53:43 +00:00
Wale Ogunwale
1563e67c5e Merge "Remove Type.statusBars from compatInsetsTypes if FLAG_FULLSCREEN" into rvc-dev am: 0b237bb06f am: 2346053033 am: 2cff1f32fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12157384

Change-Id: I9721f6a75c63313179b9be27117b403ca475392b
2020-07-15 14:41:13 +00:00
Wale Ogunwale
2cff1f32fc Merge "Remove Type.statusBars from compatInsetsTypes if FLAG_FULLSCREEN" into rvc-dev am: 0b237bb06f am: 2346053033
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12157384

Change-Id: I13f507d5693fdac232c8b6b29dda775358a90658
2020-07-15 14:19:44 +00:00
Wale Ogunwale
2346053033 Merge "Remove Type.statusBars from compatInsetsTypes if FLAG_FULLSCREEN" into rvc-dev am: 0b237bb06f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12157384

Change-Id: I82021bdc4f4d737feda4a20febf532db9fa1c850
2020-07-15 14:03:48 +00:00
Tiger Huang
0f310bdec8 Remove Type.statusBars from compatInsetsTypes if FLAG_FULLSCREEN
In the legacy layout world, if a window has FLAG_FULLSCREEN, then its
stable insets won't be affected by status bar. This CL makes the layout
logic compatible.

Fix: 160593171
Test: InsetsStateTest InsetsControllerTest ImeInsetsSourceConsumerTest
Change-Id: I59717e699470273e2462c1ad864e00bb9a126677
2020-07-15 19:00:19 +08:00
yingleiw
e34bc33af3 Delay sending accessibility events a little for temporarily detached view
In RV, a view could be temporarily detached in one draw cycle.
Accessibility events sent during this time will be lost. To prevent the
events from being lost, we will set a flag when a view is detached by
parent. And when sending accessibility events for detached view, we will
delay it a little by
ViewConfiguration.getSendRecurringAccessibilityEventsInterval. This way,
if the view is attached in one draw cycle, the events will be sent out.

Also add more setStateDescription() in CompoundButton to for safer code.
(this is not the cause of this bug though).

Fix: 151125936

Test: tested that the bug is fixed.

Change-Id: Iffca8c87bad4fa2f66862b966e351562d77d6d76
2020-07-14 17:12:07 -07:00
Pablo Gamito
c18f0a3562 Add intDef annotation processor to generate mapping
Test: Run 'mp :framework-all' and check if mapping file is properly
generated

Change-Id: I58f7ea5894e8ec994a74781663654508205c4db1
2020-07-14 13:38:57 +00:00
felipeal
06aaffe4b2 Fixed ContentCaptureSession javadoc.
Test: none
Fixes: 160551990

Change-Id: I34b584234ca3851e95574fe3c3d42e5f972cdbd4
2020-07-10 18:42:56 -07:00
TreeHugger Robot
e1c8e93342 Merge "Consolidate start new input scenerios" into rvc-dev am: 6c440de7a4 am: 96863d0d50 am: a96c3690e9 am: 7f7ea1b202
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12086310

Change-Id: Ieb588969fcbe8a20a56caede919ccbcbf4d2e89c
2020-07-10 19:34:49 +00:00
TreeHugger Robot
7f7ea1b202 Merge "Consolidate start new input scenerios" into rvc-dev am: 6c440de7a4 am: 96863d0d50 am: a96c3690e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12086310

Change-Id: I97daed5472aa72b6e9cda3469ad85cc0e621cbfa
2020-07-10 19:21:42 +00:00
TreeHugger Robot
3caa59be1d Merge "Consolidate start new input scenerios" into rvc-dev am: 6c440de7a4 am: 96863d0d50
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12086310

Change-Id: I56f3e063c7117760f260e72d9e7be5afed55b9a7
2020-07-10 19:09:49 +00:00
TreeHugger Robot
a96c3690e9 Merge "Consolidate start new input scenerios" into rvc-dev am: 6c440de7a4 am: 96863d0d50
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12086310

Change-Id: I4fae013253c5f03fd515b09d29125bb120724777
2020-07-10 19:09:37 +00:00
TreeHugger Robot
99d53c60b4 Merge "Consolidate start new input scenerios" into rvc-dev am: 6c440de7a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12086310

Change-Id: Ibdd1c9e4d9c87f8c0127f7df5c9082016bd4fdf1
2020-07-10 18:57:50 +00:00
TreeHugger Robot
6c440de7a4 Merge "Consolidate start new input scenerios" into rvc-dev 2020-07-10 18:42:06 +00:00
Chavi Weingarten
57ad5d9e40 Merge "Reparent bounds layer if surface was replaced." into rvc-dev am: ab3d80c98d am: fa48a156c7 am: 75a12e747c am: 04002dfdc4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12123266

Change-Id: Ic583c118d6b9e7b8aa8498482b39f3f2d3dfbb61
2020-07-10 17:39:29 +00:00
Chavi Weingarten
04002dfdc4 Merge "Reparent bounds layer if surface was replaced." into rvc-dev am: ab3d80c98d am: fa48a156c7 am: 75a12e747c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12123266

Change-Id: Id7a415d1cc24dc9f114402d25a0de2e7dfcdc77e
2020-07-10 17:18:37 +00:00
Chavi Weingarten
75a12e747c Merge "Reparent bounds layer if surface was replaced." into rvc-dev am: ab3d80c98d am: fa48a156c7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12123266

Change-Id: Id12f0265c89d98977fd7720c09c9acae129ba7e2
2020-07-10 17:09:06 +00:00
Chavi Weingarten
f3f9ce3148 Merge "Reparent bounds layer if surface was replaced." into rvc-dev am: ab3d80c98d am: fa48a156c7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12123266

Change-Id: I0aa1aef2e9e0b54034d2dee8e44d4115bb4e5ee2
2020-07-10 17:08:58 +00:00
Chavi Weingarten
2b66979876 Merge "Reparent bounds layer if surface was replaced." into rvc-dev am: ab3d80c98d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12123266

Change-Id: I620278fe572b48c3e1121a6c84a6d876c74c0242
2020-07-10 16:59:25 +00:00
Chavi Weingarten
ab3d80c98d Merge "Reparent bounds layer if surface was replaced." into rvc-dev 2020-07-10 16:49:33 +00:00
Ming-Shin Lu
d43b75cf0e Consolidate start new input scenerios
As CL[1] we introduced WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR start
input reason to ignore start new input when the focused view is
same as current served view and the input connection remains the same for
prevent additonal onStartInput / onFinishInput callback to
InputMethodService.

The main idea in the CL is good but how to judge whether the input connection
remains the same is not accurate.

CL[1] only checking if IMM#mServedInputConnectionWrapper self and its
input connection instance is stil exists, that breaks the following cases
to start new input:

Case 1:
- When device screen off / on to go back to focused app, this case will
  fit WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR use case, so
  IMM#mServedInputConnectionWrapper won't be deactivate and clear, this
  makes wrong when user taps IME picker dialog to switch IME, will hit
  again WINDOW_FOCUS_GAIN_REPORT_WITH_SAME_EDITOR and never start new
  input for new IME.
  Actually, in InputMethodManager has an ad-hoc check mRestartOnNextWindowFocus
  to start new input when device screen off / on case and switching IME,
  we should not ignore start input since that will conflict with the above
  case.

Case 2:
- As served view is now tracked by ImeFocusController which is per-window
  based instance from the IME focus handling refectoring CL[2],
  but InputMethodManager instance is still per-display based, so
  IMM#mCurrentTextBoxAttribute might be changed when the same app clinet has
  multiple IME focusable window focus changed, because focusing to the next
  IME focusable window will start new input connection and changes
  IMM#mCurrentTextBoxAttribute, so when focusing back to the
  original window, the served view in the original window's
  ImeFocusController will same as focused view, in that case if we didn't
  check if IMM#mCurrentTextBoxAttribute is really aligned with the given
  focused view, will mis-judge start new input timing and caused user can't
  type because the input connection state is obsoleted.

Those cases can be addessed by using new introduced method
IMM#isSameEditorAndAcceptingText, if the focused view is not aligned
with same editor or the editor is inactive, we should start new input
for Case 2, that also can fix Case 1 that we previously ignored starting
new input when switching IME.

Beside, we also found CL[3] leverages
InputMethodManager#mRestartOnNextWindowFocus to start new input when window focus
changed, since originally this ad-hoc check is only used to re-start input
for Case 1.
As we re-visited the necessary start new input scenerio is only when:
   - Device screen off -> on
   - Switching IME
   - the input connection obsoleted
     (this also includes when window focus changed)

As the result, we can remove all unnecessary logics in IMMS
instroduced by CL[1] and remove unnecessary
InputMethodManager#mRestartOnNextWindowFocus from CL[3], and preserve
the behavior is almost same as Q.

[1]: I2da99ae67b9ce4051dec0c0f0e975ebe6e1ab118
[2]: Ib455704fe1e9d243f93190a84f230210dbceac2a
[3]: I8d4fff94ba9313b773bc27fcbd019cc88580d3e9

Fix: 160391516
Bug: 158624922
Bug: 152373385

Test: atest FocusHandlingTest
Test: atest InputMethodServiceLifecycleTest
Test: manual for case 1
     0) pre-install 3rd party IME app
     1) launch message app and taps Search bar to focus.
     2) turn off screen
     3) turn on screen to back to focused app
     4) press IME switch icon from nav bar
     5) choose next IME, expect the IME should be changed.
Test: manual for case 2
    0) Sample app with 2 activites, each activity the layout has
       EditText
    1) Launch activity A, focus EditText
    2) Launch activity B and focus EditText
    3) Press back key to back to activity A
    4) Verify if typing with keyboard is workable.

Change-Id: I1ef3d341af9d473d94d52fd1890deafbae2bc9e1
2020-07-11 00:42:17 +08:00
Tiger Huang
2abef46ec0 Merge "Update requested state by comparing with source consumer" into rvc-dev am: 894a797421 am: 8e4707ae80 am: 3516329349 am: 792320dbbd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108428

Change-Id: I97634d083f0faaa3ac507edd0080fddf5287638d
2020-07-10 14:44:01 +00:00
Tiger Huang
792320dbbd Merge "Update requested state by comparing with source consumer" into rvc-dev am: 894a797421 am: 8e4707ae80 am: 3516329349
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108428

Change-Id: Ie9202eef0abe923d3046482a909c31dd51e5de0f
2020-07-10 14:31:25 +00:00
Tiger Huang
86480e3767 Merge "Update requested state by comparing with source consumer" into rvc-dev am: 894a797421 am: 8e4707ae80
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108428

Change-Id: I8b8c9bbfe2e5bfa58ae6f94f57886a6ae4897686
2020-07-10 14:19:56 +00:00
Tiger Huang
3516329349 Merge "Update requested state by comparing with source consumer" into rvc-dev am: 894a797421 am: 8e4707ae80
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108428

Change-Id: I54ea63439c9ccab8e5872243fa6fad8970ea2ef4
2020-07-10 14:19:41 +00:00
Tiger Huang
1568d9181a Merge "Update requested state by comparing with source consumer" into rvc-dev am: 894a797421
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108428

Change-Id: I3013d5d486b468ed7fedcedbc60cfc2bb61c233a
2020-07-10 14:03:50 +00:00
Tiger Huang
894a797421 Merge "Update requested state by comparing with source consumer" into rvc-dev 2020-07-10 13:51:37 +00:00
Tiger Huang
ff06666dba Update requested state by comparing with source consumer
If the local state and mLastDispatchedState are the same, the logic in
onStateChanged will skip updating the requested state. This could be an
issue, for example, a new focused window requested to hide status bar,
but status bar has already been hidden by the previous focused window,
so the new focused window will never send the requested state to server.
This can easily happen when an immersive activity is re-created due to
the configuration change.

This CL updates the requested state if any visibility within it is not
the same as the requested visibility of the source consumer, while
receiving controls.

Fix: 160854328
Test: atest InsetsControllerTest
Test: Swipe to show transient bars after rotating an immersive activity
Change-Id: I5d9acb1b59252fa80e66070db86b2555764588da
2020-07-10 18:04:57 +08:00
chaviw
c1dcac9568 Reparent bounds layer if surface was replaced.
In a normal case, the app will get either a visibility changed to
false or stopped from system server to indicate that the content
should be cleaned up. In those cases, it will request a relayout
to WM, which will notify VRI that the surface is gone. Since the
VRI surface is removed, the SV and bounds layer will get notified
that they should be destroyed. On the next relayout, the VRI will
get a new surface and notify SV and the bounds layer to create
new surfaces.

The scenario in the bug happens when VRI receives a visibility change to
false, but doesn't process the information fast enough. By the time it
calls relayout, WMS is in the state where the client is visible again. This
time the relayout will return a valid surface so the SV and bounds layer
will not get cleaned up. The reason this causes issues is VRI now has a
new main surface. The bounds layer is parented to the old layer that's been
deleted so it's not parented to anything. The SurfaceView is a child of
the bounds layer so it also renders offscreen.

The reparent needs to be done on the client side since WMS won't
reparent the children to the new surface if it thinks the app is
closing. WMS gets the signal that the app is stopping, but on the client
side, it doesn't get stopped since it's restarted quick enough. WMS
doesn't want to keep around old children since they will leak when the
client creates new children.

This change will reparent the bounds layer to the new VRI surface. It's
possible WMS will take care of this in certain cases where the app
isn't stopped. But for those cases, the reparent will not have
any effect since the bounds layer will be correctly parented.

Fixes: 159545768
Test: Can no longer repro black SV in maps
Test: Test app with SV and delay in onPause no longer has the same issue
Change-Id: I616652e1cc4380ebbcb386586d8d5889fcc19497
2020-07-10 00:32:46 +00:00
Adrian Roos
c9f51fe239 Merge "Fix IME flicker: move hiding the surface into the control target" into rvc-dev am: 895a2e626a am: 2f07569650 am: 2b8b39ec24 am: 679ed2e0cc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12070682

Change-Id: Idfed2355c5072990709623fcacd96e5a2d56c001
2020-07-09 17:54:27 +00:00
Adrian Roos
679ed2e0cc Merge "Fix IME flicker: move hiding the surface into the control target" into rvc-dev am: 895a2e626a am: 2f07569650 am: 2b8b39ec24
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12070682

Change-Id: Ia20c30a8b9b0f7e61488c56d9e5fffeb53bc73e9
2020-07-09 17:33:44 +00:00
Adrian Roos
fd3f3b955d Merge "Fix IME flicker: move hiding the surface into the control target" into rvc-dev am: 895a2e626a am: 2f07569650
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12070682

Change-Id: I462a4d86ef4ca9c46ec344336c830f3105d96ccc
2020-07-09 17:24:39 +00:00
Adrian Roos
2b8b39ec24 Merge "Fix IME flicker: move hiding the surface into the control target" into rvc-dev am: 895a2e626a am: 2f07569650
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12070682

Change-Id: Id91802e75d496b824c22d53bb2ee86868cb80d79
2020-07-09 17:24:23 +00:00
TreeHugger Robot
2626853ac2 Merge "ViewRootImpl: Call surface destroy callback after layout pass" into rvc-dev am: 276abcb6b3 am: 15f0a2590a am: 5a08944e47 am: 88dd62af5a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108557

Change-Id: I53da1cca48329a17ea58df318ec407f2899449bf
2020-07-09 17:19:15 +00:00
Adrian Roos
4ffd88f7a3 Merge "Fix IME flicker: move hiding the surface into the control target" into rvc-dev am: 895a2e626a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12070682

Change-Id: I2d7c590f30beb36c397231d55cd98fabee4f3597
2020-07-09 17:12:40 +00:00
TreeHugger Robot
88dd62af5a Merge "ViewRootImpl: Call surface destroy callback after layout pass" into rvc-dev am: 276abcb6b3 am: 15f0a2590a am: 5a08944e47
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108557

Change-Id: I746fd9dafd07400c149b8a15016f9770596f44b6
2020-07-09 17:06:58 +00:00
Adrian Roos
895a2e626a Merge "Fix IME flicker: move hiding the surface into the control target" into rvc-dev 2020-07-09 17:02:15 +00:00
TreeHugger Robot
0238551d6d Merge "ViewRootImpl: Call surface destroy callback after layout pass" into rvc-dev am: 276abcb6b3 am: 15f0a2590a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108557

Change-Id: I346b0ff2ef76aa176d5a1f21cf8e98c29a88049a
2020-07-09 16:55:11 +00:00
TreeHugger Robot
5a08944e47 Merge "ViewRootImpl: Call surface destroy callback after layout pass" into rvc-dev am: 276abcb6b3 am: 15f0a2590a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108557

Change-Id: Ic265cb06ed44886d0e00053418fa38723779ecf3
2020-07-09 16:55:01 +00:00
TreeHugger Robot
f5727d3efd Merge "ViewRootImpl: Call surface destroy callback after layout pass" into rvc-dev am: 276abcb6b3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12108557

Change-Id: I5807484130f8f6921aad17bba5c42b9aa308c03d
2020-07-09 16:44:25 +00:00
TreeHugger Robot
276abcb6b3 Merge "ViewRootImpl: Call surface destroy callback after layout pass" into rvc-dev 2020-07-09 16:32:33 +00:00
Adrian Roos
2260ce4daf Fix IME flicker: move hiding the surface into the control target
Fixes a flicker that occurs during transitions between windows.

This happens for two reasons:

1.) Control is immediately transferred to the new window, and the
    previous window didn't get a chance to play the animation.

    This is addressed by adding logic to keep control on the
    exiting window for the duration of the transition - similar to
    what we do with the target for z-ordering purposes.

2.) Upon the input connection being severed, the InputMethodService
    immediately hides its window, preventing any animations whenever
    the input connection changes

    This is addressed by moving hiding of the surface into the
    controlling windows - where upon receiving control, we now
    trigger removal of the IME surface if we don't show it.

Additionally:

- Now ensures that any requests from the ImeInsetsSourceConsumer
  ensure that they come from the window that is currently served
  by IMM.

- Removes the transparancy clause from isImeTargetFromDisplayContentAndImeSame
  to match the updated IME target computation in DisplayContent in [1].

[1]: Iedd5f7407926167f4891ce9b7e9a79e22751e668

Fixes: 153145997
Fixes: 150902448
Test: atest WindowInsetsAnimationControllerTests
Test: atest DisplayContentTests InsetsSourceConsumerTest
Test: Open app with IME, press HOME button, verify IME smoothly animates away
Test: Open Messages, open a thread, open IME. Click search icon, verify IME opens in the search activity
Change-Id: I4910c2a06cc67b0470477b245fc1de54b75f10f9
2020-07-09 14:46:55 +02:00
Jian-Yang Liu
042623ba3b Merge "Added systemui controller to control system bars." into rvc-qpr-dev am: 32fe6cf1d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12013479

Change-Id: I48e0177ec6f428dcf5a57006d2411437cc720912
2020-07-09 01:45:49 +00:00
Jian-Yang Liu
32fe6cf1d6 Merge "Added systemui controller to control system bars." into rvc-qpr-dev 2020-07-09 01:37:33 +00:00
Jacky Kao
ecdcd93c2f Merge "Sending A11y events when a view becomes invisible." 2020-07-08 23:42:10 +00:00
JianYang Liu
2c403a6526 Added systemui controller to control system bars.
When config_remoteInsetsControllerControlsSystemBars is true,
DisplaySystemBarsController provides its own policy of how system
bars are displayed for specific packages. Currently limited to
only auto versions of Android.

Bug: 149585273
Test: Manual, atest BarControlPolicyTest, atest InsetsPolicyTest,
      atest DisplaySystemBarsControllerTest
Change-Id: Ie6b1cc3e2760cbc9e48d62dfbd8bc3e23ffca20c
Merged-In: Ie6b1cc3e2760cbc9e48d62dfbd8bc3e23ffca20c
2020-07-08 23:06:14 +00:00
JianYang Liu
6d7745e1bc Added systemui controller to control system bars.
When config_remoteInsetsControllerControlsSystemBars is true,
DisplaySystemBarsController provides its own policy of how system
bars are displayed for specific packages. Currently limited to
only auto versions of Android.

Bug: 149585273
Test: Manual, atest BarControlPolicyTest, atest InsetsPolicyTest,
      atest DisplaySystemBarsControllerTest
Change-Id: Ie6b1cc3e2760cbc9e48d62dfbd8bc3e23ffca20c
2020-07-08 20:10:42 +00:00