Commit Graph

16451 Commits

Author SHA1 Message Date
Vishnu Nair
dd7bcafc22 Merge "Honor the BlastSync request from WM until a frame is drawn" into sc-dev am: c9fb54069c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14164168

Change-Id: I5ec8b9e44ced71a60d00edcc66f0b50b9105366c
2021-04-13 23:24:07 +00:00
Vishnu Nair
c9fb54069c Merge "Honor the BlastSync request from WM until a frame is drawn" into sc-dev 2021-04-13 23:06:07 +00:00
Jorim Jaggi
41edbbf86d Merge "Change hwui jank detection to use deadline & gpu completion (1/2)" into sc-dev am: 21142c13de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13562070

Change-Id: If103b9233588dd21c007f608caac598350ef68bf
2021-04-13 20:39:45 +00:00
John Reck
6a8b27b8c7 Merge "Remove CloseGuard from DisplayEventReceiver" into sc-dev am: 9f7e44d30d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14174188

Change-Id: Ifcff1ec6c7d8ea3c36135861414bcc8b87504093
2021-04-13 20:39:19 +00:00
Rob Carr
4fc301aa36 Merge "Remove deferTransactionUntil" into sc-dev am: 211bf19cca
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13855851

Change-Id: I93b36a40288478d4bcfb6aae60d351788fe0f17b
2021-04-13 20:38:55 +00:00
Jorim Jaggi
21142c13de Merge "Change hwui jank detection to use deadline & gpu completion (1/2)" into sc-dev 2021-04-13 19:58:27 +00:00
John Reck
9f7e44d30d Merge "Remove CloseGuard from DisplayEventReceiver" into sc-dev 2021-04-13 19:50:53 +00:00
Rob Carr
211bf19cca Merge "Remove deferTransactionUntil" into sc-dev 2021-04-13 19:47:24 +00:00
Marin Shalamanov
6bb8076a94 Merge "Fix NPEs for virtual displays" into sc-dev am: 99364678df
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14141616

Change-Id: I66030d9bb575780439efda8c9f35ef3c6c0888f4
2021-04-13 17:41:00 +00:00
Marin Shalamanov
99364678df Merge "Fix NPEs for virtual displays" into sc-dev 2021-04-13 17:19:40 +00:00
John Reck
7db8da8a1e Remove CloseGuard from DisplayEventReceiver
Majority usage of DisplayEventReceiver is with Choreographer, which
is a thread-local. As such, it cannot have dispose() called on it
easily and dispose is also @hide. Since apps can't do anything
about this, and aren't really supposed to, remove the CloseGuard
as it just generates false-positive errors for 3p devs.

Fixes: 154358085
Test: none
Change-Id: I5e9e5324644967897f2b37a19f4fb1485b8ae5bb
2021-04-13 12:58:51 -04:00
Jorim Jaggi
10f328c580 Change hwui jank detection to use deadline & gpu completion (1/2)
- Use GPU finish time as well as actual deadline to determine jank
rate.
- Use dynamic interval to adjust for 60/90hz switching
- Move frame metrics reporting into JankTracker to adjust the
deadline communicated to the app when in stuffing scenario.
- Adjust double-stuffing detection to be a bit more readable.

Test: GraphicsStatsValidationTest.java
Test: adb shell dumpsys gfxinfo
Test: FrameMetricsListenerTest
Test: Log output of FrameMetricsObserver
Bug: 169858044
Change-Id: I3a6b8ed163e2cf9cf2b67667110340ebe35f98a1
2021-04-13 15:18:27 +00:00
Charles Chen
ddb4c83f18 Merge "Enable WindowContext to associate with WindowToken" into sc-dev am: 030a75463e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14018005

Change-Id: I292abff399ff48f43a5d99b3033ad900c15b9d5c
2021-04-13 15:00:48 +00:00
Charles Chen
030a75463e Merge "Enable WindowContext to associate with WindowToken" into sc-dev 2021-04-13 14:29:44 +00:00
Charles Chen
a5b660e386 Enable WindowContext to associate with WindowToken
This CL instroduces WMS#attachWindowContextToWindowToken
and the corresponding API in WindowContextController to make
WindowContext able to associate with a WindowToken.

Test: atest WindowContextControllerTest
Test: atest WindowManagerServiceTests#testAttachWindowContextToWindowToken*
Bug: 159767464

