Commit Graph

19734 Commits

Author SHA1 Message Date
TreeHugger Robot
f0c4b5fc70 Merge "Ensure that a11y window state change event is sent on focus change" 2022-12-07 23:51:11 +00:00
Ady Abraham
19358262ca Merge "Handle the render frame rate from SF" 2022-12-07 02:45:22 +00:00
Ady Abraham
eb994d9a59 Handle the render frame rate from SF
SurfaceFlinger render rate might be a divisor of the display
physical refresh rate. Plumb this throught DisplayManager and return
that value when apps call Display#getRefreshRate

Test: atest FrameRateOverrideHostTest
Test: atest LocalDisplayAdapterTest
Test: atest DisplayManagerServiceTest
Bug: 259740021
Change-Id: I1a6925f112bc982371aafe31deb56f2430801fac
2022-12-06 23:25:58 +00:00
Tiger Huang
692cd421fd Merge "Reduce unnecessary measure" into tm-qpr-dev am: 80c145dca0 am: 064bb0a725
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20561749

Change-Id: I4e7495ca68d4d0e63e02767d5ad17d489efbebf5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-06 19:55:43 +00:00
TreeHugger Robot
e07a11a59e Merge "Describe requested visibilities in public types (6/n: clean up)" 2022-12-06 12:06:26 +00:00
Tiger Huang
064bb0a725 Merge "Reduce unnecessary measure" into tm-qpr-dev am: 80c145dca0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20561749

Change-Id: Ide48672b8d746c78ea53961be93217e9f208936a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-06 06:29:49 +00:00
Tiger Huang
80c145dca0 Merge "Reduce unnecessary measure" into tm-qpr-dev 2022-12-06 05:46:04 +00:00
Chet Haase
359453d884 Merge "Fix activity leak bug" into tm-qpr-dev am: 020d3fa7b2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20610032

Change-Id: I5e4e2fcc0763111cc949c64b8845a893a2aef76d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-05 18:12:22 +00:00
Chet Haase
020d3fa7b2 Merge "Fix activity leak bug" into tm-qpr-dev 2022-12-05 17:42:40 +00:00
Zeyin Wu
ecac954e78 Merge "Update rate limit APIs naming." 2022-12-05 17:12:30 +00:00
Marc Kassis
8b6d1169dc Merge "Each Display Mode now has an array of supported HDR types" 2022-12-05 13:45:23 +00:00
TreeHugger Robot
c76b8474a1 Merge "Remove the usage of givenContentInsets for non-IME windows" 2022-12-05 11:20:43 +00:00
Marc Kassis
643cd12ae7 Each Display Mode now has an array of supported HDR types
Bug: 241349060
Test: atest android.display.cts.DisplayTest
Change-Id: I3c5b9fb25cd79497be1acded366d1b4cf85e1daf
2022-12-05 08:17:32 +00:00
Daniel Norman
0e2e7033f0 Merge changes from topic "a11y-motion"
* changes:
  Introduce AccessibilityService#onMotionEvent()
  Add a new @TestApi to inject InputEvents to the input filter.
2022-12-03 04:49:34 +00:00
Chris Li
70dfdac013 Merge "Provide startBounds for closing container with legacy transition" into tm-qpr-dev am: 1bf14bee43 am: e681471300
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20543368

Change-Id: I250875900e8a527512309d9450782fe8f4cf88fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-03 03:46:53 +00:00
Chris Li
e681471300 Merge "Provide startBounds for closing container with legacy transition" into tm-qpr-dev am: 1bf14bee43
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20543368

Change-Id: I748c5be3bd210ed9c52cdf282dbebf2c9fd8fccb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-03 03:11:14 +00:00
Chris Li
1bf14bee43 Merge "Provide startBounds for closing container with legacy transition" into tm-qpr-dev 2022-12-03 02:26:52 +00:00
Zeyin Wu
921d6d3701 Update rate limit APIs naming.
Bug: 260811959
Test: ran cts tests
Change-Id: Ia4f1f3c175d350e04925526f0755390a9f42c706
2022-12-02 22:55:54 +00:00
Daniel Norman
83e20e8637 Add a new @TestApi to inject InputEvents to the input filter.
This is used by end-to-end tests exercising the input filter for generic
motion events.

