Commit Graph

16766 Commits

Author SHA1 Message Date
Rob Carr
5f28230d34 Merge "ViewRootImpl: Fix issue with early draw report in seamless rotation" into sc-dev 2021-07-09 02:28:27 +00:00
Robert Carr
a93fcc9e33 ViewRootImpl: Fix issue with early draw report in seamless rotation
When we receive RELAYOUT_RES_BLAST_SYNC from the WindowManager, we
trigger reportNextDraw, incrementing the pending draw count by one.
At the moment we unfortunately do this after dispatching callbacks
to SurfaceView. In the span of these callbacks, SurfaceView may
increment and decrement pending draw count, once it reaches zero
we will notify the WM of draw early, terminating the sync operation
without ever waiting for the ViewRootImpl to draw. By processing
RELAYOUT_RES_BLAST_SYNC before emitting the SurfaceView callbacks
we can avoid this issue.

Bug: 191921061
Test: Existing tests pass
Change-Id: I2f1096c9cdc79b89413c3f0bfd9b3054ef45f2d2
2021-07-08 13:23:33 -07:00
Vishnu Nair
07576112d9 Merge "SurfaceControl: Query native object for transform hint" into sc-dev 2021-07-08 15:45:31 +00:00
John Reck
b7039c6aa5 Reduce number of weakrefs per frame
Disable end-to-end input latency metric to reduce the
number of JNI WeakGlobalRef acquires per-frame.

Bug: 189738006
Test: Observe trace section no longer appears in calculator
Change-Id: I062dad8e7cec93cca5599e51d2b0b1a1b6e39a07
2021-07-07 19:18:34 -04:00
Yinglei Wang
69d877992b Merge "Allow app usage of AccessibilityInteractionClient#getInstance and clearCache before T" into sc-dev 2021-07-02 21:21:33 +00:00
Vishnu Nair
f4cc95956c SurfaceControl: Query native object for transform hint
When a new SurfaceControl was created, the java object's transform
hint was not updated. This created a mismatch between the java and
native objects resulting in the client getting an incorrect transform
hint. Fix this by making the native object the source of truth for
transform hints.

Test: in landscape mode, dismiss apps and check launcher does not reject buffers
Bug: 191841127

Change-Id: Icc87b8cf8158eedb87eea886392a0460a76c6443
2021-07-02 13:08:33 -07:00
Mark Renouf
2fe11f121d Merge "Revert "Revert "Fix mPositionInWindow to not use global coords""" into sc-dev 2021-07-02 18:54:07 +00:00
yingleiw
81f366110d Allow app usage of AccessibilityInteractionClient#getInstance and clearCache before T
These are needed to have a workaround fix for a11y cache filled with
stale data before android T.

NoNonSdkCheck: set maxTargetSdk to S in UnsupportedAppUsage is not allowed yet.

Bug: b/192110374

Test: it builds fine.
Change-Id: Iaa0f68b2b8e4702f6b638cb3060714a22850af7e
2021-07-02 16:58:59 +00:00
TreeHugger Robot
4e944d4634 Merge "Switch back to sync IInputMethodManager" into sc-dev 2021-07-02 15:22:21 +00:00
Yohei Yukawa
9dde701446 Switch back to sync IInputMethodManager
This CL logically reverts recent CLs [1][2][3][4][5][6][7][8][9] to
switch back to the previous sync IPC approach in IInputMethodManager
except for the following two IPCs.

 * reportPerceptibleAsync
 * removeImeSurfaceFromWindowAsync

Reason for revert:
We need more time to understand its performance implications.

 [1]: If4b40244a2e0e3b11c38c1da9340ba8e5166ad64
      b9590fa1e1
 [2]: If79e063641a01b325c63eb9f871f5b992d7c0b72
      5a5648dcb5
 [3]: I1547b98b2aacf764e33aadc9ab784f2013f58f2f
      d833f0dab4
 [4]: I646ef4ae0570aae1812ea267f309441fdec6938d
      38fd020616
 [5]: Iaa63e01453da4ff0e3f446eac036b3be3180cb73
      4a820ccc41
 [6]: Id516fd1c961f43ac3e139c88d7ed004c188d458b
      0a32fd21ef
 [7]: Icb396ae5d74060af69c4ecb16723b2e37b9f2067
      c4663ba6a9
 [8]: I3eafbc28ed3acf3ba859885bf201cb06b3149b94
      f226a79fee
 [9]: Ic584203c1221fbae17f5e2d8f09e3992df061646
      5e2d9f271d

