Commit Graph

18345 Commits

Author SHA1 Message Date
TreeHugger Robot
5b22099c1c Merge "Allow rapid request/release of pointer capture" into tm-dev 2022-04-29 16:58:10 +00:00
Leon Scroggins
866f67dc94 Merge "Propagate HDR information to screenshot animation." into tm-dev 2022-04-29 15:16:21 +00:00
Ming-Shin Lu
e6a860a747 Merge changes I96b17c78,If4b09f5b into tm-dev
* changes:
  Make DialogThemedActivity main window is not focusable
  Make IME visiblity stable without unexpected hidden when setControl
2022-04-29 14:19:28 +00:00
Naomi Musgrave
86e40f73a0 Only return ROTATION_0 for WM#getPossibleMaximumWindowMetrics
Do not return every rotation for window metrics.

Bug: 228288352
Test: atest WmTests:PossibleDisplayInfoMapperTests
Change-Id: I756b079bfce09cf618500f3d07547ec94ac60694
2022-04-29 09:02:20 +00:00
Rachel Lee
fa426b9d49 Merge "Remove getLatestVsyncEventData in Choreographer." into tm-dev 2022-04-28 21:29:54 +00:00
Josh Tsuji
50f19f212e Merge changes Iee97d469,Ica1b552a into tm-dev
* changes:
  fadeInSurfaceBehind() when the remote animation starts.
  Clear task snapshot when we showSurfaceBehindKeyguard.
2022-04-28 17:52:10 +00:00
Shawn Lin
8f1320d8a9 Merge "Fixed cts failure of WindowInsetsControllerTests" into tm-dev 2022-04-28 13:11:10 +00:00
shawnlin
6db481e079 Fixed cts failure of WindowInsetsControllerTests
If the device is a tablet, the navigation bar will be taskbar, and it
will draw fake rounded corners above itself when it's shown and
unstashed. When apps request to hide taskbar from such state, it will
cause an extra window insets change from server side.

Move the calculation of rounded corner inset to client side so that we
can make the window insets change come only once.

Bug: 229825307
Test: atest WindowInsetsControllerTests ActivityRecordTests
Change-Id: I081142facbe0fe676b89c8883fa690ba5ae13d79
2022-04-28 17:25:49 +08:00
TreeHugger Robot
1fc50caf0e Merge "Revised API docs of overloaded getGlobalVisibleRect methods and getLocalVisibleRect method. Fixed punctuation of "x and y coordinates" in getLocationOnScreen, getLocationInWindow, and getLocationInSurface." into tm-dev 2022-04-27 23:25:00 +00:00
Alec Mouri
3d03ed3626 Propagate HDR information to screenshot animation.
The screenshot animation must know whether the screenshot contains HDR
layers so that it can correctly inform SurfaceFlinger whether its layer
can be dimmed.

This is due to the interplay of the following:
1. Devices are now able to configure DisplayManager to send
   significantly lower SDR white points relative to display brightness
   to SurfaceFlinger when HDR is simultaneously on-screen.
2. AIDL composer is required to support per-layer dimming, so that SDR
   layers may be dimmed to preserve the relative luminance of HDR video
   content.
3. Because the screenshot does not contain an HDR transfer function,
   SurfaceFlinger will treat the layer as SDR, and attempt to dim it.
4. Screen rotations containing HDR layers must request SurfaceFlinger to
   present the rotated screenshot at display brightness, to override
   (3) above. Otherwise, HDR content captured in the screenshot will
   suddenly dim during the rotation animation.
5. Also due to (3), DisplayManager no longer thinks that there is HDR
   content on screen, so a prior patch treated layers that requested to
   to be dimmed to be reported as HDR
   (I1d1b0dcaf230300ca34b84ea407d0817feb2c664). Otherwise, the display
   brightness will decrease during the animation and ramp back up
   afterwards.
6. But because of (5), screenshots that only contained SDR layers were
   incorrectly treated as HDR, which caused the display brightness to
   ramp up during the animation.

This patch fixes (6) by allowing for the screenshot animation to learn
whether the screenshot contains HDR layers, and request dimming
capabilities accordingly.

Bug: 230068567
Test: screen rotation
Change-Id: I6bbb2433f976e368bfe2c04e084e110cfb551c15
2022-04-27 21:43:48 +00:00
Josh Tsuji
927a236a80 Clear task snapshot when we showSurfaceBehindKeyguard.
To prevent extra blocking calls to ActivityManager,
rather than calling
ActivityManagerWrapper#invalidateHomeTaskSnapshot,
add a transit flag to have ActivityTaskManager
handle this as part of the goingAway call.

