There are some issues TranslationService already sent the response
but the View onResponse doesn't be called. The reference seems to be
gone. If we don't fix the problem, we will missing the ui translation
even the service already give us the response. To fix the problem, we
change it to strong reference.
The change is low risk, the only risk is if TranslationService doesn
not release the reference to the callback properly causing a memory
leak for apps but this can recovered by app update.
Bug: 194973014
Test: atest CtsTranslationTestCases
Test: The translation for chat apps work fine. The memory is decreased
after receiving the responses for a while.
Change-Id: Ib3956b2250c54a29acf9f7d51f51e8191fe8aba2
This is a mechanical refactoring CL that locks down
RemoteInputConnectionImpl#getInputConnection()
as a private method.
This is supposed to be helpful to to avoid future misuse of raw
InputConnection instance outside RemoteInputConnectionImpl.
Note that InputMethodManager#isAcceptingText() remains to have the
same observable behavior in this CL. The key fact is that the
following two fields are updated in an atomic way.
* RemoteInputConnectionImpl#mInputConnection
* RemoteInputConnectionImpl#mFinished
Bug: 192412909
Test: presubmit
Change-Id: Ic5fbc6213ad62df95fc0b7eef18bab1fd9fbdbf1
This CL fixes a regression that
InputConnection#reportFullscreenMode()
is always called back on the main thread rather than its associated
thread. In most of cases those two threads are the same hence there
is no semantic problem, threads are the same, but for some special
cases, e.g. when apps explicitly override
InputConnection#getHandler(),
our thread affinity contract can be violated.
This regression was accidentally introduced in Android O time frame
while attempting to make the system more robust at Bug 28406127 [1].
Although we have never received any actual issue report from app
developers so far, this is still worth fixing.
[1]: If23e7c7c265ab3dfb48c2fb6fdb361b17d22c594
2bc66171cc
Bug: 28406127
Fix: 193588937
Test: atest CtsInputMethodTestCases:InputConnectionHandlerTest
Change-Id: Id3ac21c11d6b062bb66719109376ff642309b8ff
This cl solves a couple of issues:
1. Render thread workers and UI thread share the surface size. They work
on different frames (UI thread sets up the next frame while render
thread is working on the current frame. Accessing the surface size is
unsafe and can result in flickers.
2. UI thread is changing the geometry on size change which might
conflict with render thread causing flickers. This is because of
unsafe accesses as the one mentioned above and the UI thread may
not have the up-to-date position of the view.
This cl fixes the issues by only applying geometry changes in the
UI thread when creating the surface, otherwise the render thread
workers are responsible for updating the geometry. The RenderNode
position update listeners are updated whenever the surface size
changes in order to capture the new size and accompanying changes
which must be applied with the new geometry changes.
Note: updating the position update listeners will trigger a
position update callback so we are guaranteed to apply the
changes in scenarios where the fixed size changes but the view
size does not change.
Test: atest SurfaceViewSyncTest#testSurfaceViewChangeFixedSize
Test: atest SurfaceViewSyncTest#testSurfaceViewChangeFixedSizeWithViewSizeChanges
Test: go/wm-smoke
Test: repro steps from b/190449942
Fixes: 190449942
Change-Id: I076321c853f9a0f6cbf169637e3f3ede60361d60
The flag does not impact any other application calling the sandboxed
display APIs. The flag will be removed after Launcher finishes
identifying the breakages attributed to the display API changes.
For Launcher to receive the un-sandboxed values:
adb shell cmd display constrain-display-apis false
Test: manual
Bug: 193421404
Change-Id: I5d8612fd7dcb49769ae005130c9786b2d8416bfc
Since its beginning [1] the system has been using
InputConnection#getHandler()
only for retrieving Looper associated with it. Although it has been
intentional, it'd be probably helpful for app developers if we can
clarify a bit more on this, because most likely the current behavior
is not going to change.
This CL also annotates the API with @Nullable as it should have been.
[1]: Id9e579bb3e2966986cdcb1c34bc8cacfeca2e1a9
612cce92ad
Bug: 26945674
Fix: 195434171
Test: presubmit
Change-Id: I14910c6f0cc43feec505b2951625d0c00203ac92
This is a mechanical refactoring CL that renames
com.android.internal.view.IInputConnectionWrapper
to
com.android.internal.inputmethod.RemoteInputConnectionImpl
with no observable behavior change.
Bug: 192412909
Test: presubmit
Test: No lint error under core/java/com/android/internal/inputmethod
Change-Id: I171106ad0b46fbb495a6bf08d10f33915c2d29ac
This reverts commit 45dd2a3202.
Reason for revert: b/195280234 is blocking droidfood
Bug: b/195280234
Change-Id: I09593dffb797d1e4c60cff52e7901ed6c00f719c
This CL fixes one of the issues with SurfaceView parent frame and
content syncing.
With BLAST, we have two surface controls each setting a scale. The
parent surface control sets a scale based on the requested surface
size and the SurfaceView layout size. The BlastBufferQueue surface
control scales the buffer to the requested buffer size if the buffer
has the appropriate scale mode.
The destination frame controls the second scaling and it must be
applied with the parent surface scale changes. This cl fixes flickers
where the requested fixed surface size changes without any view size
changes. This cl allows the caller to pass in a transaction to
BLASTBufferQueue#update which is updated with the destination frame
changes. This transaction can then be applied with the parent
surface changes.
This also fixes an issue where destination Frame was being set on
every buffer update and when we updated the BlastBufferQueue size.
Since buffer transactions can be queued up on the server side, a
stale value maybe applied for a few frames causing flickers.
Fixes: 194458377
Test: bug repro steps
Test: atest SurfaceViewSyncTest#testSurfaceViewSetFixedSize
Change-Id: I118bd1c3942b389e3951c3fd7389403895fc7b31
This result will be used by Launcher when deciding if we should start
the auto-enter-pip transition.
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/c9raN4jiaNqbiV7DF4YTJ6
Bug: 194272108
Test: try auto-enter-pip with permission disabled
Change-Id: Iea3a45fd68b54d74e7d5da91b63684c206a0132e
This CL mechanically moves InputBindResult from
com.android.internal.view
to
com.android.internal.inputmethod
without changing any observable behavior.
Bug: 192412909
Test: presubmit
Test: No lint error under core/java/com/android/internal/inputmethod
Change-Id: Ifd68c8a0a0d1b410c9a480ad39ca470fe2da5bc6
This is a follow up CL to my CL [1], enabled TextServicesManager to
determine the target user ID by Context#getUser().
This CL aims to clarify what methods in TextServicesManager follow
this semantics.
Note that @UserHandleAware is still a kind of hint for readers. There
should be no change at the runtime.
[1]: I31dda3ae8795190d44b0622b8335c34ddbc5dd48
9f141ee802
Bug: 192412909
Test: presubmit
Change-Id: I00bd99ef9d83a13bd60a5aefd22094725b67e271
This CL aims to clarify on what the return value of
InputConnection#setImeConsumesInput()
means for both the IME authors and editor authors [1][2].
In short, the semantics is exactly the same as
InputConnection#performSpellCheck()
hence this CL reuses its @return section.
Other than clarifying an API doc, this CL changes nothing.
[1]: Ic04cacfd73f1f4cb254bb16caf6b04c00c91a318
30fe6aa964
[2]: I8ac1ea4d53f747b0086ed415ff90793dfc6155bc
66b21086e3
Bug: 175362887
Fix: 194099171
Test: presubmit
Change-Id: Ibdfe81a9dd1448856797aaed2f14de1314da1cac
Merged-In: Ibdfe81a9dd1448856797aaed2f14de1314da1cac
(cherry picked from commit f9ca70be57)
MediaProjection is used by apps to capture the contents of
a display. Apps consume the content from a surface passed
in to MediaProjection#createVirtualDisplay. The images
written out to the surface can be used for saving
screenshots of the current display, screen recording,
or casting to a different display.
MediaProjection is currently tied to capturing a physical
display. This change instead captures the DisplayArea
the app is launched on. This is consistent with Display API
sandboxing, which returns the DisplayArea bounds rather
than the physical display bounds.
Note that apps use the Display APIs to size the
VirtualDisplay and output surface.
Verified: screenshots, screen recording, and casting
Bug: 180624777
Test: atest WmTests:DisplayContentTests
Change-Id: I909e9d32f573aec33869d9f49d6caffc8d7420aa
These are needed for keyguard transitions. The ones added are:
A NOT requirement which will reject transitions with a matching
change.
The ability to match containers that aren't independent.
Checks for global transition flags as well as individual change
flags.
Match only if container is a task.
Bug: 191799478
Test: atest ShellTransitionTests
Change-Id: I963c6c91cdfc0b71a75ba9656261bb0e237f11f1
- Add a new string array config that stores the unique id of each
display and when loading the cutout configs we first look up the index
of the unique id of the added display in the array and use this index
to load the corresponding cutout configs.
- Add new array configs for every cutout configs.
Bug: 186604541
Test: make, atest LocalDisplayAdapterTest
Test: check the device and see if the cutout is correctly set for each
display
Change-Id: I038832795c11cd16969caff5031fa1090493b008
Previously, the maximum length the client window can get for the
wrap-content side is the non-decor display width (or height) which
doesn't take the system bar visibilities into account.
This CL gives the wrap-content window more space if any of the system
bars is hidden.
This CL also refines the logic of selecting the fake control target
which is not always the focused window.
Fix: 193978485
Test: Open "Start Recording?" dialog on YouTube in fullscreen mode.
See if the dialog can fill the screen while its content is not
fully displayed.
Swipe down from top, and see if the dialog is shifted down.
Change-Id: I3f7a71729196311e8f7406c6e07f68d23febe9a6
- Add a new string array config that stores the unique id of each
display and when loading the cutout configs we first look up the index
of the unique id of the added display in the array and use this index
to load the corresponding cutout configs.
- Add new array configs for every cutout configs.
Bug: 186604541
Test: make
Test: check the device and see if the cutout is correctly set for each
display
Change-Id: I038832795c11cd16969caff5031fa1090493b008