Commit Graph

2468 Commits

Author SHA1 Message Date
TreeHugger Robot
01d9441cec Merge "Update docs to clarify how providers can create style bundles and Slices for inline suggestions." into rvc-dev am: 18cff6082d am: 6128b1ba0f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12265211

Change-Id: I83317ac5a0f2d33ff2403a0b3777f06a15fc347b
2020-08-18 00:35:23 +00:00
TreeHugger Robot
6128b1ba0f Merge "Update docs to clarify how providers can create style bundles and Slices for inline suggestions." into rvc-dev am: 18cff6082d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12265211

Change-Id: Ib0e9657c1d796cfcf9f5aa89709b9ad357d81f23
2020-08-18 00:24:55 +00:00
Adam He
5277e0781d Update docs to clarify how providers can create style bundles and Slices
for inline suggestions.

Fixes: 162437790
Test: atest android.autofillservice.cts.inline
Change-Id: If02b34ec7978897545c0b7eabfebb8db0b9417c0
2020-08-03 13:06:38 -07:00
Jeff DeCew
206e7d747e Prevent bell icon from disappearing on immediate followup notification.
The Ranking object of a notification update has lastAudiblylertedMs of
-1 if the notification did not buzz because a buzz happened within the
last 5s.  This causes the bell icon to disappear on a conversation
where a person posted twice within 5s. This is resolved by copying the
lastAudiblyAlertedMs from the NotificationEntry's existing Ranking when
setting a new one, if the new Ranking's value is -1.

Bug: 156887617
Test: Update an alerting notification within 5s of update which caused an alert; bell should stay even though buzz is skipped.
Change-Id: Ibb72ab27c88cfa57add781e2746fff0eee5de6be
2020-07-07 16:19:03 -04:00
Ahaan Ugale
5085f4bbf1 Merge "Do not replace the authenticated dataset for pinned inline suggestion" into rvc-dev am: 913b610e53
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12001033

Change-Id: Ia62ed8b1f9a1d3af9973588005192bd642a69c99
2020-06-29 23:59:02 +00:00
Feng Cao
32cfac9ed7 Do not replace the authenticated dataset for pinned inline suggestion
* For the case where the pinned inline suggestion triggers an
  pending intent through the auth flow, and it returns a dataset
  to be autofilled, previously we would replace the existing
  dataset with the returned dataset. However, this is causing
  several potential issues:
  1. if the returned dataset doesn't contain inline presentation
     the the pinned icon will not show again
  2. if the returned dataset contains inline presentation but not
     the pending intent, then the pinned icon will show up again
     but tapping on it will not launch the pending intent
  3. if the returned dataset contains the inline presentaion and
     the pending intent, then when we "autofill" it, it'll fire
     the pending intent directly as opposed to filling in the
     value
* We fix the issue by not replacing the old dataset if the dataset
  is a pinned inline suggestion.
* One caveat of the approach is that: a dataset can potentially
  have multiple fields, and it's possible that some of the fields'
  has inline presentation and some don't. It's also possible that
  some of the fields' inline presentation is pinned and some isn't.
  So the concept of whether a Dataset is pinned or not is
  ill-defined. Here we say a dataset is pinned if any of the field
  has a pinned inline presentation in the dataset. It's not ideal
  but hopefully it is sufficient for most of the cases.
* An alternative approach is to have the autofill provider telling
  whether they want to replace the old dataset or not, through
  a new field in the returned Bundle. But that requres an API change
  so is infeasible at this time.

Test: atest android.autofillservice.cts.inline
Test: atest android.autofillservice.cts.augmented
Test: atest android.autofillservice.cts.LoginActivityTest
Test: atest android.autofillservice.cts.AuthenticationTest
Bug: 159367101

Change-Id: I6d162aeb88a4655989c1aa315df8304c0980ac60
2020-06-25 17:39:13 -07:00
TreeHugger Robot
29c7295caf Merge "Release remove inline suggestion views when session destroyed" into rvc-dev am: 6e3a4d7625
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11972118

