Commit Graph

16591 Commits

Author SHA1 Message Date
John Reck
bd78fd02de Merge "Don't animate invisible views" into sc-dev 2021-05-05 18:19:40 +00:00
Joanne Chung
bd351242a9 Merge "API feedback: seperate start and resume state for UiTranslationStateCallback" into sc-dev 2021-05-05 06:36:24 +00:00
Joanne Chung
8e9d678ff0 API feedback: seperate start and resume state for UiTranslationStateCallback
Bug: 185274258
Test: manual
Test: atest android.translation.cts.UiTranslationManagerTest

Change-Id: Ic2246a9ef64a214ce39e187056a9add56e616d1a
2021-05-05 12:31:25 +08:00
Lucy Chang
bb52fabf07 Merge "Correct typo in TYPE_SYSTEM description" into sc-dev 2021-05-05 03:36:26 +00:00
Lucy Chang
4bdb297c10 Merge "Clarify javadoc for ACTION_LONG_CLICK" into sc-dev 2021-05-05 03:17:36 +00:00
Nader Jawad
603d612707 Merge "Update hole punch logic in HWUI" into sc-dev 2021-05-05 02:59:18 +00:00
Adam He
20e9693c3e Merge "Remove logging of translation requests/responses/chat related views." into sc-dev 2021-05-05 01:26:30 +00:00
John Reck
12bb4739d2 Don't animate invisible views
Bug: 184230269
Test: wasn't
Change-Id: Iec6eefedc2c82750ea721ae3d1184be1939066ef
2021-05-04 13:53:01 -04:00
Joanne Chung
2c6a3b5cd0 Merge "Fix UiTranslationStateCallback crash due to null locales." into sc-dev 2021-05-04 13:26:01 +00:00
Jorim Jaggi
a4d6988f12 Merge "Mark first frames in metrics properly" into sc-dev 2021-05-04 10:55:59 +00:00
lucychang
272103f2b7 Correct typo in TYPE_SYSTEM description
Correct typo in TYPE_SYSTEM description

Bug: 149000879
Test: manual test
Change-Id: Id98036af9b23de31e0980c80129c0d69452ccfa7
2021-05-04 16:34:35 +08:00
lucychang
de719fd8cf Clarify javadoc for ACTION_LONG_CLICK
Clarify in javadoc that ACTION_LONG_CLICK does not include coordinate
information.

Bug: 179692809
Test: manual test
Change-Id: I6a4edda48e140f9ba444fdef67feca4d3ed3d146
2021-05-04 15:26:37 +08:00
Ahaan Ugale
e19085a0cd Fix UiTranslationStateCallback crash due to null locales.
The locales aren't available on a RESUMED event; now they're stored on a
STARTED event. The crash happens because the default Callback impl
converts the Locale to a string to support a deprecated method.

Fix: 186392998
Test: manual - install test apk which triggers the crash. no crash with
 this change.
Change-Id: Iaceca8d29f4c2b0d692c8f6780b0ab963e4e2243
2021-05-04 05:35:26 +00:00
Nader Jawad
197743ff9c Update hole punch logic in HWUI
--Updated HWUI holepunch logic for SurfaceView to
also apply the stretch to the hole punch
--Updated RenderNode callbacks to also include
an offset from the ancestor RenderNode that also
has a stretch configured on it
--Added new test activity to verify hole punch
logic

Bug: 179047472
Test: manual
Change-Id: Ibbaf8248a31839ba9dc352ecb9fef54e1276918e
2021-05-03 18:08:47 -07:00
Adam He
7fa1b19c86 Remove logging of translation requests/responses/chat related views.
Bug: 176208267
Test: manual verification
Change-Id: Id76ac895c263a32506df6a6dc6a09495904e20cb
2021-05-03 17:29:10 -07:00
Nikita Dubrovsky
f3c059b9f0 Merge "Release drag-and-drop URI permissions on gc if not tied to an activity" into sc-dev 2021-05-03 21:53:10 +00:00
Nikita Dubrovsky
f333d26f0d Release drag-and-drop URI permissions on gc if not tied to an activity
The implementation for drag-and-drop provides two ways of taking URI
permissions: a public API that ties permissions to an activity and
an internal API that grants "transient" permissions. The latter is
used in a single code path: dropping content into an editable
TextView (implemented in android.widget.Editor).

