A reference to the callback was being removed while still
needed. Instead use a local copy for posted callback.
Bug: 12345678
Test: atest ScrollCaptureConnectionTest#testCloseWhileActive
Change-Id: I3a11ac86a8c291972f442ebce962ba8a3a1ddee6
Rename this method to reportPerceptibleAsync
for readability, because it was already a truly
one-way method when it create.
Bug: 185281885
Test: atest CtsInputMethodTestCases
Change-Id: I9c72b980678f0310c79b293ea06f465e9ca1d760
We introduced IVoidResultCallback mechanism to
removeImeSurfaceFromWindow in CL[1] to simulate
two-way behavior before it become truly one-way.
InputMethodManagerService#removeImeSurfaceFromWindow()
simply post the task into its message queue hence we
should able to safely convert this method into one-way.
-. Remove IVoidResultCallback for this method
-. Rename it to removeImeSurfaceFromWindowAsync
[1]: Icb396ae5d74060af69c4ecb16723b2e37b9f2067
Bug: 179668859
Bug: 185277968
Test: Manual test with b/179668859 steps, and works fine
Test: atest CtsInputMethodTestCases
Change-Id: Id28698e263a23ec4a6e4f89438eba5d19bbbabbb
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
- 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
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
There are some issues the resume/finish seems not work well. The
debug flag should be enabled manually, but in the most time the
user may forget to enable it before testing. Try to enable it in the
debug rom to help debugging, we use b/182433547 to trace the disable
this check before rom release.
Bug: 182433547
Test: manual
Change-Id: I2f85a0e17f8a2b8a4b93252044cf48d739b4eca2
Fix this by have writeToParcel respect PARCELABLE_WRITE_RETURN_VALUE.
Fixes: b/185178151
Test: go/wm-smoke
Change-Id: Ic146d1bbb9a68be6c4f4fea10c65f81b1b36d760
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
This reverts commit fa17d6ca37.
Reason for revert: b/185097067
The original CL makes WindowInsetsAnimationImeTests fail
Change-Id: I5ffffd613e6efcd805730825318d7a83bc9babaf
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
Fix for NPEs in Display.getHdrCapabilities(), isHdr() and
getReportedHdrTypes() for virtual displays.
Bug: 184722440
Test: atest VirtualDisplayTest
Change-Id: Iad5706fd66c01e0e58e43c63d617557e1532ae05
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
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
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
Currently, setAlpha was using mRtTransaction to send the SC transaction.
However, that's also used by positionChanged. This could cause
synchronization issues because both callbacks are invoked from a thread
pool with no synchronization ensured.
Instead, create a Transaction that's used just for FrameCallbacks.
FrameCallbacks will all occur on the same thread so it's safe to use the
same object. Additionally, created a separate transaction that should be
used for positionChanged. This is because it's invoked from a thread
pool can could interfere with the main render thread transactions.
Finally, use the original mRtTransaction only for places that are called
synchronously from renderThread.
Test: Hard to repro original issue. Bubbles works
Bug: 184559328
Change-Id: Ia5a36ad063c19e8a481a57170e47029f7c2c7ee7
Send TextClassifier an event when an app is reading the clipboard.
The event contains both the source package and the destination package.
Bug: 177898188
Will add an automated test on the text classifier side.
Test: Manual.
1. Copy and paste. Verify that an event is sent to textclassifier by
enable verbose logging.
2. Paste on the same app again, no event is sent.
3. Verify that no events are genereated for apps that read
the clipboard in the background, e.g. keyboard and autofill.
Change-Id: Ide849bf5a0a56271ec8e70d47faabbc47a74332d
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
Use a BLAST layer when taking a screenshot and using it for an
animation. This is simple enough to do with BLAST instead of a buffer
queue since we can just submit a single buffer and it will be presented.
Added new methods in SurfaceControl to support sending a buffer and
colorSpace.
Test: ScreenRotation
Test: Freeform animation
Bug: 170765639
Change-Id: I72081ab833d76fac40667eed52cf16798112a5b6