Commit Graph

19175 Commits

Author SHA1 Message Date
Fiona Campbell
9fc75e8977 Merge changes I36ea0ffc,I1f3797c5,I01aeeedd into tm-qpr-dev am: a01ccaae13 am: 477064e500
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19638897

Change-Id: If73108977792457238cab50ae67ed62e66e89096
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 17:36:07 +00:00
Fiona Campbell
477064e500 Merge changes I36ea0ffc,I1f3797c5,I01aeeedd into tm-qpr-dev am: a01ccaae13
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19638897

Change-Id: I32169097c0b807836bb989f60111cedcd49191b9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 16:11:34 +00:00
Fiona Campbell
a01ccaae13 Merge changes I36ea0ffc,I1f3797c5,I01aeeedd into tm-qpr-dev
* changes:
  Add constraints to window duration scale
  Add constraints to animation duration scales
  Ensure animation scales are within bounds
2022-08-19 14:49:40 +00:00
Joanne Chung
cf488547e4 Merge "Fix system toolbar doesn't use correct theme." into tm-qpr-dev am: 9e263e643d am: 20dbe919b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18800482

Change-Id: Idabdc7d36d30c014d383163a2e01c51fa76bbf9a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 13:51:33 +00:00
Joanne Chung
59c6ae9f4d Merge "Fix translation session id collision bug." into tm-qpr-dev am: ebb357e1c9 am: 1551aae8d7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19423814

Change-Id: I3e422b41f68fc403dd22d9b6da8d677efe5678e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 13:50:48 +00:00
Vishnu Nair
64a5423477 Merge "SurfaceView: Revert SurfaceLock locking changes" into tm-qpr-dev am: 5b518a2a69 am: f40b84db0a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19602637

Change-Id: Icda98649c9fdb764da1a329aaf2d59a60352cbea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 13:27:25 +00:00
Daniel Norman
1e924c4709 Merge "Revert "Limit off-label accessibility access using a new property."" 2022-08-16 23:17:30 +00:00
Taran Singh
b203ed9435 Merge "Few improvements for Companion widget APIs" 2022-08-16 16:22:30 +00:00
Daniel Norman
ff3c059c29 Revert "Limit off-label accessibility access using a new property."
Revert submission 19246592-accessibility-tool-only

Reason for revert: Jank regression b/242267091
Reverted Changes:
I0685e6dd4:CTS tests for the accessibilityDataPrivate propert...
I1c02af88c:Limit off-label accessibility access using a new p...

Change-Id: I701b811fd4fb2634872a759134356736a7e8b7dd
2022-08-16 16:13:28 +00:00
Joanne Chung
20dbe919b1 Merge "Fix system toolbar doesn't use correct theme." into tm-qpr-dev am: 9e263e643d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18800482

Change-Id: Ie4da503e5f569625c807bef1a194764cb5e133fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 13:08:55 +00:00
Joanne Chung
1551aae8d7 Merge "Fix translation session id collision bug." into tm-qpr-dev am: ebb357e1c9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19423814

Change-Id: Iad538b9ee2aef1e58a9b292d8a36f27a7b79191b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 13:07:48 +00:00
Joanne Chung
9e263e643d Merge "Fix system toolbar doesn't use correct theme." into tm-qpr-dev 2022-08-16 10:00:57 +00:00
Joanne Chung
ebb357e1c9 Merge "Fix translation session id collision bug." into tm-qpr-dev 2022-08-16 09:52:18 +00:00
Tiger Huang
f114085baa Merge "Introduce IWindowSession#relayoutAsync" into tm-qpr-dev am: 81ae41092e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19194952

Change-Id: Iec4854d8c93a0e58a588d0483833b99a1ec38455
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 09:04:33 +00:00
Wilson Wu
908c368411 Merge "Refine {SHOW,HIDE}_MY_SOFT_INPUT constants" into tm-qpr-dev am: 08fc972311
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19569434