Change-Id: I807a67fba149cbdc4267442bab0b64e6a95bd4b5
2021-04-13 15:55:49 +08:00
Riddle Hsu
bac0061273 Merge "Revert "Clear controls and animations in temp arrays after using them"" into sc-dev am: 5a71c4f7fa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14161093

Change-Id: I09dc7fb29bcb927c30bff2c4671c842811d9b2b4
2021-04-13 02:41:55 +00:00
Riddle Hsu
5a71c4f7fa Merge "Revert "Clear controls and animations in temp arrays after using them"" into sc-dev 2021-04-13 02:21:57 +00:00
Ahaan Ugale
d88fae8ed9 Merge "Fix UiTranslation for ListView." into sc-dev am: 44dccdbe1a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14064892

Change-Id: I8634683d1373e25cd8dd5dce52430a9649d3a1b1
2021-04-13 02:18:07 +00:00
Ahaan Ugale
44dccdbe1a Merge "Fix UiTranslation for ListView." into sc-dev 2021-04-13 02:11:07 +00:00
Vishnu Nair
ab82b008f1 Honor the BlastSync request from WM until a frame is drawn
If the client cancels a draw via preDraw, we will cancel the blast sync
request. This breaks the screen decoration logic which uses the predaw
handlers to cancel the draw, change the layout of the window and then
redaw the window when the display orientation changes.

Fixes: 183171989
Test: enable cutout and rotate screen, check screen decorations are
positioned correctly
Test: go/wm-smoke

Change-Id: I7f802730b69842216b065a4a521a2737e692b82d
2021-04-12 22:52:25 +00:00
Lais Andrade
ef40d628b5 Merge "Rename CombinedVibrationEffect to CombinedVibration" into sc-dev am: 8b2586c6ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14104345

Change-Id: I5b4d66ee7d5f284dcd55f0044bc249d3c6d46b9a
2021-04-12 20:09:30 +00:00
Lais Andrade
8b2586c6ea Merge "Rename CombinedVibrationEffect to CombinedVibration" into sc-dev 2021-04-12 20:08:41 +00:00
Tiger Huang
1efc2a70b2 Revert "Clear controls and animations in temp arrays after using them"
This reverts commit fa17d6ca37.

Reason for revert: b/185097067

The original CL makes WindowInsetsAnimationImeTests fail

Change-Id: I5ffffd613e6efcd805730825318d7a83bc9babaf
2021-04-12 19:51:43 +00:00
Evan Rosky
2e17149a88 Merge "Add shell transition handling for staged split-screen." into sc-dev am: a2170c2b71
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14068886

Change-Id: Ie1783865ed19cef32596389dbcef30248b2d55e2
2021-04-12 17:15:18 +00:00
Evan Rosky
a2170c2b71 Merge "Add shell transition handling for staged split-screen." into sc-dev 2021-04-12 16:57:55 +00:00
Lais Andrade
d8dc940fc0 Rename CombinedVibrationEffect to CombinedVibration
The change makes the distinction between VibrationEffect and
CombinedVibratio clearer. The later is a combination of the former with
the extra information about the vibrator ids, allowing effects to be
played in one or more vibrators in parallel or in sequence.

The methods create/start synced where also renamed to parallel (together
with respective builder classes), to indicate they perform one or more
effects in parallel on multiple vibrators. This is also a better match
to the sequential combinations.

This change also deprecates the Context.VIBRATOR_SERVICE in favour of
the new VIBRATOR_MANAGER_SERVICE. The default vibrator can be retrieved
from the manager system service.

Same deprecation applied to InputDevice.getVibrator method.

Fix: 184123900
Test: CombinedVibrationTest
Change-Id: I44d8b225098d35fbf7783254acaf6a78f9fb4505
2021-04-12 16:34:54 +00:00
Joanne Chung
312087f91f Merge "Remove translation service feature." into sc-dev am: 279a38e147
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14112447

Change-Id: I387a396331301693d4a6e584d187303f00ce2eef
2021-04-12 16:15:56 +00:00
Marin Shalamanov
c6451f271c Fix NPEs for virtual displays
Fix for NPEs in Display.getHdrCapabilities(), isHdr() and
getReportedHdrTypes() for virtual displays.

Bug: 184722440
Test: atest VirtualDisplayTest
Change-Id: Iad5706fd66c01e0e58e43c63d617557e1532ae05
2021-04-12 13:10:06 +02:00
Joanne Chung
57dc3874f6 Remove translation service feature.
Currently, the Translation uses feature to determine if we need to
start the translation system service. But our case is like the
content capture not the autofill, the autofill can have the feature
without any service defined and the user can install one later. But
translation isn't, we should need to check config instead of
feature.