Bug: 163453493
Bug: 174892351
Fix: 190486491
Test: atest CtsInputMethodTestCases
Change-Id: If16ac0de536d9089eb04f6e07b1ee47378124658
Merged-In: If16ac0de536d9089eb04f6e07b1ee47378124658
2021-07-02 07:06:07 +00:00
Joanne Chung
3d088cbb09 Merge "Fix translation reference gone problem." into sc-dev 2021-07-02 03:58:36 +00:00
Joanne Chung
844cc85ddf Fix translation reference gone problem.
1. We save Translator WeakReference in ServiceBinderReceiver.
It has a chance the reference is gone even the session is still
alive. Save Translator instead of WeakReference.
2. Fix not access TranslationManager mTranslators, mTranslatorIds in
the lock.
3. Fix protential NPE of resultData access in ServiceBinderReceiver.

Bug: 192205945
Test: manual. The function works.
Test: atest CtsTranslationTestCases

Change-Id: I158901db4bbcd76203c705ab2a34f1e0b37c7565
2021-07-02 10:12:32 +08:00
Joanne Chung
559b8dd078 Merge "Disable log default dumps in debug ROM" into sc-dev 2021-07-02 00:10:57 +00:00
Adam He
c254f87c57 Merge "Remove activity name from autofill metrics logger." into sc-dev 2021-07-01 18:38:06 +00:00
Ady Abraham
ac57d157da Merge "Add preferredMinDisplayRefreshRate" into sc-dev 2021-07-01 17:58:23 +00:00
Mark Renouf
5f1b817783 Revert "Revert "Fix mPositionInWindow to not use global coords""
This reverts commit f3cda71966.

Reason for revert: Rolling forward with updated test.

Fix is in CTS test:
https://googleplex-android-review.git.corp.google.com/q/topic:screenshot_cts

Bug: 191877447
Change-Id: I058951ce761dc22e8cd1f684ea3f2a98fcf8a8eb
2021-07-01 14:43:49 +00:00
Joanne Chung
d78977a7aa Merge "Notify onFinished when activity is destroyed." into sc-dev 2021-07-01 13:29:21 +00:00
Joanne Chung
bb612abccd Notify onFinished when activity is destroyed.
Bug: 184901144
Test: manual
Test: atest UiTranslationManagerTest

Change-Id: Ife6883b6e4b84ad3994b83683b9dfe3af6df91af
2021-07-01 13:14:54 +08:00
TreeHugger Robot
24b5ca6b4b Merge "Add FLAG_IS_ACCESSIBILITY_EVENT to KeyEvent and MotionEvent" into sc-dev 2021-07-01 03:37:28 +00:00
Siarhei Vishniakou
b42785efdf Add FLAG_IS_ACCESSIBILITY_EVENT to KeyEvent and MotionEvent
This flag indicates that the event was modified or generated by an
accessibility service.
It allows apps to tell apart real hardware events, events that are
injected (device id == -1), and events coming from accessibility (has
flag is_accessibility_event).

Events that have gone into accessibility, and got reinjected without
being modified will not be distinguishable from real hardware events.

In the next release, we will make FLAG_IS_ACCESSIBILITY_EVENT public
api. Until then, applications will have to hard-code its value (0x800)
to use it. The value is the same for both KeyEvents and MotionEvents for
convenience.

Bug: 175069843
Bug: 152399927
Test: atest VerifiedMotionEventTest VerifiedKeyEventTest
Test: atest AccessibilityGestureDispatchTest
Test: atest inputflinger_tests libinput_tests GamepadWithAccessibilityTest
Change-Id: I38ac2ab8e19e32cad927742c623f14f43ea0c588
2021-06-30 21:07:38 +00:00
Huihong Luo
eb93107b57 Add a sys prop to control WebView Overlays support
The boolean system property is named as "debug.hwui.webview_overlays_enabled"

Bug: 192267127
Test: change the property value, check presence of Webview Surface
Control

Change-Id: I01e3e26282a5fa79aa504a6e49c5abe1a1c3ea02
2021-06-30 11:47:21 -07:00
Ady Abraham
540012bf1e Add preferredMinDisplayRefreshRate
Add a new private window attribute for allowing apps to specify the min
display refresh rate in addition to the existing
preferredMaxDisplayRefreshRate. This is useful for use cases such as
keyguard where the refresh rate should be limited to a single value,
and using preferredDisplayModeId would not lock the display
refresh rate, as frame rate override might be enabled.