Change-Id: Iea1d860438282cc334f179f57eb9a8302500080e
2020-06-24 05:37:58 +00:00
TreeHugger Robot
6e3a4d7625 Merge "Release remove inline suggestion views when session destroyed" into rvc-dev 2020-06-24 05:31:34 +00:00
Feng Cao
17ca1ee84e Release remove inline suggestion views when session destroyed
* Attach to each inline suggestion remote view the user id
  and session id, which together identify a session. Then when
  the session is destroyed, we release all the remote views
  associated with the it.
* Worst scenario is that the IME is still showing the UI when
  the remote view is released due to session destroy, in which
  case the suggestion will disappear from the IME window. But
  we also make sure we send an empty response to IME before
  releasing the views, so it should be bad. Plus when a session
  is destroyed, interacting with the suggestion UI doesn't do
  anything, so it's not very helpful to show them.
* Also add a dump method to the InlineSuggestionRenderService
  to help with debugging

Test: atest android.autofillservice.cts.inline
Bug: 154683107

Change-Id: I488fd9d9af08d0df3ffd3c851f96c567d07eed5a
2020-06-23 19:17:42 -07:00
TreeHugger Robot
7bbfde8105 Merge "Add information about requestAddControl" into rvc-dev am: c139a0071a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11973250

Change-Id: I7233d74250ce5c8ddf3d0abc95329d09578d1d52
2020-06-23 22:36:25 +00:00
Fabian Kozynski
e134edc497 Add information about requestAddControl
Add possible conditions under which SystemUI may not prompt the user to
add a control.

Test: no test
Fixes: 159728016
Change-Id: I143e50cc15397d85b4212d9fb29d64df7c2de80c
2020-06-23 15:48:10 -04:00
TreeHugger Robot
19ccb788ca Merge "Add try-catch for the augmented autofill UI to avoid crashing" into rvc-dev am: c5c35fc376
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11863064

Change-Id: I4645c45fdc687e6918c9c4cd9ab5a90be4d1959a
2020-06-18 16:36:34 +00:00
TreeHugger Robot
c5c35fc376 Merge "Add try-catch for the augmented autofill UI to avoid crashing" into rvc-dev 2020-06-18 16:36:10 +00:00
TreeHugger Robot
a54af2ac7d Merge "Controls API - Update template docs" into rvc-dev am: e1ed6dcf57
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11898402

Change-Id: I5e2fb272c013e69438f9e6e1368de51fc41125fe
2020-06-18 15:10:31 +00:00
TreeHugger Robot
0f8c23b4f2 Merge "Callback the surface package after the views are drawn locally" into rvc-dev am: cf5f65cbe3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11607123

Change-Id: Iebda003f603bcfc10184c106cccab39c0c490baf
2020-06-18 14:59:29 +00:00
Wei Sheng Shih
8577b21235 Merge "Force relayout when wallpaper engine become visible." into rvc-dev am: ec30716a6b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11863063

Change-Id: I6f2857712f9700be6d00699110bcb7dfae6a65d0
2020-06-18 14:52:54 +00:00
TreeHugger Robot
9d098aaaf1 Merge "Fix a bug to not complete the augmented autofill request when fill window is shown" into rvc-dev am: 79f38179de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11876607

Change-Id: If65cba02b7d6c42d0764de05b7ab293de6fcf78e
2020-06-18 14:39:19 +00:00
TreeHugger Robot
e1ed6dcf57 Merge "Controls API - Update template docs" into rvc-dev 2020-06-18 14:33:24 +00:00
Matt Pietal
68943be01d Controls API - Update template docs
Add more clarity around which control template to select.

Fixes: 150630500
Test: manual
Change-Id: I215e485e1cf81aae7e2c6c8b469945069136aad8
2020-06-18 08:03:44 -04:00
TreeHugger Robot
cf5f65cbe3 Merge "Callback the surface package after the views are drawn locally" into rvc-dev 2020-06-18 11:03:17 +00:00
Wei Sheng Shih
ec30716a6b Merge "Force relayout when wallpaper engine become visible." into rvc-dev 2020-06-18 08:21:58 +00:00
Feng Cao
ffd9affb74 Callback the surface package after the views are drawn locally
* SurfaceControlViewHost#setView() method will post a task to the
  main thread to draw the view. We want to callback the surface
  package to the remote process after the view is drawn and ready
  to be shown, to avoid the flicker when the remote process attaches
  it to their window when it's not drawn.

