Commit Graph

19291 Commits

Author SHA1 Message Date
Xiaowen Lei
f1eee58e12 Merge "Add AppTransition type and remote animation for Dream in occluding Keyguard." 2022-09-09 20:42:05 +00:00
Treehugger Robot
7b03ffc272 Merge "make sure mSurfaceLock.unlock can be executed in unlockCanvasAndPost" am: dcef1fb28a am: e7237b1cfb am: 625d9387a5 am: a1e5845ba5 am: cecb02a175
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2206140

Change-Id: I0f70a7bf51357626a0ff2e0ebbc617be68397ffd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-09 20:06:49 +00:00
Treehugger Robot
cecb02a175 Merge "make sure mSurfaceLock.unlock can be executed in unlockCanvasAndPost" am: dcef1fb28a am: e7237b1cfb am: 625d9387a5 am: a1e5845ba5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2206140

Change-Id: I76d38354459c90f7d932b8f99ad63b4edb5d1ca7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-09 19:37:01 +00:00
Alec Mouri
9f935c2810 Merge "Revert "Support alpha for SurfaceView"" 2022-09-09 19:06:03 +00:00
Yeabkal Wubshit
ab2c164250 Merge "Revert "Conform to 1D VelocityTracker"" 2022-09-09 16:30:16 +00:00
John Reck
09dc5e1e7e Merge "Somewhat improve software drawing" 2022-09-09 13:23:30 +00:00
Sam Dubey
b7977568d0 Revert "Conform to 1D VelocityTracker"
Revert submission 19762050-generic_vt

Reason for revert: b/245842062
Reverted Changes:
I181af7a03:Make VelocityTracker 1D
Ib0be0fc38:Conform to 1D VelocityTracker

Change-Id: Ic669d9988a4807751554e3c57520b33698716fc3
2022-09-09 05:09:34 +00:00
Xiang Wang
9288af93f7 Merge "Scale up the drag drop offsets and surface size" 2022-09-09 00:28:23 +00:00
Prabir Pradhan
3b307a5a26 Merge "Add InputDeviceBatteryListener to InputManager" 2022-09-08 23:51:12 +00:00
Yeabkal Wubshit
77d9c13f08 Merge "Conform to 1D VelocityTracker" 2022-09-08 23:35:04 +00:00
Vaibhav Devmurari
3884f99abe Merge "Add new keycodes to support keyboard backlight up/down/toggle" 2022-09-08 22:48:36 +00:00
Xiang Wang
1e0a4edcc3 Scale up the drag drop offsets and surface size
The surface size and thumbCenterX/Y use app's coordinate space, which
need to be scaled up on the server side.

Bug: b/239478191
Test: atest DragDropTest DragDropCompatTest
Test: am compat enable DOWNSCALED com.android.dragsource
      am compat enable DOWNSCALE_30 com.android.dragsource
Change-Id: Id36caee8aa38885a95f8d237766ac968ef6c8f85
2022-09-08 14:42:54 -07:00
Yeabkal Wubshit
67c8fa68a6 Conform to 1D VelocityTracker
The native VelocityTracker has been refactored to allow support of axes
beyond X and Y axes. To conform to this change, we are updating calls to
the native VelocityTracker. Furthermore, to support independent velocity
tracking for separate axes, we are updating the native/JNI methods
accordingly. With these changes, supporting new axes for velocity
tracking would only require changes at the native VelocityTracker level
only (besides creating a public API for our clients).

Bug: 32830165
Test: android.view.cts.VelocityTrackerTest unaffected; touch fling works

Change-Id: Ib0be0fc38c315ade2475cd53597a846e58016d14
2022-09-08 18:21:39 +00:00
Vaibhav Devmurari
bb12898ad3 Add new keycodes to support keyboard backlight up/down/toggle
Test: None
Bug: 245506418
Change-Id: I54b363cb8ae51e7c828cbc9d9dff1d6eb6050e6f
2022-09-08 16:25:12 +00:00
Samiul Islam
3fde6cee3c Revert "Support alpha for SurfaceView"
Revert submission 19562144-surfaceview-alpha

Reason for revert: Presubmit breakage b/245651921
Reverted Changes:
I7510a3a6c:Add CTS for applying alpha for SurfaceView
Ibc14b18f1:Support alpha for SurfaceView