Test: atest RefreshRatePolicyTest FrameRateSelectionPriorityTests DisplayModeDirectorTest
Bug: 183226498
Bug: 184176119
Change-Id: I343569b3cbccd73001703dca78f0f99e196a4d52
2021-06-30 11:32:26 -04:00
TreeHugger Robot
3a4b5e0817 Merge "Flush Content Capture context updated event immediately" into sc-dev 2021-06-30 00:49:26 +00:00
Adam He
4ed8a9b1c6 Remove activity name from autofill metrics logger.
Bug: 192370727
Test: atest CtsAutoFillServiceTestCases
Change-Id: I88765d5ef92ed9fb03bc5c3c161ddad22e297fd6
2021-06-29 15:52:34 -07:00
Ady Abraham
8dff5292c5 Merge "WM: add missing plumbing for preferredMaxDisplayRefreshRate" into sc-dev 2021-06-29 17:19:49 +00:00
Ady Abraham
6b3ab574d8 WM: add missing plumbing for preferredMaxDisplayRefreshRate
Bug: 183226498
Bug: 192354367
Test: wmtests
Change-Id: I0fc43ff3820a173980cfd689020127548319e559
2021-06-29 15:51:40 +00:00
Joanne Chung
bec597e4cc Disable log default dumps in debug ROM
We enable the logs dump in debug rom, we should only dump logs when
the debug flag is on.

Bug: 182433547
Test: Make sure the flag is disable after test and enable during test.

Change-Id: I0a719ee9c545b4e66f3414d7f57f3d959004071e
2021-06-29 18:09:03 +08:00
Paul Hobbs
0a0f6b352f Merge "Revert "Fix mPositionInWindow to not use global coords"" into sc-dev 2021-06-29 00:24:40 +00:00
Paul Hobbs
f3cda71966 Revert "Fix mPositionInWindow to not use global coords"
This reverts commit 03e826d6b1.

Reason for revert: Breaks testPositionInWindow (b/191838493)

Change-Id: Ib49f65b4d3f7f5df7c95a3c229ab08aa8688f7a2
2021-06-28 23:32:22 +00:00
TreeHugger Robot
bd661f629e Merge "Adding verbose check on handleSendEvent logs to avoid spamming logcat" into sc-dev 2021-06-25 08:01:42 +00:00
Alex Mang
5a32c88649 Adding verbose check on handleSendEvent logs to avoid spamming logcat
Test: N/A
Bug: 190239442
Bug: 191684350
Change-Id: I6059b1daa3fa0447d6ed6640490fc9129b4fc932
2021-06-24 20:18:49 -07:00
Huihong Luo
4df4151bc0 Fix a crash caused by transaction
A native transaction passed from webview is sent back to native side, so java side does not manage the life cycle of the transaction.

Bug: 191414767
Test: Play a video, switch to another app, wait for 10 seconds
Change-Id: I013052c202b445438d6cb6497f5f9a2fc22a2b85
2021-06-24 11:10:06 -07:00
TYM Tsai
7cce975afe Flush Content Capture context updated event immediately
Since setLocusContext() usually manually set/reset by developer to update
the app state, it makes sense to trigger a flushing to deliver the
update events immediately.

Bug: 191169236
Test: manual, check the events flush immediately
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I0c367ec083b96d60600ca375c2d70c53224e9b62
2021-06-25 01:40:52 +08:00
Tiger Huang
ef1bb2c9fa Merge "Release leashes of insets controls if they are not needed" into sc-dev 2021-06-24 15:11:04 +00:00
Tiger Huang
c7746aa3de Release leashes of insets controls if they are not needed
Previously, leashes would be only released by GC in some cases, but the
timing could be late. This CL proactively release them as long as they
are not needed. The cases were:

1. The leashes in DisplayImeController. It didn't release leashes while
   receiving a new one.

2. The leashes returned from addWindow/relayoutWindow. The leashes would
   be copied to prevent others from releasing them before writeToParcel.
   The copied leashes could be redundant after writeToParcel.

3. The leashes held by the client whose window is removed. If a window
   is removed, the server won't invoke mClient.insetsControlChanged, so
   the client would never get notified about losing control to release
   the leashes. This could happen if the window doesn't have an exiting
   animation.