Change-Id: I4f26a508aa1e2081f4afcdf62ca00dc1d0a1949c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 09:01:38 +00:00
Tiger Huang
81ae41092e Merge "Introduce IWindowSession#relayoutAsync" into tm-qpr-dev 2022-08-16 08:44:11 +00:00
Wilson Wu
08fc972311 Merge "Refine {SHOW,HIDE}_MY_SOFT_INPUT constants" into tm-qpr-dev 2022-08-16 08:37:12 +00:00
Tiger Huang
3712433349 Introduce IWindowSession#relayoutAsync
IWindowSession#relayoutAsync is similar to IWindowSession#relayout, but
the former is an oneway method which just sends the layout attributes to
the server. Since the client can compute its own window frame, it just
needs to send attributes to the server without getting blocked for
receving the window frame.

In somes cases, the client still needs to obtain things from the server.
Such as:

- When view visibility is changed. The client maybe not be able to
  receive the latest insets state while it is INVISIBLE or GONE. In this
  case, the client needs to obtain the frame and the insets state. Also,
  the client need to obtain the surface control when it becomes VISIBLE.

- When the insets state is stale but the config is up-to-date. This can
  happen when WindowProcessController sends the new config to the client
  before WindowState does. In this case, the client needs to obtain the
  window frame from the server.

- When the position and the size of the frame are both changed. This
  will trigger a BLAST sync, and the client needs to obtain the sync seq
  ID.

For cases above, the client needs to call the original relayout method.

Bug: 161810301
Bug: 175861051
Test: Seamless rotation, fixed rotation, and regular rotation.
Merged-In: Ifb365789fa08103773fd3180e486ba1d92042fc5
Change-Id: Ifb365789fa08103773fd3180e486ba1d92042fc5
2022-08-16 12:49:31 +08:00
Tiger Huang
885fba406b Merge "Introduce IWindowSession#relayoutAsync" 2022-08-16 03:14:33 +00:00
Taran Singh
e609a5f25a Merge "Don't auto subscribe to CAI for stylus handwriting" 2022-08-16 00:30:13 +00:00
Vishnu Nair
f40b84db0a Merge "SurfaceView: Revert SurfaceLock locking changes" into tm-qpr-dev am: 5b518a2a69
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19602637

Change-Id: I48929e3415143d5aa25178fd1b5870feee5b635b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-15 16:31:13 +00:00
Fiona Campbell
43ca1914b2 Ensure animation scales are within bounds
Ensure that all uses of TRANSITION_ANIMATION_SCALE setting are bounded
between 0 and 20.

Bug: 238178261
Test: adb shell dumpsys window windows | grep "Animation setting"

Change-Id: I01aeeeddcbcdce0824d61db6b8f4a8946595131d
2022-08-15 11:16:33 +00:00
TreeHugger Robot
805dcc2d74 Merge "Fix IME jumpcut when playing user IME animation after IME restarted" 2022-08-14 02:05:42 +00:00
Vishnu Nair
e0b684f7d0 SurfaceView: Revert SurfaceLock locking changes
This reverts commit 9e3cd0533f
and commit 74c760394a.

Initially we made a change to address a performance issue
in SurfaceView caused by holding the mSurfaceLock whenever
we went though the updateSurfaces loop. This had a side
effects of causing an ANR since the locking order changed.

The followup fix removed the lock but broke some API
contracts around lock and unlock canvas.

Subsequent fixes, which never went into QPR, introduced
new issues. Changing the locking order is too risky
QPR so lets revert and try to rework the locking
mechanism in U.

Test: app in b/234006724 does not ANR
Test: app in b/235188096 does not crash
Test: app in b/239895124 does not ANR
Test: app in b/239142077 does not crash
Test: atest SurfaceViewTest

Bug: 235188096
Change-Id: I99c5bb707ecad7c8d3c1fbd8b4105a77d58c145d
2022-08-12 17:35:40 +00:00
Vishnu Nair
e8c5a9273b Merge "Revert "SurfaceView: Ensure the Surface remains valid with SurfaceHolder#lockCanvas"" 2022-08-12 17:15:46 +00:00
Joanne Chung
9325f9b97e Fix system toolbar doesn't use correct theme.
The toolbar should set the theme to the app's theme. Because the
service cannot get the application context, we should pass this
information from application to service.