Test: atest android.autofillservice.cts.inline
Bug: 157515522

Change-Id: Ia75baaf9d6a4770a783dfc75ebb01b4b6e62e180
2020-06-17 23:57:11 -07:00
lpeter
d0bd08b4b9 Add try-catch for the augmented autofill UI to avoid crashing
It is hard to reproduce this issue, it would better add try-catch
for the augmented autofill UI as regular autofill UI did.

Bug: 149744098
Test: atest CtsAutoFillServiceTestCases
Change-Id: I808ac48476ef96b8944e762dd5c41413da3a2c2e
2020-06-17 14:06:08 +08:00
wilsonshih
5cac2a0279 Force relayout when wallpaper engine become visible.
After 9118c9b the surface can be destroy after the window state become
invisible, since WallpaperService copy the surface from WMS and it is
not implement with ViewRootImpl, WallpaperService#Engine should call
relayout to get new surface when client need to redraw it.

Bug: 158955956
Test: verify the wallpaper can show by launch LiveWallpaperChange with
live wallpaper and push/pull it from recents several times.
Test: atest WallpaperServiceTest ImageWallpaperTest

Change-Id: I79f97df61696eea325183e9b9057cbb10ce8cc66
2020-06-16 12:00:24 +08:00
Feng Cao
5d6243e47a Fix a bug to not complete the augmented autofill request when fill window is shown
* The bug was introduced in ag/11784240 causing the existing CTS test to
  fail: android.autofillservice.cts.augmented.AugmentedLoginActivityTest
  #testCancellationSignalCalled_retriggerAugmentedAutofill
* Basically when the dropdown fill window is displayed, we should not mark
  the augmented autofill request as complete

Test: atest android.autofillservice.cts.augmented
Test: atest android.autofillservice.cts.inline
Bug: 158864213
Bug: 158038231

Change-Id: Ifb75189c1ba3183c99516bfb9a7053524f4bbddc
2020-06-15 20:23:17 -07:00
TreeHugger Robot
df58dcf081 Merge "Controls UI - Tap for NO_TEMPLATE" into rvc-dev am: d6fb5e2151
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11850954

Change-Id: I13e5ed74ac82b79a7b72511b55c02cb6ad4c6573
2020-06-12 17:22:24 +00:00
Matt Pietal
733d637879 Controls UI - Tap for NO_TEMPLATE
Allow single taps as well as long press to launch the detail panel
when no template is specified.

Fixes: 158773087
Test: ControlsMockApp, any default type
Change-Id: I4d5451f6a5968d8dd223eb5b10d931ad60aad951
2020-06-12 11:59:57 -04:00
TreeHugger Robot
b205b806f1 Merge "Send empty inline response to IME if augmented autofill returns no suggestion" into rvc-dev am: b9aeb6ca22
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11784240

Change-Id: I9f4359377b1ab3866e8fc530a5dc67020e5363a2
2020-06-10 21:59:48 +00:00
TreeHugger Robot
b9aeb6ca22 Merge "Send empty inline response to IME if augmented autofill returns no suggestion" into rvc-dev 2020-06-10 21:56:03 +00:00
TreeHugger Robot
6f629d1629 Merge "pulled atom for Do Not Disturb configuration" into rvc-dev am: 5599ca731f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11494623

Change-Id: Ia2a6641039579516452b2b200b6fbab809e4d885
2020-06-10 02:48:38 +00:00
Chris Wren
9316569062 pulled atom for Do Not Disturb configuration
Bug: 154254547
Test: atest ZenModeHelperTest ZenModeConfigTest ZenPoicyTest
Change-Id: Ibfcf0f8034b049b1ec790d243e8cb06d71224063
2020-06-09 20:17:10 -04:00
Feng Cao
1e0e1238e0 Send empty inline response to IME if augmented autofill returns no suggestion
* The augmented autofill may dynamically request an autofill request
  which will "invalidate" the old suggestions. In case the new request
  doesn't return any suggestions, we need to make sure the old
  suggestions are removed from the IME.