Fix: 175851610
Test: Steps in the bug.
Test: Show and dismiss a dialog which doesn't have FLAG_ALT_FOCUSABLE_IM
      or any window animation. Repeat this thousands of times. And see
      if there are many insets leashes as offscreen layers in `dumpsys
      SurfaceFlinger`
Change-Id: I5eb774ac071154a8d7205dbd1ab4a5f8eca215c3
2021-06-24 09:42:32 +00:00
Joanne Chung
8b95d38fa4 Merge "Bug fix: Move the implementation out from View.onTranslationResponse." into sc-dev 2021-06-24 02:08:40 +00:00
Lucas Dupin
26308cd40f Merge "Disable blurs when in battery saver" into sc-dev 2021-06-23 18:40:42 +00:00
Ahaan Ugale
5d42257561 Merge changes from topics "cc-composing-update", "cc-merge-equals" into sc-dev
* changes:
  ContentCapture: Don't ignore events with changed composing/selection span
  ContentCapture: Notify when Composing region changes.
2021-06-23 05:05:19 +00:00
Lucas Dupin
b5a1455663 Disable blurs when in battery saver
Test: manual
Test: atest NotificationShadeDepthControllerTest
Fixes: 191814337
Change-Id: If751578550b3397d659d3f9f97f6ee4573389a6c
2021-06-22 16:45:35 -07:00
Matt Casey
184c61395e Merge "Fix mPositionInWindow to not use global coords" into sc-dev 2021-06-22 12:44:33 +00:00
Adrian Roos
e53e6f5c10 Merge "Insets Animations: Always dispatch onEnd when cancelled" into sc-dev 2021-06-22 10:29:08 +00:00
Arthur Hung
4c74c4e33f Merge "Update transform hint from relayout window (1/2)" into sc-dev 2021-06-22 03:27:26 +00:00
TreeHugger Robot
e4724a8e8f Merge "Added a hidden modelState to indicate model was deleted from device but available still." into sc-dev 2021-06-21 23:19:26 +00:00
Adam He
8b25ff8c9f Added a hidden modelState to indicate model was deleted from device but available
still.

Bug: 191518728
Test: atest CtsTranslationTestCases
Change-Id: I16ee0c2514052f9a8d6589646098c043d67a6703
2021-06-21 13:25:20 -07:00
Adrian Roos
29721a1319 Insets Animations: Always dispatch onEnd when cancelled
Previously, we only dispatched onEnd if onStart was already dispatched. However,
some animations might get cancelled after onPrepare but before onStart. In that
case, it is rather tricky for apps to actually cancel the animation.

Now we always dispatch onEnd if onPrepare has been dispatched already.

Fixes: 177983907
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I3fa142110bd5593679f87561c138ed3318034fca
2021-06-21 21:34:51 +02:00
Ahaan Ugale
01315b1089 ContentCapture: Don't ignore events with changed composing/selection span
Currently, if the view has a TEXT_CHANGED event in the buffer with the
same text, the new event is ignored, even if the Composing or Selection
span is changed.

Bug: 184311217
Test: manual - move cursor quickly and check flushed event
Test: atest android.contentcaptureservice.cts.LoginActivityTest
Change-Id: I4de28576b138225f4e64ed93bcb0b9dd3ed0095c
2021-06-21 14:51:57 +00:00
TreeHugger Robot
6ea5a55ac5 Merge "Fix potential null error in clearEvents." into sc-dev 2021-06-21 02:31:00 +00:00
TreeHugger Robot
dc86e26f54 Merge "Removing remaining references of ActivityView in fw/base" into sc-dev 2021-06-19 01:23:12 +00:00
Adam He
e33b1bf4e9 Fix potential null error in clearEvents.
* This is follow up from previous patch to fix an unresolved
comment.

* We're still changing the clearEvents mechanic to not null the list but
actually clear the list of events. We also change when the
flush->clearEvents call happen during the destroy process so it occurs
on the handlerThread when each session does its own cleanup.

Bug: 185162720
Test: atest CtsContentCaptureServiceTestCases
Change-Id: Ide5490903deec8c4bc8aae5dc76b1fadca29dbd0
2021-06-18 14:38:55 -07:00
Matt Casey
03e826d6b1 Fix mPositionInWindow to not use global coords
Got the wrong number when the window isn't at 0,0.

Bug: 183045126
Test: Examined logs to observe the window's insets didn't affect
      position in window.
Change-Id: Id3190a7422a56cbefc64d30a9961674b4822fcc3
2021-06-18 14:16:18 -04:00