The feature will not be used anymore, it's safe to delete it. If we
leave the removal to next OS, it is painful to delete it.

Bug: 183360041
Test: atest CtsTranslationTestCases

Change-Id: Ib6886a17965937abf064e526c36c67428af7398f
2021-04-12 16:03:44 +08:00
Wei Wang
8a880140a8 Merge changes from topic "android_dynamic_performance_framework" into sc-dev am: 080abd80f4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13924975

Change-Id: Ibf21c31ad66fa26a036d229ba2a58cb841f66c22
2021-04-11 00:49:14 +00:00
Bo Liu
027b218847 Integrate HWUI with PerformanceHintManager
PerformanceHintManager.Session is in java, so add JNI and a HintSessionWrapper
class in HardwareRenderer. Then pass the two calls as two std::functions
into DrawFrameTask.

Note Session is created per HardwareRenderer, not global (per
RenderThread).

Session includes UI thread, render thread, and the thread pool.
Desired duration is from the intended start duration to the frame
deadline. Add an actual frame start time to compute

Add system properties:
debug.hwui.use_hint_manager to enable PerformanceHintManager
debug.hwui.target_cpu_time_percent to control percentage of frame time
  to be used for target cpu duration.

Test: Manual test that there are no crashes and values make sense.
Bug: 158791282
Change-Id: I83f25433c10daa20033803fb7c4ae45eab34f1d3
2021-04-10 10:21:17 -07:00
TreeHugger Robot
b6cb1e7835 Merge "Remove duplicate entry in IntDef" into sc-dev am: 9e7e1a570e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14141686

Change-Id: Ia14ded68fb1f67402b927934e3e9cbca5f5969ec
2021-04-09 21:30:43 +00:00
TreeHugger Robot
9e7e1a570e Merge "Remove duplicate entry in IntDef" into sc-dev 2021-04-09 21:02:26 +00:00
Evan Rosky
2bc5bd5168 Add shell transition handling for staged split-screen.
This makes StageCoordinator implement the TransitionHandler
interface.

In general, this currently expects 'enter' transitions to
contain 2 tasks (one in each split). The current UX is undefined
when one only one of the splits is occupied, so for now it will
throw an exception if that case is hit.

There is a split-screen API called startTasks which takes a list
of tasks (currently only supports 2) and associated options and
creates a transition to both enter split-screen and launch those
tasks into their respective stages.

These are the currently accounted-for entrypoints into
the handler interface:

- Core-initiated (handleRequest)
  - in split: trigger=HOME that is opening -> full dismiss.
  - in split: trigger=task with a stage parent that is last closing in
                    that stage -> dismiss with other stage onTop
  - NOT split: trigger=task with stage parent -> exception
- Shell-initiated
  - NOT split: startTasks -> enter split with 2 tasks
  - in split: snap-to-dismiss -> dismiss with other stage on top

Bug: 182002789
Test: atest SplitTransitionTests
      Or use the experimental pair-launch split-screen and observe
      protologs to see clean transition-infos.
Change-Id: I4f4dd431ad5642cf98b4a01c32eb1d09e5b9a11e
2021-04-09 13:13:56 -07:00
Tiger Huang
b621fd8616 Merge "Clear controls and animations in temp arrays after using them" into sc-dev am: 362abdffaa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14111127

Change-Id: I85960e4c950656717599b63bc5d74edd991e283f
2021-04-09 17:13:25 +00:00
Sally Yuen
8e669680b4 Merge "Service requests can interrupt node prefetching" into sc-dev am: 57406e2fb1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14037432

Change-Id: If6043c89bfffb2ce02369af4ca4977f0b16a94fc
2021-04-09 17:09:47 +00:00
Tiger Huang
362abdffaa Merge "Clear controls and animations in temp arrays after using them" into sc-dev 2021-04-09 17:07:15 +00:00
Sally Yuen
57406e2fb1 Merge "Service requests can interrupt node prefetching" into sc-dev 2021-04-09 16:33:40 +00:00
John Reck
fc0a5ea80b Remove duplicate entry in IntDef
Fixes: 184946143
Test: none
Change-Id: I252de27dd56abef603f6001a60c26ec8eb1fe484
2021-04-09 11:58:45 -04:00
Charles Chen
8926087107 Merge "Allow config context to inflate views" into sc-dev am: c22aff4e4d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13482649