Change-Id: I498c98951a53e6bb1c1251dceb9d150311b07cc8
2022-09-08 14:15:33 +00:00
TreeHugger Robot
7b1c680e16 Merge "Populate display id in A11yWindowManager" 2022-09-08 08:56:55 +00:00
Hiroki Sato
58b04e9947 Populate display id in A11yWindowManager
When window is removed, there can be a race between a11y and wm,
and sometimes A11yManagerService#sendA11yEvent cannot get a correct
display id.

There's also a case where a11y events for windowless windows don't have
a display id.

This change fixes the issue by populating display id in
A11yWindowManager#DisplayWindowsObserver for windows change events.

Bug: 240888087
Test: AccessibilityWindowManagerTest
Test: CtsAccessibilityServiceTestCases

Change-Id: I441d98e4431913ae24ab354423828d2a031b27b4
2022-09-08 15:11:45 +09:00
TreeHugger Robot
284aecda62 Merge "Move dumpViewInfo from InputMethodManager to InputMethodDebug" 2022-09-08 05:08:49 +00:00
Riddle Hsu
48d11607a9 Merge "Apply override scale from entry points on client" 2022-09-08 03:35:48 +00:00
Alec Mouri
4432aa6283 Merge "Support alpha for SurfaceView" 2022-09-08 00:17:03 +00:00
Prabir Pradhan
e86f73ac50 Add InputDeviceBatteryListener to InputManager
System apps can now register an InputDeviceBatteryListener on a
per-device basis to be notified of battery changes.

- InputManager manages registration of the binder callback with
  InputManagerService to ensure that there is only one battery
  listener per process.
- The battery listener is invoked immediately upon registration
  to provide the initial battery state for the device.
- The callbacks are removed automatically when the process dies.
- This CL does not yet identify changes in battery state for monitored
  devices.

DD: go/inputdevice-battery-notifications

Bug: 243005009
Test: atest FrameworkServicesTests
Test: atest FrameworkCoreTests
Change-Id: Idf2b06a099155a6f5cc13b55dcd40852f54aa56c
2022-09-07 20:42:50 +00:00
Alec Mouri
914e750867 Support alpha for SurfaceView
Basically, this removes an excuse for apps to use TextureView for video
playback or one-off HDR images prior to HDR UI being ready everywhere.

The idea is that for Z-above, applying alpha is easy, because the
surface just needs to be have alpha modulated. Z-below is a little bit
more creative - the alpha is applied to the hole punch and drawn using
DST_OUT blending semantics. This allows for views underneath the
SurfaceView to blend with surface, while being occluded by views on top
of the SurfaceView.

There may need to be some complex view hierarchies that would be useful
to test, but simple view layouts seem to work.

Note that this is guarded with a target SDK check, to defend against
applications that are propagated alpha to child views while expecting
opaque SurfaceViews.

Bug: 241474646
Test: HWAccelerationTest doesn't look broken
Change-Id: Ibc14b18f1ce6f25250318db50275c6b8c972bade
2022-09-07 19:32:23 +00:00
Ming-Shin Lu
9f3c04e5af Move dumpViewInfo from InputMethodManager to InputMethodDebug
This a preperation CL before refactoring ImeFocusController.

To make dumpviewInfo can also be used in other IME related files
like ImeFocusController.

Also, removed unused method InputMethodDebug#objectToString.

This is just a mechanical refactoring and should not have any behavior
change.

Bug: 244504062
Test: build
Change-Id: I9d1a0c2b06e676e40b0e844edb18e8422a67b0ad
2022-09-07 03:33:39 +00:00
Wilson Wu
30e354347e Merge "Improve lock annotation for InputMethodManager (3/N)" 2022-09-07 01:53:37 +00:00
Wilson Wu
b72a652f46 Merge "Improve lock annotation for InputMethodManager (2/N)" 2022-09-07 01:53:00 +00:00
Xiaowen Lei
71223c6e62 Add AppTransition type and remote animation for Dream in occluding Keyguard.
The existing Keyguard Occlude Animation Runner doesn't match the spec
for Dream in. It animates activity expanding from the center of the
screen. For Dream in, we have:
  - Dream fading in
  - DreamOverlay complications fading in slightly delayed, with each part
    starting at different times.

This CL adds dedicated AppTransitionType and remote animation runner,
which animates Dream fading in. It doesn't implement the separate
animation for DreamOverlay complications.