Bug: 229890190
Test: atest SystemUITests
Change-Id: Ica1b552a332d0c946d6008965c1a2881b646e365
2022-04-27 16:12:17 -04:00
Ming-Shin Lu
28b9201e18 Make IME visiblity stable without unexpected hidden when setControl
2 reasons that may unexpectly calls hideMySoftInput from IME:

1) When requesting show IME on the activity, before receiving the
   control from server side, the null control might received from the
   relayoutWindow, if initially in consumer side didn't get the control
   yet, we should not hide the IME immediately to broke the on-going
   show request.

2) When ImeInsetsSourceConsumer#onWindowFocusGained, if we don't set
   mIsRequestedVisibleAwaitingControl as true if it has requested IME
   visible but not yet get control, it also could possble mistakenly
   hide IME when ImeInsetsSourceConsumer#setControl.

As the result, we should prevent both case with

1) add returned value for InsetsSourceConsumer#setControl to see whether
   the control has changed from the server, if the control didn't
   change like receiving a duplicated null control callback,
   then in ImeInsetsConsumer didn't have to do anything.
2) set mIsRequestedVisibleAwaitingControl as true when receiving
   onWindowFocusGained and the host is waiting the control to make
   IME visibility reliable.

Bug: 227142436
Bug: 204524304
Test: atest FlickerTests:LaunchAppShowImeAndDialogThemeAppTest
        --rerun-until-failure 10

Change-Id: If4b09f5b52bc96cf3429aaa912961f3ac4e326f2
2022-04-27 15:59:35 +00:00
Rachel Lee
ab7a63680a Remove getLatestVsyncEventData in Choreographer.
Manually "revert" ag/17188552 due to jank caused by
getLatestVsyncEventData as new blocking binder call on the main thread.

Test: manual open and close app to/from home.
Test: perfetto trace
Test: atest ChoreographerTest
Bug: 229987086
Change-Id: Idcab776f3f249cc9fd609a6438e29a50a1edaaf2
2022-04-26 16:26:44 -07:00
Tiger Huang
c15af2cb87 Merge "Don't set animation pending when gaining fake control" into tm-dev 2022-04-26 12:47:42 +00:00
joneckenrode
37f8a92e4d Revised API docs of overloaded getGlobalVisibleRect methods and getLocalVisibleRect method. Fixed punctuation of "x and y coordinates" in getLocationOnScreen, getLocationInWindow, and getLocationInSurface.
Test: Built API docs
Bug: 172571756
Signed-off-by: joneckenrode <joneckenrode@google.com>
Change-Id: I45f21521350accba4227f6d328e53c52ffcce80a
2022-04-26 00:06:01 +00:00
Rachel Lee
c2c8ac85ea Merge "Add check for empty vsync data in Choreographer." into tm-dev 2022-04-25 18:03:56 +00:00
Naomi Musgrave
6d4b050f10 Merge ""Revert "Temporarily exclude Launcher from sandboxing; to be reverted once""" into tm-dev 2022-04-25 14:22:54 +00:00
Jon Eckenrode
d2b8731f93 Merge "Revised API documentation of getLocationOnScreen, getLocationInWindow, and getLocationInSurface to include multiple-screen behavior and remove mentions of "global" coordinate space." into tm-dev 2022-04-25 13:48:48 +00:00
TreeHugger Robot
b49c8b3a3a Merge "Advise use of InputDeviceListener when using pointer capture" into tm-dev 2022-04-25 11:42:16 +00:00
joneckenrode
f71eddec34 Revised API documentation of getLocationOnScreen, getLocationInWindow, and getLocationInSurface to include multiple-screen behavior and remove mentions of "global" coordinate space.
Test: Built API docs
Bug: 172573956
Signed-off-by: joneckenrode <joneckenrode@google.com>
Change-Id: If2200f9daebaa7eb106340bcc5707c20a3df34e6
2022-04-25 10:06:14 +00:00
Rachel Lee
3ac2e435a6 Add check for empty vsync data in Choreographer.
Currently there is a codepath in native DisplayEventDispatcher
introduced by aosp fc690e2a2d1d3cf08d71a02c4ecd14665c0f2039.
It accounts for vsync timeout. Here in java choreographer, we don't want
to divide by zero for logging messages so a check is added. There are no
real logic changes.