Bug: 218833400
Test: manual. Use light/dark theme for app, the toolbar shows with
the same theme
Test: atest TextViewIntegrationTest
Test: atest android.widget.TextViewActivityTest

Change-Id: I6d4e4e117c680ce57e760a87987059eded09b2bc
2022-08-12 16:54:34 +00:00
Taran Singh
ec9266d4ac Few improvements for Companion widget APIs
1. reset ViewRootImpl#mLastClickToolType for KeyEvents
2. move EditorInfo#mInitialToolType initialization so we dont
   explicitly hold lock for one line of code.

Bug: 233108064
Test: atest CtsInputMethodTestCases

Change-Id: I76d3c4c14928a2eb4c1cda48dd3b9a866963d06f
2022-08-11 14:27:09 -07:00
Taran Singh
5854c92bad Don't auto subscribe to CAI for stylus handwriting
In [1] & [2] we introduce auto-subscription for editor bounds to IME. However,
it is actually better for IME to do it due to following reasons:
1. Simpler for IMEs do it. Easier state management in IME as to
   what is subscribed.
2. IME can subscribe to CusrosAnchorInfo as early as onStartInput(), which
   delivers required CAI even sooner to IME resulting in faster
   Handwriting startup.
3. We cannot predict what data IME may need. e.g. IME may not
   implement Rich handwriting gestures and hence may not need line
   bounds (Line bounds will be added in near future).

This CL essentially mechanically reverts [1] and a small part of [2]
No user observable behavior change.

[1] I3d6b1728d62139785593af14c24cb52bf2c91e31
[2] Ibba06e9a2533ca91c5cc215dfb18d21c9a74fb73

Fix: 238970465
Bug: 203086136
Bug: 210039666
Bug: 215533103
Test: atest CtsInputMethodTestCases
Change-Id: Ia72a9fe0ceac1798ee1989eaae3906e8e1b696bf
2022-08-11 18:31:42 +00:00
Ming-Shin Lu
8945b5bcfc Fix IME jumpcut when playing user IME animation after IME restarted
There are 2 cases that will seeing IME jumpcut when IME insets animation
is controlled by the app during IME prcocess being killed & restarted:

1) When IME process been killed for some reasons
 (e.g. force-stop package ), during IME restarting,
 DC#computeImeTarget will select the remote insets target as the control
 target and deliver IME leash to WM shell. If the focused window is
 not in multi-windowing mode, it may have a timing that IME surface
 may unexpectedly shown when starting insets animation from the remote.

2) Previously CL[1] fixed an IME surface visiblity issue when enabling
 shell-transition that related to somehow IME insets source visibility
 out of sync with the actual IME surface visiblity. The CL fix is
 setting IME surface alpha value according to the requested visiblity in
 InsetsSourceConsumer#setControl as a workaround. However, this may
 cause a side-effect that after IME restarted and leash updated,
 when the app requests showing IME animation, system calls setControl to
 the client to set the same leash after IME onPostLayout, then
 applyRequestedVisibilityToControl will be called before the
 insets controller calls setInsetsAndAlpha for the animation, if the
 IME requested visibility has visible, IME jumpcut will happen.

To fix this issue:
For 1), returning null control target in DC#computeImeTarget for
the above special case.

For 2), with CL[2] can fully fixed IME visiblity issue by letting the
client know the initial visibility of an InsetsSourceControl and
correctly animate insets when delivering the new leash or the
visibility change of the InsetsSourceControl. for delivering same
leash to request animation case, adding a check to call
applyRequestedVisibilityToControl only when there is no running
animation.

[1]: Iaacdf5f57e68b928e2a19036cbd8a137cf320497
[2]: I2c02e97e191ebd83238c0c54908e861d200d4c8d

Fix: 239808087
Bug: 209064170

Test: atest DisplayContentTests InsetsSourceConsumerTest
Test: manual test steps in b/239808087#comment2
Test: manual test as steps in b/209064170
   0) Enabling shell-transition
   1) Launching camera app
   2) Swiping camera app to launcher
   3) Verify status bar appear animation works

