Commit Graph

16427 Commits

Author SHA1 Message Date
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
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
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
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
Nader Jawad
2dc632aee3 Holepunch layers for SurfaceView
Update RenderNodeDrawable to hole punch areas into
layers created for SurfaceView

Bug: 184297961
Test: Added CTS test to SurfaceViewTests
Change-Id: I1f03a4fe34c5a8b7411ebe728ea3d4195fcd1fac
2021-04-06 22:03:00 -07:00
TreeHugger Robot
7d8ae59fee Merge "Updates magnification button after an accessibility action is performed" into sc-dev 2021-04-07 03:25:32 +00:00
Jacky Kao
4563f9dfb5 Merge "Limitation the text location length of the A11y node" into sc-dev 2021-04-07 02:29:52 +00:00
mincheli
80a35549c8 Updates magnification button after an accessibility action is performed
To switch magnification mode, a user has to click the magnifcation
button UI. However magnification button UI is visible only when
there is an user touch interaction or the magnification shortcut
triggered event.
However some a11y services like switch-access or voice-access
can only interact with magnification UI by performing
accessibility actions. To make magnification button showing and
able to interact with a user, we also trigger updating
magnification button UI when an accessibility action is performed.

Bug: 179442890
Test: atest WindowMagnificationControllerTest;
atest WindowMagnificationTest;atest MagnificationControllerTest;atest WindowMagnificationManagerTest

Change-Id: I8d762096c9cb6a4421d024a7a1af99b3a48a3462
2021-04-07 01:16:24 +00:00
Ady Abraham
6f1cac9912 DisplayManagerGlobal: suppress redundant onDisplayChanged events
With Frame Rate Override enabled, an app could get an onDisplayChanged
events which seems redundant. An example would be:
1. Display changed refresh rate to 60Hz - onDisplayChanged was called
2. App's frame rate override changed to 60Hz - onDisplayChanged was called

To avoid sending these redundant events, DisplayManagerGlobal caches
the last DisplayInfo that was reported to the app and based on it it
decides whether to send the event or not.

Bug: 184588343
Test: atest SetFrameRateTest
Test: atest FrameRateOverrideHostTest
Change-Id: I97c7b2b9a799424998b1b717a4311d3d08b3178f
2021-04-06 15:33:19 -07:00
TreeHugger Robot
7c8aea622c Merge "Don't set mNextDrawUseBlastSync when hardware is not enabled" into sc-dev 2021-04-06 17:05:39 +00:00
TreeHugger Robot
4d2caded83 Merge "Add the IntRange and IntDef annotations for initial text API" into sc-dev 2021-04-06 15:10:46 +00:00
Steven Ng
32a1305cbd onDrawScrollIndicators returns early if the view isn't attached
Test: Install a test app that can reproduce the null pointer
      exception. Flash and install a build with this CL. Null
      pointer exception can no longer be observed.

Bug: 183386115
Change-Id: Iab155dfca20e0119cc401d111ace23e416e93b93
2021-04-06 09:10:23 +00:00
Tiger Huang
7c51474301 Don't set mNextDrawUseBlastSync when hardware is not enabled
Otherwise, it will make the ViewRootImpl pause forever. Because there
won't be any frame-drawing callback where we clear the flag.

Fix: 182797514
Test: steps in the bug
Change-Id: Iadd35f1b112626399c064a1cd7d7da323bb9e36c
2021-04-06 10:54:04 +08:00
Saho Kobayashi
0d925fbbcd Fix index corner bug to search the target node
In dispatchTouchEvent(), the target node is searched by the for loop.
When the TargetAccessibilityFocus flag is set, dispatchTouchEvent
prioritizes finding the accessibility focused node first.
When the accessibility focused node doesn't handle the event, the second
search is done without the TargetAccessibilityFocus flag.
To prepare for the second search, the index is reset when the
accessibility focused node is found.
Currently the index is reset to childrenCount - 1, which is the same as
the initial index of the for loop, but to search the same range as the
first search, we need to reset it to childrenCount, because the actual
second search starts from the next loop.

Bug: 182434603
Test: atest TouchExplorerTest
Change-Id: Ifc88f7df43bd26e978b24a0d94cfb1ce60c6cb3b
2021-04-06 02:08:19 +00:00
Tiger Huang
2664c3863b Refine output of "dumpsys window displays/windows"
- Prints the window title instead of dumping the whole window in
  InsetsSourceProvider.
- Stops printing mFakeControl, because it is the same in each
  InsetsSourceProvider.
- Removes redundant blanks after '='.
- Refines indentation.
- Prints requested visibility while dumping WindowState instead of
  printing the raw mRequestedInsetsState.

Fix: 184237588
Test: check the output of "dumpsys window -a"
Change-Id: I3e0ac2335c29b7f2449b890b4070c62d77ff7f7f
2021-04-05 17:35:57 +08:00
Hongming Jin
06a5b97f6a Merge "Add trace for AccessibilityInteractionClient callback interfaces." into sc-dev 2021-04-02 23:15:18 +00:00
John Reck
24acd37203 Merge "HDR info listener" into sc-dev 2021-04-02 20:21:51 +00:00
Hongming Jin
c49cac7386 Add trace for AccessibilityInteractionClient callback interfaces.
In an effort to reduce unnecessary String operations and Binder calls
from AccessibilityInteractionClient, also add channels to propagate
tracing state to AccessibilityInteractionClient through
AccessibilityManager.