Bug: 222507937
Bug: 240477956
Bug: 242864189
Fix: 240477956
Test: on device, wait for Keyguard to time out to Dream.
Change-Id: I5517ded2eea77ea962ca1551ed51dd997ff09993
2022-09-06 20:24:42 +00:00
Kriti Dang
599595bbfa Merge "Add Surface.clearFrameRate API" 2022-09-06 18:42:05 +00:00
Tiger Huang
8538946846 Merge "Revert "Enable LOCAL_LAYOUT"" into tm-qpr-dev am: 7cacd12b23 am: 86e9871a01
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19822513

Change-Id: I4231b5087bdadcd8dce97ec0ca2f89a034df196f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 15:23:05 +00:00
Tiger Huang
86e9871a01 Merge "Revert "Enable LOCAL_LAYOUT"" into tm-qpr-dev am: 7cacd12b23
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19822513

Change-Id: I3110eb2b67741f06daad32aae29c69579a1aa3ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 14:50:11 +00:00
Tiger Huang
7cacd12b23 Merge "Revert "Enable LOCAL_LAYOUT"" into tm-qpr-dev 2022-09-06 14:26:43 +00:00
Wilson Wu
ee68a1e34c Improve lock annotation for InputMethodManager (3/N)
Add @GuardedBy("mH") annotation for those Locked methods
which should be guarded by mH in InputMethodManager.

Bug: b/236937383
Test: presubmit
Change-Id: I271f78bc54c7cd406d56775aef0db9d6c4084ee0
2022-09-06 19:48:46 +08:00
Wilson Wu
27d4421382 Improve lock annotation for InputMethodManager (2/N)
In CL[1], we added @GuardedBy("mH") annotation for some
fields which should be guarded by mH for lock annotation
improvement.

Annotate more fields we miss in CL[1].

[1]: I3b345da25841b328358d16695e3a29ee65ae8d83

Bug: b/236937383
Test: presubmit
Change-Id: Ibee725dff3ff3d52f5b4d58e8bf2d8837dba665e
2022-09-06 16:08:27 +08:00
Wilson Wu
9552347b1a Merge "Improve lock annotation for InputMethodManager (1/N)" 2022-09-06 03:13:10 +00:00
Wilson Wu
9624ac3129 Improve lock annotation for InputMethodManager (1/N)
In InputMethodManager, we used the "mH" as a lock to
protect some fields and methods for thread safe.

Some of them are already protected with this lock but
they didn't have the annotation yet.

Add the annotation for those fields to prevent unexpected
behavior change and increase the readability.

Bug: b/236937383
Test: presubmit
Change-Id: I3b345da25841b328358d16695e3a29ee65ae8d83
2022-09-06 03:12:15 +00:00
Riddle Hsu
1a3b32ccd5 Merge "Optimize screen decor insets calculation" into tm-qpr-dev am: cc6255bd91 am: 955b79a8b3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19180946

Change-Id: I773d978cf8c1a92e2105be1786f3823bc3ffd0de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 17:08:14 +00:00
Riddle Hsu
955b79a8b3 Merge "Optimize screen decor insets calculation" into tm-qpr-dev am: cc6255bd91
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19180946

Change-Id: I672fa05516f90cb2a4c262598cc5734a377fca79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-05 16:38:34 +00:00
xiaoxin
71e3abfa1e make sure mSurfaceLock.unlock can be executed in unlockCanvasAndPost
When the program is run to unlockCanvasAndPost method,
if mSurface.unlockCanvasAndPost throws an exception,
the mSurfaceLock.unlock() will not getting the chance to execute.

If an app executes unlockCanvasAndPost in a catch and does not handle the exception,
it will remain locked for a long time after the next execution of mSurfacelock.lock.

make sure the msurfacelock.unlock is executed after unlockCanvasAndPost

bug:245050059 in partnerissuetracker

Change-Id: Ib849c840c61ac261cfaab0daefa7ae2afdbfcba3
Signed-off-by: xiaoxin <xiaoxin@xiaomi.corp-partner.google.com>
2022-09-05 09:17:17 +00:00
Riddle Hsu
3ef46b57b9 Optimize screen decor insets calculation
This stores the computed decor insets and frame excluding insets.
So it can save 99% time of recomputing the insets every time during
starting an activity. E.g. dozen times of "prepare display info/frame,
compute window layout of insets source windows, calculate insets"
becomes "get result from array".