The transient code path was previously (Android R and below)
implemented using a try/finally block in Editor.onDrop. The change
I7ae38069fb741925211b42c7ff28784eb9722ce3 had updated that logic to
tie permissions to the app process lifecycle instead, to account for
the new OnReceiveContentListener which apps can use to implement
custom drop handling (and use a background thread to do the processing
of the content). The problem with having permissions tied to the app
process lifecycle is that the app process could potentially be
long-running.

This change updates the logic to tie transient permissions to the
DragAndDropPermissions object lifecycle (release whenever there are no
more reference to the object and it is garbage collected). This
follows the same approach as used for IME permission grants
(InputContentInfo.java and InputContentUriTokenHandler.java).

Bug: 181178998
Test: atest CtsWindowManagerDeviceTestCases:CrossAppDragAndDropTests
Test: Manually verified using development/samples/ReceiveContentDemo
Change-Id: I950d4572ee19af64da1ace1572fe12e17d09c609
2021-05-03 16:36:56 +00:00
TreeHugger Robot
fe4a41f16b Merge "Fix SurfaceControl.setDisplayBrightness error msg" into sc-dev 2021-05-03 16:02:07 +00:00
Jorim Jaggi
9516605d63 Mark first frames in metrics properly
Such that we only set the flag in case window visibility actually
changes. There are a lot of other cases where we need to do a
window relayout which can lead to visible jank.

Test: FrameMetricsListenerTest, manual
Bug: 185902609
Change-Id: Ia09ce640f3a89bf9dd4ff0f4e4469e88a513709a
2021-05-03 15:49:25 +02:00
TreeHugger Robot
096c8547d3 Merge "Make IInputMethodManager#reportActivityViewAsync() truly async" into sc-dev 2021-05-01 07:51:21 +00:00
Zhomart Mukhamejanov
4266933cb0 Fix SurfaceControl.setDisplayBrightness error msg
Bug: 178088604
Test: Run on a device and take bugreport to see the crash value
Change-Id: I1ef892c2287bd998d8fdce6b6760db09218affa7
2021-04-30 18:27:07 -07:00
Nikita Dubrovsky
686e4780e3 Merge "Update ContentInfo to implement Parcelable" into sc-dev 2021-05-01 00:25:24 +00:00
Yohei Yukawa
4baf2915d8 Make IInputMethodManager#reportActivityViewAsync() truly async
It turns out that IInputMethodManager#reportActivityView() [1], which
was added a few years ago to support CursorAnchorInfo API on edit
fields hosted on an ActivityView [1], is now also used by task
organizer [2].  This means that we would continue living with this
@hide API for a while even after ActivityView gets completely removed
at Bug 179161778.  Then, converting this IPC into truly asynchronous
would probably make sense.

There should be no behavior change unless the target IME client is
running on an embedded display environment.

 [1]: Id0411a80456182111bb5b681c6d1230b58e7ec2e
      b4f328a2f3
 [2]: Id422bb2547197c617f914ed7cf5085e02a1c3fb5
      a1f869d10e

Fix: 186874025
Test: atest CtsWindowManagerDeviceTestCases:ActivityViewTest
Change-Id: I0463e8e9daaa8ab6d3eadb395843ca5e6bc1bb5e
2021-04-30 12:29:39 -07:00
Nikita Dubrovsky
5177dab6e1 Merge "Improve javadoc for OnReceiveContentListener.onReceiveContent" into sc-dev 2021-04-30 18:22:34 +00:00
Nikita Dubrovsky
ac3b7aafc9 Improve javadoc for OnReceiveContentListener.onReceiveContent
Bug: 186693629
Test: Presubmit only
Change-Id: I153a375b9e97e1c28cbe683b907adae0e813d9af
2021-04-30 11:14:54 -07:00
Nikita Dubrovsky
9b9b00ff46 Update ContentInfo to implement Parcelable
Bug: 186683314
Test: atest CtsViewReceiveContentTestCases:ContentInfoTest
Change-Id: I59376947cfa8dad5d2021cb1d2f5c121a1f90596
2021-04-30 11:09:04 -07:00
TreeHugger Robot
ed17f3e2c7 Merge "Change clearEvents() to clear existing events rather than setting mEvents to null to remove possible NPE." into sc-dev 2021-04-30 00:29:02 +00:00
Taran Singh
2fef6def9a Merge "Add log for showSoftInput called from Insets API" into sc-dev 2021-04-29 22:41:26 +00:00
Adam He
1acd0739fa Change clearEvents() to clear existing events rather than setting
mEvents to null to remove possible NPE.