Bug: 157601519
Test: adb shell cmd accessibility start-trace
      adb shell cmd accessibility stop-trace
Change-Id: Idfe220bc64a9c83679201b9a9a36b1c492f9d6cc
2021-04-02 12:15:14 -07:00
Siarhei Vishniakou
d2766d013f Check mInputEventReceiver before sending timeline
Previously, it was possible to receive a FrameMetrics callback after the view was already detached from window. In that situation, the mInputEventReceiver is set to null and the object is disposed.

But InputMetricsListener used to store another reference to mInputEventReceiver. So it's own object was never set to null. We would then try to send the timeline to native input receiver, and crash because the native object has already be deleted by the earlier dispose() call.

So the sequence of events was:

dispatchDetachedFromWindow
mInputEventReceiver.dispose()
native input receiver is deleted
InputMetricsListener::onFrameMetricsAvailable
mInputEventReceiver.reportTimeline
try to access a native object using a null pointer
crash

A few options to fix this were investigated:

1) Unregister the observer when mAttachInfo.mThreadedRenderer is set to null.

This is good to do, but it's not sufficient. The problem is that the native call to RenderProxy 'removeObserver' is not serviced immediately, but is posted to be completed sometime in the future. Therefore, the crash would not be fixed by it.
Still, we should always register the observer for the active threadedRenderer, which is done in this CL.

2) Keep a weak reference to mInputEventReceiver inside InputMetricsListener. This would allow InputMetricsListener to check on the status of mInputEventReceiver. When it's disposed, it would be also set to null, so the weak reference resolution would fail.

Unfortunately, 'mInputEventReceiver' is not the only reference to the object of WindowInputEventReceiver. It turns out that the receiver is also stored inside the queued events (see class QueuedInputEvent { private InputEventReceiver mReceiver }). From reviewing ag/153113, it should be OK to remove the receiver from QueuedInputEvent and simply keep track of whether the event is synthesized or not.
But, that change would be too significant to make in this CL. Also, weak references have performance impact, so this may not be desirable anyways.

3) Do not store mInputEventReceiver in InputMetricsListener
The chosen option is to simply use the variable mInputEventReceiver from the outer class. If the receiver is null, we don't notify about the metrics.

This reverts commit d187cc7627.

Reason for revert: fixing this properly instead

Bug: 184255546
Bug: 169866723
Test: settings -> privacy -> permission manager -> body sensors -> show system (only click once) -> google play services -> deny -> deny anyway
Repeat the above 20 times. Observe that there's no crash of the activity.

Change-Id: I5cf36ef068f7964572ab1a1475ff8ac53ae6beb5
2021-04-02 02:32:06 +00:00
TreeHugger Robot
fb3f0fb6cc Merge "Do not report timeline temporarily" into sc-dev 2021-04-01 19:46:38 +00:00
Rob Carr
194d95b130 Merge "ViewRootImpl remove blur defer transacion" into sc-dev 2021-04-01 17:55:06 +00:00
Siarhei Vishniakou
d187cc7627 Do not report timeline temporarily
While we are working on a proper fix for the issue, let's turn off
timeline reporting to avoid hitting this path.

Bug: 184255546
Test: manual
Change-Id: Ie8b6c6222a0a8d7b8d3fd96f25d5f59b96de2255
2021-04-01 17:13:19 +00:00
Treehugger Robot
274a76464c Merge "Update OWNERS for OnReceiveContentListener and ContentInfo" am: 2990dccc16 am: 736e5ea3a5 am: 838aff1230
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1661118

Change-Id: I23fa0b898d4298509a2d37c7edc6be7ab06e6dc3
2021-04-01 15:49:07 +00:00
Daniel Sandler
ad4a5023ce Merge "Custom haptic composition for assistant launched via button." into sc-dev 2021-04-01 15:41:57 +00:00
Treehugger Robot
838aff1230 Merge "Update OWNERS for OnReceiveContentListener and ContentInfo" am: 2990dccc16 am: 736e5ea3a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1661118

Change-Id: I595fe6c41cd4f1229818d30aa780cc328a97c265
2021-04-01 15:02:29 +00:00
Lan Wei
071d81e623 Add the IntRange and IntDef annotations for initial text API
Add the IntRange and IntDef annotations on the getInitialText{Before,After}Cursor API.

BUG: 184017538
Test: atest FrameworksCoreTests:EditorInfoTest
Test: atest CtsInputMethodTestCases:EditorInfoTest
Change-Id: Ifebeeac6863600363ebcf6c73263874604ea3428
2021-04-01 17:56:42 +08:00
Winson Chung
db41d72646 Merge "Expose the full task info with the remote animation target" into sc-dev 2021-04-01 03:56:55 +00:00