Change-Id: I242517a9214b36049d94e89d1ee63ffe505b91ac
2022-08-12 01:51:10 +08:00
Daniel Norman
f003dd10b2 Merge "Limit off-label accessibility access using a new property." 2022-08-11 17:04:57 +00:00
Riddle Hsu
f3e41e9a7d Merge "Detect layout change of paramsForRotation precisely" into tm-qpr-dev am: 62b637a788 am: 68bbbd9d9b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19559829

Change-Id: I1ed543f266f4d9cc9dbd141442dfb82870f0414e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 13:14:06 +00:00
Riddle Hsu
68bbbd9d9b Merge "Detect layout change of paramsForRotation precisely" into tm-qpr-dev am: 62b637a788
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19559829

Change-Id: I6c686bdd60cdb28d5d50bd6eece40dbbe4477202
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-11 12:08:33 +00:00
Riddle Hsu
62b637a788 Merge "Detect layout change of paramsForRotation precisely" into tm-qpr-dev 2022-08-11 11:43:13 +00:00
Wilson Wu
c4036e74a5 Merge "Improve InputMethodManager documentation" 2022-08-11 05:38:44 +00:00
Mihir Patel
9064a4ef80 Merge "Reporting the Autofill IDs and Positions of active views in list view" into tm-qpr-dev am: 25192d7d0c am: f333fa0c93
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19054708

Change-Id: I2cbfe0cea3466bf0da1119ee9de1e52152ce6694
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 18:07:43 +00:00
Mihir Patel
f333fa0c93 Merge "Reporting the Autofill IDs and Positions of active views in list view" into tm-qpr-dev am: 25192d7d0c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19054708

Change-Id: I6b8ffade431d057334147ae9cd5386afbad13cbc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 17:41:15 +00:00
Mihir Patel
25192d7d0c Merge "Reporting the Autofill IDs and Positions of active views in list view" into tm-qpr-dev 2022-08-10 16:35:13 +00:00
Winson Chung
805819c467 Merge "Add some client side logging for interrupted draws to the dump" into tm-qpr-dev am: 5f7ead346d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19533074

Change-Id: I59a509a87399d36612c518648a4288d8e3ad7882
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-10 16:12:16 +00:00
Winson Chung
5f7ead346d Merge "Add some client side logging for interrupted draws to the dump" into tm-qpr-dev 2022-08-10 15:56:12 +00:00
Tiger Huang
355c6ed16b Introduce IWindowSession#relayoutAsync
IWindowSession#relayoutAsync is similar to IWindowSession#relayout, but
the former is an oneway method which just sends the layout attributes to
the server. Since the client can compute its own window frame, it just
needs to send attributes to the server without getting blocked for
receving the window frame.

In somes cases, the client still needs to obtain things from the server.
Such as:

- When view visibility is changed. The client maybe not be able to
  receive the latest insets state while it is INVISIBLE or GONE. In this
  case, the client needs to obtain the frame and the insets state. Also,
  the client need to obtain the surface control when it becomes VISIBLE.

- When the insets state is stale but the config is up-to-date. This can
  happen when WindowProcessController sends the new config to the client
  before WindowState does. In this case, the client needs to obtain the
  window frame from the server.

- When the position and the size of the frame are both changed. This
  will trigger a BLAST sync, and the client needs to obtain the sync seq
  ID.

For cases above, the client needs to call the original relayout method.

Bug: 161810301
Bug: 175861051
Test: Seamless rotation, fixed rotation, and regular rotation.
Change-Id: Ifb365789fa08103773fd3180e486ba1d92042fc5
2022-08-10 19:54:39 +08:00
Wilson Wu
2ac25627d8 Refine {SHOW,HIDE}_MY_SOFT_INPUT constants
Naming of SoftInputShowHideReason#{SHOW,HIDE}_MY_SOFT_INPUT
constants may not clear enough to indicate its semantics.

Improve show/hide reasons of InputMethodService by:

-. Update constants naming to {SHOW,HIDE}_SOFT_INPUT_FROM_IME.
-. Introduce respective reasons to indicate different hide request
   cases within IME process.