The saved decor insets will be updated when:
- Display metrics is changed (DC#updateBaseDisplayMetrics).
- Insets provider is added/removed/changed.

Also
- Use DisplayCutout rather than WmDisplayCutout to simplify
  passing the cutout between methods.
- Optimize getSourceProvider to avoid unnecessary object allocation.

This also fixes an issue that the display doesn't compute the latest
configuration when navigation mode is changed. Now it is fixed by
checking if the insets provider has layout changes and then recompute
screen configuration.

Bug: 238399969
Bug: 159103089
Test: atest DisplayPolicyInsetsTests DisplayPolicyLayoutTests
      DisplayPolicyTests#testUpdateDisplayConfigurationByDecor
Test: Change navigation mode or display size (density) in Settings.
      And then swipe-up or press home key, there won't be a
      frozen effect (display configuration change).

Change-Id: If6c28a89939372e6362b92f469ef7d793e8ec215
2022-09-02 23:29:29 +08:00
Haoyu Zhang
7cf6d0618c Merge "Checking TextOperationUser when initialize stylus handwriting" 2022-09-02 09:05:15 +00:00
Neha Jain
3e52eb1bc6 Revert "Enable LOCAL_LAYOUT"
This reverts commit 1721522709.

Reason for revert: b/244521023

Change-Id: I67df39f4d218ff65cb7a2010b544c3ef158f50cf
2022-09-02 02:50:46 +00:00
Haoyu Zhang
3f655af0b3 Checking TextOperationUser when initialize stylus handwriting
Bug: 237418160
Fix: 244475514
Test: atest HandwritingInitiatorTest
Change-Id: I6c87d034d5bef28383db70f587bdd0ee2db77a79
2022-09-01 18:44:19 -07:00
TreeHugger Robot
5c6a88e404 Merge "Simplify code around mPreviousViewFocusParameters" 2022-09-02 00:13:35 +00:00
Haoyu Zhang
49bd302a80 Merge "Introduce visible line bounds to CursorAnchorInfo" 2022-09-01 18:56:12 +00:00
TreeHugger Robot
6632295826 Merge "Allow ANI#setQueryFromAppProcessEnabled to disable (remove) the connection." 2022-09-01 18:29:49 +00:00
John Reck
e32639616a Somewhat improve software drawing
Fix that adjustPan wasn't working

Bug: 184417683
Test: repro APK
Change-Id: I245b266ab13f3d404553c734e933d8f856fe2619
2022-09-01 14:04:00 -04:00
Haoyu Zhang
4976e19609 Introduce visible line bounds to CursorAnchorInfo
Add visible line bounds to CursorAnchorInfo for IME to improve
scribe rich gesture recognization accuracy.

Bug: 215533103
Bug: 239843501
Test: manually tested
Change-Id: I7039b75388ae34d24feb38d18d8da9a91df89504
2022-09-01 05:07:37 -07:00
Daniel Norman
b40cb68ffb Allow ANI#setQueryFromAppProcessEnabled to disable (remove) the connection.
Bug: 243543412
Test: atest AccessibilityEndToEndTest
Change-Id: Icce9ff7ebf98a32bf6e92b0e9fc84d7bc091678e
2022-08-31 16:48:21 -07:00
Alan Viverette
009ccfbabb Merge "Intercept abnormal MotionEvent in GestureDetector#onTouchEvent" 2022-08-31 18:25:48 +00:00
Riddle Hsu
a0530caa33 Apply override scale from entry points on client
This provides a sandbox-like scaled environment on client side.

- This prevents the metrics and config from being scaled multiple
  times because the entry points are only called from server side,
  there won't have reentrancy for applying the scale.
- App's configuration callback method can get scaled config.
- If override scale is enabled, the legacy compat mode will be
  skipped. That avoids mixing different approaches of scaling.
  - Legacy compat mode is to simulate a 320dp x 480dp screen
    size with density 160 (the surface scale and config scale
    are different).
  - Override scale is to downscale the app for better performance
    (the surface scale and config scale are the same).

Bug: 238416387
Bug: 240335717
Test: atest ActivityThreadTest#testOverrideScale
Test: atest CtsWindowManagerDeviceTestCases:CompatScaleTests
Test: am compat enable DOWNSCALED $pkg
      am compat enable DOWNSCALE_50 $pkg
Change-Id: I0ddf333996f229063511273f8aeb3867c9ba8bda
2022-08-31 17:49:24 +00:00
Chet Haase
49589ed7fe Merge "Fix docs for FrameMetrics.TOTAL_DURATION" 2022-08-31 17:23:42 +00:00