* clearEvents() needs to be called by destroy() which could cause race
condition on whether mEvents is null for other func calls.

Fixes: 185162720
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I7330e651bc890c8a86822158efcf17a61e927112
2021-04-29 13:56:58 -07:00
TreeHugger Robot
9936b8cbf1 Merge "Expose test APIs on ContentInfo and add CTS coverage" into sc-dev 2021-04-29 19:36:11 +00:00
TreeHugger Robot
d708154ede Merge "Rename Battery to BatteryState." into sc-dev 2021-04-29 16:30:16 +00:00
TreeHugger Robot
00ea5427b6 Merge "Fix pass null TranslationCapability to dispatchRequestTranslation()" into sc-dev 2021-04-29 10:29:56 +00:00
Joanne Chung
be4bdf0a11 Fix pass null TranslationCapability to dispatchRequestTranslation()
We only provide text-text capability now and when the UiTranslation
APIs are called, the model files should be ready. To simplify the call
flow, we hardcode the TranslationCapability now. If more capabilities
are supported, we will call the API to get the TranslationCapability.

Bug: 183589662
Test: atest CtsTranslationTestCases

Change-Id: Iea1baac7988402298b2577d03adf9d889f45ad53
2021-04-29 15:08:58 +08:00
TreeHugger Robot
f38abb5943 Merge "Add traces in ViewRootImpl handler" into sc-dev 2021-04-29 04:49:10 +00:00
Chris Ye
c9b9464ad8 Rename Battery to BatteryState.
Rename Battery to BatteryState, and rename the method hasBattery to
isPresent.
Return NaN in getCapacity() if capacity can not be read.

Bug: 180733860
Test: atest android.hardware.input.cts.tests

Change-Id: I8e855be0b263479c2744b817df5f591c9d1e4a64
2021-04-28 16:08:39 -07:00
Nikita Dubrovsky
b3a2e3f34c Expose test APIs on ContentInfo and add CTS coverage
Bug: 183643556
Test: atest CtsViewReceiveContentTestCases:ContentInfoTest
Change-Id: I65e8fbab27433584590366292ed79d230c1b95e5
2021-04-28 11:55:49 -07:00
Taran Singh
11472f70b4 Add log for showSoftInput called from Insets API
Add a debug log to identify calls to showSoftInput from Insets API.

Fix: 1865976
Test: manually using steps:
      1. Use an app like launcher that uses Insets API to show IME.
      2. dump using adb shell dumpsys input_method
      3. Verify log.
      4. use another app that shows IME using showSoftInput like gmail
      5. verify the log

Change-Id: I6ba0d3f7912855f31e033735557b44eeed3e6652
2021-04-28 18:30:25 +00:00
Jagadeesh Pakaravoor
525caa44ce Add traces in ViewRootImpl handler
Add traces to show what messages are currently being handled inside
ViewRootImpl's handler.

bug: 184951839
Test: presubmit
Change-Id: I00c04250b3ea00fb32473d9fa35390510e8692c5
2021-04-28 09:39:19 -07:00
Yohei Yukawa
1d14a33860 Merge "Make IInputMethodPrivilegedOperations to async (4/N)" into sc-dev 2021-04-28 15:45:58 +00:00
Wilson Wu
78a23141be Make IInputMethodPrivilegedOperations to async (4/N)
-. Remove VoidResultCallback of updateStatusIcon
   and let it be truly asynchronous.