Test: atest ChoreographerTest
Bug: 229685140
Change-Id: I80f24abb89b9d961b017aca93340b1b02af6f66c
2022-04-22 14:35:38 -07:00
Sally Yuen
c98812f8f5 Merge "Remove recycling references in A11yNodeInfo" into tm-dev 2022-04-22 16:52:05 +00:00
Alex Johnston
c170d9adf0 Merge "Make screen capture per-device DO and COPE" into tm-dev 2022-04-22 09:29:12 +00:00
Mark Punzalan
ac9ae5d960 Merge changes from topic "b192331240-singleInvoke" into tm-dev
* changes:
  Rename translationActivityUid to translatedAppUid.
  Reduce duplicate UiTranslationStateCallback calls.
2022-04-22 07:01:15 +00:00
Kohsuke Yatoh
eae7ca8165 Do not cleanup IME window if show is requested.
This CL fixes a race condition for IMM#showSoftInput, which surfaces
when it's called during an IME hide animation.
IMM#showSoftInput ends up calling WIC#show asynchronously, but at that
time the running IME hide animation may have already been finished
successfully, and WIC#show may fail to cancel the hide animation
(then the cleanup IMM#notifyImeHidden hides the IME again disruptively).

I think a clean fix is to have IMM#showSoftInput call WIC#show
synchronously. However, this requires a significant refactoring.

As a short term fix, this CL adds a boolean field indicating whether or
not IMM#showSoftInput has been called. If it's called, we skip calling
IMM#notifyImeHidden.

Bug: 221483132
Bug: 225674038
Test: atest InputMethodStressTest
Test: atest CtsInputMethodTestCases
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I36d570630085d0bc34097a2433208601dc9cb0fd
(cherry picked from commit 4c607982ed)
Merged-In: I36d570630085d0bc34097a2433208601dc9cb0fd
2022-04-21 21:34:31 +00:00
Kohsuke Yatoh
4844170377 Notify IMMS synchronously on IME insets hidden.
Currently, IMMS will be notified asynchronously when an IME hide
animation finishes, via message dispatching through IMS
(IMM#notifyImeHidden -> IMS#notifyImeHidden -> IMMS#hideMySoftInput).
This creates a race condition when IMM#showSoftInput or WIC#show is
called around the end of hide animation.

This CL fixes the race condition by synchronously and directly
calling IMMS#hideSoftInput from IMM#notifyImeHidden.

Note that there is still another race condition for IMM#showSoftInput
(not WIC#show) if it's called during an IME hide animation;
IMM#showSoftInput ended up calling WIC#show asynchronously, but at that
time the running IME hide animation may have already been finished
successfully and WIC#show may fail to cancel the hide animation
(then the cleanup IMM#notifyImeHidden hides the IME again disruptively).
I will fix the latter issue in a separate CL.

Bug: 221483132
Bug: 225674038
Test: atest InputMethodStressTest
Test: atest CtsInputMethodTestCases
Test: atest WindowInsetsAnimationControllerTests
Change-Id: I7c71dc5a1d6b61aa79d1666f0e257e6401e4adb2
(cherry picked from commit 9065310f81)
Merged-In: I7c71dc5a1d6b61aa79d1666f0e257e6401e4adb2
2022-04-21 21:34:24 +00:00
Sally
daf03e85c3 Remove recycling references in A11yNodeInfo
Notably eliminate references in RangeInfo and CollectionInfo class
descriptions. We've just deprecated obtain and recycle, so keeping
outdated docs is confusing.

Test: builds
Bug: 229991765
Change-Id: Ia2d7963bf572740052e0da03950398d016a3caa4
2022-04-21 18:06:20 +00:00
Mark Punzalan
94ed570f35 Reduce duplicate UiTranslationStateCallback calls.
We don't invoke methods when translation state doesn't change (e.g.,
for consecutive startTranslation() calls).

Bug: 192331240
Test: atest UiTranslationManagerTest
Change-Id: I96def427b1fcabb7b83cb188c4b1ee017b5882a9
2022-04-21 17:43:42 +00:00
Simranjit Kohli
727ee17577 Merge "[Autofill Crash]: Fix NPE in AutofillManager." into tm-dev 2022-04-21 14:04:00 +00:00
Alex Johnston
af6b08b09a Make screen capture per-device DO and COPE
Test cases:
- DO
  - Verify disabled for entire device
  - Verify still disabled after restart
  - Verify no longer disabled when DO is removed
- COPE
  - parent
     - Verify disabled for entire device
     - Verify still disabled after restart
     - Verify no longer disabled when COPE PO is removed
  - not-parent
     - Verify disabled for user
     - Verify disabled after restart
     - Verify disabled when PO is removed

Bug: 217558483
Test: DevicePolicyManagerTest
      OrgOwnedProfileOwnerTest#testScreenCaptureDisabled
      ScreenCaptureDisabledTest
Change-Id: I977eb18619da46e1cfc5d0a8d351ea80d3ea7205
2022-04-21 13:29:42 +01:00
TYM Tsai
2ab23eed06 Merge "Auto append password hint for TextView" into tm-dev 2022-04-21 08:13:10 +00:00
TYM Tsai
bd72a95c1f Merge "Use device config to control hints allow list for fill dialog" into tm-dev 2022-04-21 02:01:13 +00:00
Simranjit Kohli
1b57e4cc4c [Autofill Crash]: Fix NPE in AutofillManager.
Bug: 227192989
Test: atest android.autofillservice.cts.dropdown.AuthenticationTest#testFillResponseAuthServiceHasNoDataWithEmptyResponse
Change-Id: If56d690882e8d4ad0dba1534f127478089c4d04f
2022-04-20 18:10:23 -07:00
Jon Eckenrode
19270f18c5 Merge "Revised the API documentation for overloaded methods getRawX, getRawY, getX, and getY of MotionEvent." am: 29b6451cef am: ad75b0c0f6 am: 5db658b8f3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2034083

Change-Id: I6eec0cb2d7dc0dd3fd9c0b42bef603806af3d41d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-20 23:21:22 +00:00
Jon Eckenrode
ad75b0c0f6 Merge "Revised the API documentation for overloaded methods getRawX, getRawY, getX, and getY of MotionEvent." am: 29b6451cef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2034083

Change-Id: I8d793753a9e0f5679aa4539b07fdd3b7df4773fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-20 22:41:18 +00:00
Hongwei Wang
cf168898be Merge "Revert "Remove getSfInstance usage from ViewRootImpl"" into tm-dev 2022-04-20 19:31:59 +00:00
Yohei Yukawa
538f36937d Merge "Let A11yIME use its own IPC definitions" into tm-dev 2022-04-20 17:42:55 +00:00
Tiger Huang
f71bbcf9a4 Don't set animation pending when gaining fake control
There are 2 cases that an insets source control doesn't have a leash:
1. The server hasn't applied the transaction of the initialization of a
   leash yet.
2. The control is a fake control. It is dispatched when the insets
   source is shown transiently by the server and we don't want the
   client to change its layout.

We should only defer the insets animation for case 1. This CL uses
the insetsHint to tell if a control is fake or not.

Fix: 227083463
Test: atest --iterations 10 OpenAppNonResizeableTest
Change-Id: I45f75d8013f5723b782857101d070729cf082166
2022-04-20 15:35:32 +08:00
shawnlin
bcea9fd89e Support scaled cutout & roundedcorners when resolution is overridden
In current desgin, the confgis for cutout and rounded corner are based
on the original display size. If the display resolution is overridden,
cutous and rounded corners will be drawn in incorrect places with
incorrect size.

We should load the cutout & rounded corners with the orignal display
size and then scale the results with the display ratio which is
calculated by dividing current size with original size.

Bug: 209592558
Test: manual:
      1. Go Settings-> Display-> Screen Resolution
      2. Switch between FHD+ and QHD+
      3. Check if the cutout and rounded corner looks the same as they
	 are in the original display size.
Test: manual:
      1. adb shell wm size 1080x2340
      2. Check if the cutout and rounded corner looks the same as they
         are in the original display size.
Test: atest DisplayCutoutTest LocalDisplayAdapterTest
          ScreenDecorationsTest RoundedCornerResDelegateTest
Change-Id: Iea42b73c0276b82983c1ddbce9455355afdc164d
2022-04-20 10:03:19 +08:00
TYM Tsai
1f5c147eb5 Auto append password hint for TextView
Some TextViews are made as password via input type but does not
contain autofill password hint. This change auto append a hint
for autofill to identify.

Bug: 219844915
Test: atest android.autofillservice.cts.dialog.LoginActivityTest
Change-Id: Ifd18c56ffe788a601821d178ace41413f9e0454e
2022-04-20 03:55:33 +08:00
TYM Tsai
bbf0074056 Use device config to control hints allow list for fill dialog
For the performance consideration, we don't prefer to trigger a
FillRequest for autofill dialog at the Activity starting. We only do
that if one of the fields is a password or contains the allowed
AutofillHints for fill dialog.

Bug: 219844915
Test: set device config, check whether do a fill request at starting
Change-Id: I8cc8c99d1f0e716ad293fa612f65aa2a8d23b028
2022-04-20 02:13:28 +08:00
Hongwei Wang
9e5b4ec816 Revert "Remove getSfInstance usage from ViewRootImpl"
This reverts commit a825a5c0d9.

Reason for revert: regression as b/228282275

Bug: 222696368
Bug: 228282275
Change-Id: Iba99b5a9ab53a829ce4928cccc47293e62f76162
2022-04-19 11:09:27 -07:00
Rob Carr
23e043e977 Merge "SurfaceControlViewHost: Allow updating of WindowContext used for SCVH" into tm-dev 2022-04-19 15:47:26 +00:00
Ryan Lin
6a435bb6bb Merge "Fix InlineFilteringTest#testFiltering_filtersByPrefix" into tm-dev 2022-04-19 02:35:08 +00:00
ryanlwlin
9f226ba4c4 Fix InlineFilteringTest#testFiltering_filtersByPrefix
The window matrix of the embedded window is not updated if the second
host SurfaceView  doesn't have any offset. To esnure the window matrix
is up-to-date, we force to update the matrix when the embedded hierarchy
is initialized.

Bug: 229178859
Test: atest InlineFilteringTest#testFiltering_filtersByPrefix
      atest android.accessibilityservice.cts
Change-Id: Ib23af520fcbaa1788e3ef22a1086b90a0801375c
2022-04-19 10:31:49 +08:00
Robert Carr
2fd500488a SurfaceControlViewHost: Allow updating of WindowContext used for SCVH
Our initial attempt to allow updating the configuration of
SurfaceControlViewHost was insufficient when the SurfaceControlViewHost
is using a service context. This service context will always be
on the global configuration, and ViewRoot won't be able to override it.
We add some documentation suggesting the user use a window context,
and wire up SurfaceControlViewHost VRI so that they are the authority
on configuration (and propagate the change in to the context).

Bug: 215204813
Test: SurfaceControlViewHostTests. Manual in game overlay+split-screen
Change-Id: I24c0309593b7fddaeab8db355f63a5f6bd763562
2022-04-18 22:11:10 +00:00
Yohei Yukawa
c60176c1f3 Let A11yIME use its own IPC definitions
This is a follow up CL to our previuos CL [1], which enabled
AccessibilityService to use a subset of InputConnection APIs.

In that CL we have reused existing AIDL interfaces that were designed
and maintained for IMEs for simplicity, where a non trivial amount of
unnecessary IPC endpoints were included.

From the security and maintainability viewpoints, however, exposing
unnecessary IPC endpoints is discouraged in general.  To address such
concerns this CL introduces a set of dedicated IPC definitions for
A11yIME so that we do not need to reuse IPCs for IMEs.

This CL also stops passing InputBinding object to A11yIME process as
it contains IInputContext Binder Proxy, which can still be used to
directly invoke fallback InputConnection.  This is doable now because
A11yIME no longer relies on fallback InputConnection [2].

This CL is should not have any observable changes in the semantics.
End-to-end CTS tests guarantee that everything is still working as
intended now and in the future.

 [1]: Ia651a811093a939d00c081be1961e24ed3ad0356
      fb17e5ae7a
 [2]: I2af3cd50444d8ddf25aa0f6479238156914e6fff
      dc635efb68

Fix: 215633021
Fix: 215636776
Test: atest CtsInputMethodTestCases:AccessibilityInputMethodTest
Test: atest CtsAccessibilityServiceTestCases:AccessibilityInputConnectionTest
Test: atest CtsAccessibilityServiceTestCases:AccessibilityImeTest
Change-Id: I5ff2e804cbcf90828370a0612ff54111130bdff4
2022-04-18 08:59:44 -07:00
Robert Carr
1e780ab02d SurfaceView: Ensure position update listener sets at least once
If we destroy and recreate a SurfaceView in the same frame its
possible for positionChanged for the new surface to arrive
before positionLost for the old surface. In this case we
won't clear mRtLastReportedPosition, and so we won't set
any position at all on the new surface.

Bug: 229052731
Test: Existing tests pass
Change-Id: I896496afa5b05848f96b20697d33911cae9639a7
2022-04-14 16:12:01 -07:00
Prabir Pradhan
e8258fdf7b Advise use of InputDeviceListener when using pointer capture
InputDevices can be reconfigured when pointer capture changes, but the
app will be notified via InputManager when the updated device
information is available. This races with the onPointerCaptureChange
callback, so advise the use of InputDeviceListener in the pointer
capture documentation for developers to get around this.

Bug: 226425883
Test: None
Change-Id: I7aeb23722dc40b8fd37cb9667a4f23a336e8b5f1
2022-04-14 17:45:03 +00:00
Chavi Weingarten
700cdec45b Merge "Set mSyncBuffer to true when VRI did not initiate the sync request" into tm-dev 2022-04-14 14:19:43 +00:00