Bug: 247550565
Test: atest AccessibilityEndToEndTest, using the dependent change topic
Change-Id: I2695ecb3919d8336dc3f6df1a525a53d84c03fec
2022-12-02 11:30:28 -08:00
Chavi Weingarten
129a1053d2 Merge "Make count for numSyncsInProgress static" 2022-12-02 14:09:21 +00:00
Chris Li
62f0464d29 Provide startBounds for closing container with legacy transition
Before, we only provide startBounds when the animation target is
MODE_CHANGING, with which we won't know the start bounds for target that
is closing while resizing.

Now, we provide startBounds for all targets, so that we can use it to
provide seamless animation when the target is closing while resizing.

Also make sure the closing container's surface is in the start bounds
before the animation starts to avoid any flicker.

Bug: 241043533
Test: Verify with switching between split and stack.
Change-Id: I4d8e1ee44d418249dcb434425c7ab3d63a429bad
2022-12-02 05:01:02 +00:00
Chavi Weingarten
c96fbf2287 Make count for numSyncsInProgress static
numSyncsInProgress is used to keep track of how many syncs VRI has
started to ensure it can disable RT Animations and then enable at the
end of the sync. This needs to be global across the process because RT
Animations config is global to the process. This means if there are any
VRI's in a sync across the process, we need to keep RT Animations
disabled until the end of all of them.

Test: Sync works
Bug: 237804605
Change-Id: I6304061f564ceea9de08331d7ee48834ad3c828b
2022-12-01 19:52:04 +00:00
Naomi Musgrave
e6c2a39fae Merge "WMS retrieves uid for the package based on the linux user" into tm-qpr-dev am: 1549391e56
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20551446

Change-Id: Idfa3baef2065b19ecb8f2165f147cf487a96017f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-01 18:08:05 +00:00
Chet Haase
93f2744c95 Fix activity leak bug
This is a cherry-pick from main branch:
ID: I7dfebac90aa43f89433f49e0ed60b3ff57bcc497

It is possible for ViewRootImpl.doDie() to be called prior to one of the
other calls which tells the system that the window is going to the
foreground. This race condition can cause an activity leak since the
ViewRootImpl in question is stored in a collection of "requestors" which
determine when to pause/resume animators for background/foreground apps.