* See the scenario in https://b.corp.google.com/issues/158038231#comment14

Test: manual
Test: atest android.autofillservice.cts.inline
Bug: 157515522
Bug: 158038231

Change-Id: If85592395ad918197566a5ca556fba8ccc971071
2020-06-07 16:17:40 -07:00
Matt Pietal
3c731d4928 Merge "Controls UI - Handle 'not found' better" into rvc-dev am: 8761fbb501
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11738038

Change-Id: I97687ddc6194d0e76313e6935cfec9920f4492ce
2020-06-04 23:32:59 +00:00
Matt Pietal
370db8771d Controls UI - Handle 'not found' better
Show a more informative error to the user on touch/long press about
how to handle this situation. Properly animate status changes.

Fixes: 154737944
Test: TYPE_DISPLAY in mock app simulates not found error
Change-Id: I15ce2d2621ea29c97936f9d9022d917637693288
2020-06-04 17:20:42 -04:00
TreeHugger Robot
5c14c53394 Merge "Fix a bug to handle the touch ACTION_DOWN properly when inline suggestion view is obscured" into rvc-dev am: 931c0ce463
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11712623

Change-Id: I2f5d69c14649e80c870d43f731badd7442d8dffb
2020-06-03 17:44:17 +00:00
Feng Cao
2db11209c6 Fix a bug to handle the touch ACTION_DOWN properly when inline suggestion view is obscured
* if the user taps quickly such that there is only ACTION_DOWN and
  ACTION_UP, without ACTION_MOVE, it'd be possible that the
  isSecure check is not  respected. This patch fixes that case.

Test: atest android.autofillservice.cts.inline
Bug: 157772682
Bug: 158038231

Change-Id: Icd21bf2f88259673bb9b20e46e63672648495eac
2020-06-02 22:08:11 -07:00
Zimuzo Ezeozue
d371efcfb2 Merge "Support apps sharing file:// URIs with the camera API" into rvc-dev am: efbc3f2d5e
Original change: undetermined

Change-Id: I82ce2d45bc194420d34866483b5b1af06f27563c
2020-06-02 10:49:53 +00:00
Zimuzo Ezeozue
efbc3f2d5e Merge "Support apps sharing file:// URIs with the camera API" into rvc-dev 2020-06-02 10:45:33 +00:00
Zim
c7496a3a62 Support apps sharing file:// URIs with the camera API
The camera API, MediaStore.ACTION_IMAGE_CAPTURE requires apps to pass
a content:// URI with write permissions to the camera. Unfortunately,
apps haven't been doing this and we only started hitting problems in R
for two reasons:
1. The FileUriExposedException that should crash apps when they try to
share file:// URIs acroos binder is skipped. This is because, the
image_capture intent is passed across binder as a field in a
ChooserActivity Intent and the child intents are not checked for
file URI exposed
2. Prior to R, when camera gets a file:// URI, camera issues a file
open(2) in its process. This open(2) succeeds because the camera had
write_external_storage permission which gave it write access to all
files on external storage

Now, camera targets R and (2) fails because camera does not have write
access to files owned by other apps. To workaround, we do the
following in the apps process when it targets < R:
a. When we detect a file:// URI for the camera in an Intent, we create
the file on disk if it is not already created.
b. Scan the file to insert it in the database and retrieve a
content:// URI
c. Replace the file:// URI with the content URI in the image_capture
intent

This works because, the system will ensure the camera is granted write
access to the content URI.