-. Rename this method to updateStatusIconAsync.

Bug: 183587528
Test: atest CtsInputMethodTestCases
Change-Id: Ic7759354ec06a3293ea370ab7afe7422eb2d9356
2021-04-28 12:56:38 +08:00
TreeHugger Robot
2d41f53291 Merge "Changed createOnDeviceTranslator to be asynchronous with callback." into sc-dev 2021-04-27 21:40:44 +00:00
Adam He
50a637b1e5 Changed createOnDeviceTranslator to be asynchronous with callback.
Bug: 176208267
Test: atest CtsTranslationTestCases
Change-Id: Icedc953611e70dc208cbef54b4e459ebb0ccd5a9
2021-04-27 11:56:30 -07:00
TreeHugger Robot
89126b252c Merge "Add debug log for showSoftInput" into sc-dev 2021-04-27 18:02:04 +00:00
Marin Shalamanov
deb3ccf048 Merge "Update javadoc for setFrameRate" into sc-dev 2021-04-27 15:56:08 +00:00
Ming-Shin Lu
b7e4b7c279 Add debug log for showSoftInput
As CL[1] added the reason field in showSoftInput to expose where the
show request comes from.

Refine the original showSoftInput debug log from CL[2] to add the
reason for helping the issue clarification.

[1]: I390dc029e7bcc30c200926a9bfbbbd0268a1f714
[2]: I67a790f9d98d6131aaf04e4bb98d2a28873d3424

Bug: 182071625
Bug: 171827834
Test: adb logcat -s InputMethodManager:D
Change-Id: I73ab4e2b856669b6b6922ee451da1819e5ca18f4
2021-04-27 23:22:54 +08:00
Marin Shalamanov
c48e5da476 Update javadoc for setFrameRate
Explicitly state that when fps=0 the other two parameters
of setFrameRate are ignored.

Bug: 161776961
Test: n/a
Change-Id: If5ecbbf053aa59071f19f6c7ba9ae0af9f15451b
2021-04-27 14:31:27 +02:00
Wilson Wu
5577a28e2d Merge "Enable USE_REPORT_WINDOW_GAINED_FOCUS_ASYNC" into sc-dev 2021-04-27 06:32:17 +00:00
Ming-Shin Lu
20f2cdd39a Merge "Consolidate InputMethodManager#toggleSoftInput reliability" into sc-dev 2021-04-27 02:32:35 +00:00
TreeHugger Robot
ecfc497460 Merge "Async startInputOrWindowGainedFocus" into sc-dev 2021-04-26 19:06:26 +00:00
Ming-Shin Lu
2c8068c98a Consolidate InputMethodManager#toggleSoftInput reliability
As previously InputMethodManager#toggleSoftInput is designed to tell
InputMethodService directly through IInputMethodSession to toggle
soft-keyboard visibility, this could be happened some unexpected IME
visibility issues that when the app calling this method in the wrong
state like the app toggling IME visibility when the app is off-screen
but unexpectedly it ends up showing soft-keyboard when the IME is in
invisible state.

To minimize the app compatibility without changing the public API
surface and reducing unexpected IME visibilty been toggled behavior
especially happens when switching the apps, changed the internal IPC
protocols to call IMMS#showSoftInput or IMMS#hideSoftInput directly
according the previous IME consumer requested visibility state,
so that in IMMS side can validate to see if the token user is
still focused and ready to toggle the IME visibility to show or hide.

As the result, we deprecated toggleSoftInput and
toggleSoftInputFromWindow to state the reason as the above, and
recommand to use showSoftInput or hideSoftInputFromWindow instead,
so that framework side no longer has to call {InputMethodSessionWrapper,
InputMethodSessionImpl}#toggleSoftInput.

Bug: 182071625
Test: m checkapi doc-comment-check-docs
Test: atest KeyboardVisibilityControlTest#testToggleSoftInput
Change-Id: I390dc029e7bcc30c200926a9bfbbbd0268a1f714
2021-04-27 01:34:12 +08:00