The fix is two-fold:
- Only cause an item to be added to the "requestor" list in
  AnimationHandler when doDie() has not yet been called (marked by
  the mReoved" flag)
- Store the requestor objects as WeakReferences, rather than the objects
  themselves. Thus if the requestor list is the only referent to the
  object, it can be collected anyway, removing the leak potential.

Bug: 258616235, 258616235
Test: AnimatorLeakTest passes
Change-Id: Icdd6023f6530e3cc4b474f33dc34f6eb7400788e
Merged-in: I7dfebac90aa43f89433f49e0ed60b3ff57bcc497
2022-12-01 17:47:09 +00:00
Naomi Musgrave
2f88f7a9d8 WMS retrieves uid for the package based on the linux user
Without this, checking if the caller is the recents component always
fails on the secondary user.

Bug: 255480931
Test: atest WmTests:WindowManagerServiceTests
Change-Id: Iac9fea3935c3aadf29a21d8af715df845e8ea43c
Merged-In: Iac9fea3935c3aadf29a21d8af715df845e8ea43c
2022-12-01 17:23:43 +00:00
Shawn Lin
ae07cf71f5 Merge "Support DisplayShape" 2022-12-01 07:34:39 +00:00
TreeHugger Robot
2d1f59db15 Merge "Revert "Don't swallow exceptions"" 2022-11-30 19:17:01 +00:00
Krishang Garodia
1276be908e Revert "Don't swallow exceptions"
This reverts commit 36a47145c6.

Reason for revert:
MediaProviderTests failures

Bug: 260297790
Change-Id: I1b7ab711989578e009bac353b7a0cbe42fbfb3c8
Test: atest MediaProviderTests
2022-11-30 14:54:25 +00:00
Naomi Musgrave
4e530d3bc6 WMS retrieves uid for the package based on the linux user
Without this, checking if the caller is the recents component always
fails on the secondary user.

Bug: 254937640
Test: atest WmTests:WindowManagerServiceTests
Change-Id: Iac9fea3935c3aadf29a21d8af715df845e8ea43c
2022-11-30 10:55:19 +00:00
Vladimir Komsiyski
79ffdd3932 Merge "Add a display flag for maintaining its own focus and touch mode." 2022-11-30 09:10:25 +00:00
TreeHugger Robot
4c2d3f65ef Merge "Fix deadlock" 2022-11-29 19:10:42 +00:00
Sally Yuen
77eb98c8ac Merge "Expose more SystemAPI methods on AccessibilityDisplayProxy" 2022-11-29 16:36:27 +00:00
Vladimir Komsiyski
702275586e Add a display flag for maintaining its own focus and touch mode.
This basically duplicates the behavior of config_perDisplayFocusEnabled
but via a display flag instead of globally for all displays. The display
must be trusted for the new flag to be set.

This is particularly needed for virtual devices and displays with
navigation-type inputs, for which touching the default display will
cause everything to enter touch mode and therefore the currently focused
view would lose focus.

Bug: 233911853
Bug: 256810557
Test: atest DisplayManagerServiceTest
Test: atest WindowManagerServiceTests
Change-Id: Ie1c3b8a42f512530bf0ce3fabc56f0da236a311c
2022-11-29 14:20:40 +01:00
Shawn Lin
2742c68f6c Support DisplayShape
Provide APIs to query display shape information:

- Added a DisplayShape class which provide a Path.
- Added a new API in Display to get the DisplayShape based on the
  display coordinates.
- Added a new API in WindowInsets to get the relative DisplayShape
  based on the window frame.

Bug: 236935288
Test: atest DisplayShapeTest LocalDisplayAdapterTest WindowInsetsTest
      InsetsStateTest DisplayPolicyLayoutTests DisplayPolicyTests
      WallpaperControllerTests
Change-Id: I7aacfcae42203d3f57cd577da5a69180f66780ad
2022-11-29 15:48:50 +08:00
Shawn Lin
cddf907e07 Merge "Fixed test failures of WindowTest" 2022-11-29 03:26:21 +00:00
sallyyuen
111ef0b932 Expose more SystemAPI methods on AccessibilityDisplayProxy
These are:
- onProxyConnected (equivalent to onServiceConnected)
- onAccessibilityEvent
- onInterrupt
- getWindows
- set/getInstalledAndEnabledServices

Connect the proxy client (IAccessibilityServiceClient) to a
proxy service connection
(ProxyAbstractAccessibilityServiceConnection) in ProxyManager,
so the A11yDisplayProxy can access the UI.

AccessibilityServices run on their own thread. To avoid using the
app's main thread, the app that registers the A11yDisplayProxy
can call it on a different thread. Add a note in the proxy class.

Future TODOs (b/254545943):

The a11y state returned to A11yManager includes state
of all proxies and AccessibilityServices.
Separation will require AccessibiilityManager to go from being a
process singleton to a per-display instance.

Input and a11y focus are singletons and may
shift between a proxy display and a display on the device.
Separation will require future changes.

ProxyManager behaves more like UiAutomationManager,
and centralizes proxy management. Separation into different user
states will require future refactoring.

Bug: 241429275
Test: atest AccessibilityDisplayProxyTest,
AccessibilityManagerServiceTest, manual test app that
registers/unregisters A11yDisplayProxy

Change-Id: I830c6613c2c2f8abcc2343c5110f4e7b7494fb0e
2022-11-28 13:07:14 -08:00
Shawn Lin
6f7e60ed8c Fixed test failures of WindowTest
When cutout mode is always/shortEdges and the system window insets are
consumed, the cutout isn't consumed and is inset to an empty cutout
which causes the test failure.

We should also consume cutout when the system window insets contain
cutout and are consumed.

Bug: 253995206
Test: atest WindowTest WindowInsetsTest DecorInsetTests
Change-Id: I8a4fd56675509cc27dfa91de1138458fb1e7b0f0
2022-11-28 08:48:53 +00:00
Tiger
adfbe26af2 Reduce unnecessary measure
If a window size can be known by the LayoutParams, we can use the size
to relayout window, and we don't have to measure the view hierarchy
before laying out the views.

The CL applies the optimization on notification shade since it takes
much time on performing measure. We plan to apply this on all the
windows later.

Fix: 259095271
Fix: 259673244
Bug: 260382739
Test: Change display density via adb command and see if notification
      shade gets multiple measure in one traversal.
Change-Id: Ib85ceeda8a821703a32e88de7c67999f63276b6b
2022-11-25 17:15:46 +08:00
Hiroki Sato
feb3645387 Ensure that a11y window state change event is sent on focus change
Currently when the focus changes, an accessibility event of
TYPE_WINDOW_STATE_CHANGED is dispatched from ViewRootImpl. This logic is
implemented in performTraversals(), but the logic depends on the value
mAttachInfo.mHasWindowFocus, which is updated from an input event
handleWindowFocusChanged(). There's no guarantee that always
performTraversals() is called after handleWindowFocusChanged().

As a result, sometimes accessibility event is not dispatched after focus
change.

This change fixes the issue by explicitly dispatching the event in
handleWindowFocusChanged() if needed.

Bug: 260310672
Bug: 214318644
Test: Accessibility CTS
Change-Id: I95cf3a7a9c7951f8b3862713ed7339688a8427d5
2022-11-25 10:41:02 +09:00
Michael Wright
1c1d459e04 Add additional pointer state to input dumpsys
Bug: 254277939
Test: manually inspect `dumpsys input`
Change-Id: I3931187638b4c54ff90be9bc3b01a1edc442d49b
2022-11-25 00:22:23 +00:00
Yunfan Chen
77a0bd8899 Remove the usage of givenContentInsets for non-IME windows
Currently, no insets is calculated based on contentInsets and other
fields set in WindowState when the InsetsFrameProvider is given. It is
safe to remove the calculation for windows other than IME.

The fields in WindowState, including touchableAreaInsets, visibleInsets,
contentInsets is a description of the window itself, instead of the
insets it providing to other windows. Such that, we can remove the
consideration of those fields for most cases.

Bug: 202360061
Test: DisplayPolicyInsetsTests
Change-Id: Ie127f4655ed923545dede16ebc615dbf8384d34a
2022-11-24 17:02:28 +09:00
TreeHugger Robot
4e1d9153a8 Merge "Don't swallow exceptions" 2022-11-24 00:22:03 +00:00
John Reck
7fb2891673 Fix deadlock
mSurface.destroy() may block on a HardwareRenderer if lockHardwareCanvas
is used. mSurfaceControlLock is also used on the RenderThread, so it cannot hold that lock when potentially calling into HardwareRenderer as this is a deadlock risk.

Fixes: 244616968
Test: guess
Change-Id: Iedb6f3ce80f47a67b4427550f27851c3b9e3e242
2022-11-23 21:18:25 +00:00
John Reck
36a47145c6 Don't swallow exceptions
Fixes: 260244068
Test: App in bug crashes with IAE
Change-Id: I358ecf4309d82c609863b7f4d8d3d687b7c51f4b
2022-11-23 21:15:13 +00:00
Zeyin Wu
068c438db5 Merge "Remove redundant constants for content change rate limiting." 2022-11-22 18:31:45 +00:00
Sally Qi
d2fbea3097 Merge "Plumb overlayPropertes into DMS side." 2022-11-22 18:20:49 +00:00
Zeyin Wu
16cc390d7c Remove redundant constants for content change rate limiting.
Bug: 222759137
Test: ran cts test
Change-Id: I559f1a638aca92ee97865e31ad5c557eb3992bad
2022-11-21 20:50:37 +00:00
Zeyin Wu
3f9671444d Merge "Add new APIs for initial accessibility focus setting" 2022-11-21 18:55:16 +00:00
Harry Cutts
fe0d69d064 Merge "Make MotionEvent#obtain with classification public" 2022-11-21 15:41:52 +00:00
TYM Tsai
505ca4454b Merge "Fix prefill request is blocked waiting for an inline request." 2022-11-18 22:04:52 +00:00