Bug: 224565148
Bug: 241890033
Test: presubmit
Test: atest CtsInputMethodTestCases and observe logs
Change-Id: I8b148e9b5ab05ff7b827c6b8fe23008ca30a8c4b
Merged-In: I8b148e9b5ab05ff7b827c6b8fe23008ca30a8c4b
2022-08-10 11:51:59 +08:00
Mihir Patel
a6e0f74c90 Reporting the Autofill IDs and Positions of active views in list view
Test: atest CtsContentCaptureServiceTestCases, observed events reported only once on scroll and stop as well as on fling
Bug: 211899037
Change-Id: Id67fcc360bf63fcab1d9f345c31d2bf7b9a173d6
2022-08-09 15:37:50 -07:00
Winson Chung
32e2b596d2 Add some client side logging for interrupted draws to the dump
In particular, these are to try and narrow down why the app window isn't
drawing in b/235463625 where the draw state for launcher is stuck in
DRAW_PENDING.

- mLastReportNextDrawReason: the reason the last draw was requested,
  maybe useful in telling if wm is not requesting a draw if not set
- mLastPerformTraversalsSkipDrawReason: the reason perform traversals
  returned without drawing (includes wm/predraw cancel reasons)
- mLastPerformDrawSkippedReason: the reason perform draw returned
  without drawing
- mLocalSyncState: extra logging to confirm that the last sync actually
  completes

Bug: 235463625
Test: dumpsys -T 60000 activity -v all
Test: dumpsys activity activities
Change-Id: I10118470fe62075920e9ce29fe449b0cfc8570c9
Merged-In: I10118470fe62075920e9ce29fe449b0cfc8570c9
2022-08-09 21:08:32 +00:00
Winson Chung
21e626ea2a Merge "Add some client side logging for interrupted draws to the dump" 2022-08-09 21:08:12 +00:00
Huihong Luo
b39957d4ee Merge "Remove getPrimaryPhysicalDisplayId" 2022-08-09 18:08:37 +00:00
Ats Jenk
616e08c4b4 Update flag constant for caption on shell am: 4f279bac32 am: 750da6f903
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19531018

Change-Id: I4935df6ee55ce73feded58bead8ad02c2150c7a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-09 02:29:42 +00:00
Ats Jenk
750da6f903 Update flag constant for caption on shell am: 4f279bac32
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19531018

Change-Id: I7b514f50299f625f04d9b798e61daeefd78fa264
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-09 02:02:32 +00:00
TreeHugger Robot
3c6d6b5232 Merge changes from topic "desktop-windowing-flags" into tm-qpr-dev
* changes:
  SysUI flags to support desktop windowing proto
  Update flag constant for caption on shell
2022-08-09 01:44:18 +00:00
Riddle Hsu
e59483dc1c Detect layout change of paramsForRotation precisely
WindowManager.LayoutParams doesn't override equals(). It returns
false if the instances are different. So after writing/reading
from parcel, even if the fields are identical, the comparison
of Arrays.equals(paramsForRotation, o.paramsForRotation) always
returns false.

This is the first step as a signal to decide whether the screen
configuration needs to be recomputed according to if there is a
layout change from decor windows.

Bug: 238399969
Test: atest FrameworksCoreTests:android.view.WindowParamsTest

Change-Id: I82582ff48064bbf009403d2c0980a69157860f90
2022-08-08 23:06:28 +08:00
Winson Chung
8564942f36 Add some client side logging for interrupted draws to the dump
In particular, these are to try and narrow down why the app window isn't
drawing in b/235463625 where the draw state for launcher is stuck in
DRAW_PENDING.

- mLastReportNextDrawReason: the reason the last draw was requested,
  maybe useful in telling if wm is not requesting a draw if not set
- mLastPerformTraversalsSkipDrawReason: the reason perform traversals
  returned without drawing (includes wm/predraw cancel reasons)
- mLastPerformDrawSkippedReason: the reason perform draw returned
  without drawing
- mLocalSyncState: extra logging to confirm that the last sync actually
  completes

Bug: 235463625
Test: dumpsys -T 60000 activity -v all
Test: dumpsys activity activities
Change-Id: I10118470fe62075920e9ce29fe449b0cfc8570c9
2022-08-05 20:58:44 +00:00