Change-Id: Idc103720792c36b1a1e3331a5d2bea72e87e8efa
2021-04-09 07:17:18 +00:00
Charles Chen
c22aff4e4d Merge "Allow config context to inflate views" into sc-dev 2021-04-09 06:56:16 +00:00
Robert Carr
c07e9b2140 Remove deferTransactionUntil
There are no uses in the tree.

Test: Existing tests pass
Bug: 168505645
Change-Id: If65a94103858188790991c765762a05657714395
2021-04-08 20:12:31 -07:00
Sally
7853e418e7 Service requests can interrupt node prefetching
This is the re re..re-merging of ag/12923546 (where most of that original
message is posted below). This includes various bug fixes.

Slow prefetch requests would block user interactive requests, creating
noticeable sluggishness and unresponsiveness in accessibility services,
especially on the web.

Let's make it so a user interactive requests stops prefetching.
We can't interrupt an API call, but we can stop in between API calls.

On the service side, we have to separate the prefetch callbacks from the
find callback. And we have to make it asynchronous. It does dispatch
intothe main thread, so the AccessibilityCache can remain single threaded.

When the calls are interrupted on the application side,
returnPendingFindAccessibilityNodeInfosInPrefetch checks the find
requests that are waiting in the queue, to see if they can be addressed
by the prefetch results. If they can be, we don't have to call into
potentially non-performant application code. We don't  check requests
that have differing prefetch flags (FLAG_INCLUDE_NOT_IMPORTANT_VIEWS,
FLAG_REPORT_VIEW_IDS) that would result in different caches. We satisfy
at most one pending request.

We also make mPendingFindNodeByIdMessages thread-safe and ensure in
ActionReplacingCallback we don't return null results. Merged
ag/13246536, ag/13256330

Messages should be added to PrivateHandler and
mPendingFindNodeIdMessages at the same time to avoid a race condition
where we try removing a message from the handler before it's actually
enqueued. This was causing double recycling

We call into AccessibilityCache from the Binder thread, now that the
cache doesn’t call out to the app main thread with a lock(ag/14020225)

Added tests to verify AccessibilityInteractionController interactions

Test: atest AccessibilityInteractionControllerNodeRequestsTest
atest CtsAccessibilityServiceTestCases  CtsAccessibilityTestCases
CtsUiAutomationTestCases
FrameworksServicesTests:com.android.server.accessibility
FrameworksCoreTests:com.android.internal.accessibility
FrameworksCoreTests:android.view.accessibility

Bug: b/184076735
Change-Id: Iaad1b9100655ec86a788ba1c89edd2dd8a7df1f6
2021-04-09 02:30:34 +00:00
TreeHugger Robot
6e9a1996da Merge "Fix index corner bug to search the target node" 2021-04-08 16:56:45 +00:00
Tiger Huang
26bd516432 Merge "Set mIsAnimationPending when the leash is not ready" into sc-dev 2021-04-08 07:07:45 +00:00
Adam He
f9af9bde4a Merge "Remove api TranslationResponse.Builder.setTranslationStatus(), repeat of the Builder ctor." into sc-dev 2021-04-07 23:14:34 +00:00
Nader Jawad
779a8514b7 Merge "Holepunch layers for SurfaceView" into sc-dev 2021-04-07 17:35:45 +00:00
Ady Abraham
db96662e30 Merge "DisplayManagerGlobal: suppress redundant onDisplayChanged events" into sc-dev 2021-04-07 16:45:53 +00:00
Charles Chen
d12be75275 Allow config context to inflate views
Besides UI contexts, the context created via
Context#createConfigurationContext with a proper configuration
should be allowed to inflate views or obtain ViewConfiguration.
An example is that a wear device inflate views into bitmap and pass
the bitmap to the Wear OS Companion app on the phone.

Bug: 177847640
Test: atest StrictModeTest

Change-Id: Iab232a80a973f54bf0484262d45af3e4c2f0e5dc
2021-04-07 21:58:42 +08:00
Tiger Huang
fa17d6ca37 Clear controls and animations in temp arrays after using them
The arrays would be cleared while next time we use them, so they could
constantly occupy the memory.

This CL clears the temp arrays right after we use them. So they won't
occupy the memory while they are not being used.

Fix: 183684434
Test: Use Android Memory Profiler to check if there is
      InsetsAnimationControlImpl or WindowInsetsAnimation instances
      after GCing after playing insets animation in Launcher.
Change-Id: Iaae1e11d1c0cc1a9ac345beb3d7e8b596ea1b4ba
2021-04-07 15:58:37 +08:00