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
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
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
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
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
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
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
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
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
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
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
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
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
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
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