Test: Manual
Bug: 156336269
Change-Id: I4849ff5e806a8207650ff7534846c36ecdc6d3c0
2020-06-01 20:33:52 +01:00
Yara Hassan
6dd5caab66 Add finish() method to DataShare Read and Write Adapters am: dc699fb8ce
Change-Id: I747217a8f7808a9dec4d5fb03daeeaec0bc107a8
2020-05-29 23:50:57 +00:00
Yara Hassan
dc699fb8ce Add finish() method to DataShare Read and Write Adapters
The finish() method is used to clear hard references after
the data copy has ended. This fixes a bug where the references are cleared before onError() is attempted to be called.

Test: CTS tests in followup CL
Bug: 157136368
Fixes: 157136368
Change-Id: If924fe388762831af90579e6b00bdf223230e203
2020-05-29 14:35:13 -07:00
TreeHugger Robot
181c47ad64 Merge changes from topic "controls_config" into rvc-dev am: 61d46be2c2
Change-Id: Ifcba3a0e09e93748dfcad14d1baaab20d430885f
2020-05-29 18:14:50 +00:00
Matt Pietal
1f7c8174f0 Controls UI - Support seeding for up to 6 structures
Limit to 36 controls: 6 structures with up to 6 controls per structure

Fixes: 153606605
Test: atest ControlsControllerImplTest

Change-Id: Ieddceda4a0902e4b42208680c7a77ee03514a16c
2020-05-29 08:15:35 -04:00
TreeHugger Robot
8ab975d0c7 Merge "Fix cts fail for android.autofillservice.cts.augmented" into rvc-dev am: a76f65614e
Change-Id: I6ec351ebd408e791bb67e43c996fb9af8202e185
2020-05-12 20:33:15 +00:00
lpeter
8e815316dd Fix cts fail for android.autofillservice.cts.augmented
In the test we trigger the manual autofill request programmatically,
because the focus isn't on the field, we will not get the callback
from IME.
It would be better not to ask IME for inline request if the request
is manual and the view is not focused because it's a simpler/safer
approach and manual request without focus should be rare.

Bug: 154661868
Test: atest CtsAutoFillServiceTestCases
Change-Id: I783b2542094cdea547ebd58ce89f30d9cd421708
2020-05-12 13:47:54 +00:00
Feng Cao
f9748230fd Merge "Support re-attaching the inline suggestion view to window" into rvc-dev am: 254545cae5
Change-Id: I7a7655f90cdbf924635d6bcd48898fbd22aec1eb
2020-05-07 05:28:51 +00:00
Feng Cao
254545cae5 Merge "Support re-attaching the inline suggestion view to window" into rvc-dev 2020-05-07 05:23:15 +00:00
Riddle Hsu
4dfd3dcd3a Merge "Do not stop dream service if dream activity is relaunching" into rvc-dev am: b76f9472df
Change-Id: I5d0b57b38d31f6f466ef1ecf1b63b5e3a98248de
2020-05-07 04:59:11 +00:00
Riddle Hsu
b76f9472df Merge "Do not stop dream service if dream activity is relaunching" into rvc-dev 2020-05-07 04:51:38 +00:00
Feng Cao
b46851c964 Support re-attaching the inline suggestion view to window
* Before this change, when the inline suggestion view is detached from
  the IME window (e.g. due to layout change), the remote view content
  will not show again even after the view is reattached to the window
  on the IME side. This patch fixes it by requesting the remote view
  owner (the ext services) for a new SurfacePackage when the view is
  re-attached to the window (see javadoc of SurfaceControlViewHost for
  why this works).
* This patch also fixes the issue where the SurfaceControlViewHost was
  never released in the ext services. This is done by notifying the
  ext services (through system server) when the view is detached from
  the IME window, and then the system server will release the
  SurfaceControlViewHost if after N(=500) ms the view is not re-attached
  to a window.
* After the SurfaceControlViewHost is released, if the view is
  re-attached to the window later, a new SurfaceControlViewHost will be
  created to back the same InlineContentView.
* The current code structure also lays a foundation for a subsequent
  change to allow reusing the same remote view for inline suggestions
  during filtering.

Test: atest CtsAutofillServiceTestCases (sanity test)

Bug: 153615023
Bug: 154683107

Change-Id: Idc587e1e82a96b792c351796464821b7aad7cd89
2020-05-06 19:30:39 -07:00