Commit Graph

3433 Commits

Author SHA1 Message Date
Tiger Huang
2c45fb8608 Merge "Introduce updateVisibility and updateLayout" into tm-dev am: 0797d97536
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17292204

Change-Id: Ia7f267a328fe65e7adc3390c8a6bc88ab87d48dd
2022-03-24 00:42:35 +00:00
Lucas Dupin
0a5a973b54 Merge "Asynchronously bind/unbind service" into tm-dev am: f4dbcd621f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17188342

Change-Id: I999a9cb5c0feeeeac1cb898e88301ddd0e8ae60d
2022-03-24 00:38:59 +00:00
Tiger Huang
0797d97536 Merge "Introduce updateVisibility and updateLayout" into tm-dev 2022-03-23 17:44:42 +00:00
Lucas Dupin
f4dbcd621f Merge "Asynchronously bind/unbind service" into tm-dev 2022-03-23 17:11:24 +00:00
TreeHugger Robot
49d28c5a9c Merge "[DO NOT MERGE] Remove the Client Suggestions APIs" into tm-dev 2022-03-23 07:25:35 +00:00
Tiger Huang
db407ef12d Introduce updateVisibility and updateLayout
This is a step to let the client layout its window locally. The ultimate
goal is to reduce the jank while laying out the window.

With the new AIDL methods, we can divide IWindowSession.relayout into:

- IWindowSession#updateVisibility (synchronized binder call)
  - To get or update the surface
  - To fetch the latest factors about window-layout
  - Only called when the view visibility is changed

- WindowLayout#computeFrames (local function call)
  - To compute the window frames

- IWindowSession#updateLayout (one way binder call)
  - To report the result of layout to the server

In this way, if the view visibility is not changed, the UI thread of
the client won't be blocked by the binder call during relayout.

The local layout project won't be done in a single CL. In order not to
break the existing logic, this CL introduces a flag: LOCAL_LAYOUT. The
flag will be enabled when the logic of local layout is ready.

Bug: 161810301
Bug: 175861051
Test: presubmit (no behavior change)
Change-Id: Ic4b2fc78a318f3a68e1ef8a35d8f3ab705856702
2022-03-22 23:42:47 +08:00
Lucas Dupin
1ad640ba13 Asynchronously bind/unbind service
Context#bindService can take unreasonably long to execute, causing API
clients to miss frames.

Test: atest TestQuickAccessWalletService
Test: atest QuickAccessWalletControllerTest
Fixes: 218323803
Change-Id: If0278a531b4eb07aad713986315118ac91337b0b
2022-03-21 18:20:16 -07:00
TYM Tsai
0871d02822 [DO NOT MERGE] Remove the Client Suggestions APIs
Bug: 224871426
Test: atest CtsAutoFillServiceTestCases
Change-Id: I178e0443278383120d9e6e3321ec96be8e5705c1
2022-03-22 00:21:12 +00:00
Nicholas Ambur
f71e9ef488 Merge changes from topic "startrecognition-data"
* changes:
  add AlwaysOnHotwordDetector availabilty test API
  expand AlwaysOnHotwordDetection.startRecognition
2022-03-21 22:53:30 +00:00
Dave McCloskey
089538fb92 Merge "Changes to support reducing noise in active unlock notifications." into tm-dev am: c5a7ed29de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17244181

Change-Id: Ic3a4c3707c1b874558ec3d996f6a00ba000d6dc1
2022-03-21 19:36:57 +00:00
Dave McCloskey
c5a7ed29de Merge "Changes to support reducing noise in active unlock notifications." into tm-dev 2022-03-21 19:15:01 +00:00
Dave McCloskey
6c707a47da Changes to support reducing noise in active unlock notifications.
1. Add additional trigger onUserMayRequestUnlock
  - point existing trigger points from SystemUI to this
2. Argument added to onUserRequestedUnlock to indicate if user wants to
   dismiss keyguard.
3. Callback for result of grantTrust calls.
  - curently only calls back if device was unlocked as a result of the
    call

See design: go/au-noise-reduction

Note: changes made to SystemUI are manually tested and may need
refactoring which is being skipped now to meet the API Freeze deadline.

Bug: 225231929
Test: atest TrustTests
Test: Manual interaction with wake & fingerprint sensor
CTS-Coverage-Bug: 213944235
Change-Id: I8d08229f09c9a1f2295b7eb464d12cad0c6b8303
2022-03-21 09:00:43 -07:00
Nicholas Ambur
63f3e1a2c6 add AlwaysOnHotwordDetector availabilty test API
get and override APIs added to manipulate the AlwaysOnHotwordDetector
status for unit testing

Bug: 224638834
Test: atest CtsVoiceInteractionTestCases
Change-Id: Ided57484fdcbb2474b0227ce63103784946ce944
2022-03-21 07:27:07 -07:00
Ayush Sharma
2963bba601 Merge "Fix security hole in GateKeeperResponse" into tm-dev am: f811f765de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17221284

Change-Id: I5e41dc2c3a52296a76cf9c3c35f94ae04a9de5e7
2022-03-21 09:15:41 +00:00
Ayush Sharma
f811f765de Merge "Fix security hole in GateKeeperResponse" into tm-dev 2022-03-21 09:13:24 +00:00
Tiger Huang
c3813c81a0 Merge "Push drag-resize mode to the client" into tm-dev am: 883190cdb3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17222863

Change-Id: Ib2c9262b0229579ebe14f4a5b77986b6efa2045d
2022-03-21 06:08:46 +00:00
Tiger Huang
883190cdb3 Merge "Push drag-resize mode to the client" into tm-dev 2022-03-21 05:51:13 +00:00
Nicholas Ambur
eb4a4114c0 expand AlwaysOnHotwordDetection.startRecognition
an additional byte[] data to the AlwaysOnHotwordDetector
startRecognition class. This data is use a pass-through
to the system voice engine.

Test: atest CtsVoiceInteractionTestCases
CTS-Coverage-Bug: 215375531
Bug: 224638834
Change-Id: I74be65b8718c0d10c69e69ad11a7014cdf55d873
2022-03-20 19:34:43 -07:00
Tiger Huang
3e194cc9fa Push drag-resize mode to the client
The goal of this CL is to remove RELAYOUT_RES_DRAG_RESIZING_DOCKED and
RELAYOUT_RES_DRAG_RESIZING_FREEFORM, which is a step to make relayout an
oneway binder call.

When the resize mode is changed at the server side, the server will send
the new mode to the client via IWindow#resized, so the client doesn't
need to obtain the resize mode from the flags returned from relayout.

Bug: 161810301
Test: Perform drag-resize and drag-move on a freeform task and see if
      there is any unexpected behavior.
Change-Id: I450abc113932b6c1dc0ce0e2b76bebdf85a60777
2022-03-20 14:36:19 +08:00
Kate Xu
dd66055e1f Merge "Provide AutofillService to know how the dataset was shown to user" into tm-dev am: 22971c035e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17229071

Change-Id: I6f282050ffd067d59e30aa5f6518f2a7ee859800
2022-03-20 06:08:29 +00:00
Joanne Chung
f9fafbe617 Provide AutofillService to know how the dataset was shown to user
We introduce a filed for ui presentation in FillEventHistory.Event,
the type will be set for TYPE_DATASET_SHOWN and TYPE_DATASET_SELECTED.
The AutofillService can know which dataset is shown to user and which
type dataset user is clicked.

This change defines the definition and apply to TYPE_DATASET_SHOWN,
the TYPE_DATASET_SELECTED will be implemented on the follow up
change.

Bug: 223472350
Test: manual. build and boot pass. Test app and see dumpsys autofill
CTS-Coverage-Bug: 225310516

Change-Id: Ic221bd79e2ad512db5cd1ef8fd96c6bfae2ca616
2022-03-19 07:22:05 +00:00
Ahaan Ugale
9f4a06f7ed Merge "Allow AutofillService can identify if fill dialog presentation is needed." into tm-dev am: ff1e4a4680
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17229068

Change-Id: I413ee7c38ffdb10699c348151641f1aee515023a
2022-03-19 06:16:24 +00:00
Ahaan Ugale
ff1e4a4680 Merge "Allow AutofillService can identify if fill dialog presentation is needed." into tm-dev 2022-03-19 06:11:51 +00:00
Peiyong Lin
795ee30b3e Merge "Add permission for takeScreenshot API." into tm-dev am: 4bd3214296
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17128299

Change-Id: Ia1450a86bc8cac7b0f7d10ca1cc8eab6201c2774
2022-03-19 01:56:38 +00:00
Peiyong Lin
4bd3214296 Merge "Add permission for takeScreenshot API." into tm-dev 2022-03-19 01:53:16 +00:00
Joanne Chung
23668c560e Allow AutofillService can identify if fill dialog presentation is needed.
If the fill dialog is available for the field, the FillRequest flags
will contain FLAG_ACIVITY_START. The field is hidden originally but
it needs to be get from AutofillService to avoid creating unnessary
fill dialog presentation. Rename the flag because the it's not clear
to combine the relationship with fill dialog.

Bug: 223472039
Test: manual. Build and boot pass.

Change-Id: I52c367e75100f6af2ab782f58755bc5727b1dd72
2022-03-18 22:57:51 +00:00
TreeHugger Robot
d770f0c49c Merge "Remove DisplayHashingService constructor" into tm-dev am: c7af3f3088
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17240649

Change-Id: I74192ea123a1c3773bca96236a4c7511e6828ac4
2022-03-18 18:25:42 +00:00
TreeHugger Robot
c7af3f3088 Merge "Remove DisplayHashingService constructor" into tm-dev 2022-03-18 18:21:11 +00:00
chaviw
4759768c18 Remove DisplayHashingService constructor
There's no need for the constructor and it shows up as missing CTS tests
for it. Rather than adding tests, just remove the constructor.

Test: atest DisplayHashManagerTest
Bug: 220812349
Change-Id: I6104a4955c4ca107820de39d0547d3901d96ca18
2022-03-17 12:47:12 -05:00
Nicholas Ambur
3d1093eefb expand test API for DSP kephrase trigger
Expands the existing test API to include the KeyphraseExtra information
in the fake DSP trigger event.

Test: atest CtsVoiceInteractionTestCases
Test: atest CtsVoiceInteractionHostTestCases
Bug: 193232191
Change-Id: I3392cb37afaed6f67fb2f3b22edcbe7c869d1eba
(cherry picked from commit 46c4ba27d1)
2022-03-16 19:22:27 +00:00
Ayush Sharma
46653a91c3 Fix security hole in GateKeeperResponse
GateKeeperResponse has inconsistent writeToParcel() and
createFromParcel() methods, making it possible for a malicious app to
create a Bundle that changes contents after reserialization. Such
Bundles can be used to execute Intents with system privileges.

We fixed related issues previously for GateKeeperResponse class, but
one of the case was remaining when payload is byte array of size 0,
Fixing this case now.

Bug: 220303465
Test: With the POC provided in the bug.
Change-Id: Ida28d611edd674e76ed39dd8037f52abcba82586
2022-03-16 18:04:03 +00:00
Scottie Biddle
71bd41ce92 Add getter for useTargetActivityForQuickAccess.
Since this is hardcoded XML metadata, the implementation of this method
reads the XML metadata to derive a value.
If there are any errors in reading the metadata, the method returns
false.
The method is final, because subclasses should not be able to change this.

This is in response to API council feedback.
CTS tests are included in the same topic.

Bug: 218860062
Test: atest QuickAccessWalletServiceTest

Change-Id: I7bb53f73b836b0b17a723394a6abf2c3df1c8b38
2022-03-15 14:18:47 -07:00
Kathy Chen
c7a552d74f Address API review feedback for AmbientContext. Add shell method for more test coverage. Do not unregister request from the same client and delegate to AiAi to handle it.
Test: CTS tests
Bug: 219740201
Change-Id: I8fa9df9cab9965d84d301760f4f7fba08dc44f54
(cherry picked from commit 542fc25dff)
2022-03-15 18:36:25 +00:00
Nicholas Ambur
85d671ceeb enforcement of phraseID of HotwordDetectionService
This check suppresses DSP events and throws a SecurityException if the
HotwordDetectionService returns a phrase ID in HotwordDetectedResult
which does not match the list of phrases that the DSP detected.

Test: atest VoiceInteractionSystemApiTest
Bug: 193232191
Change-Id: I74818e6a1c89e26324833b307c122f46098965b3
2022-03-15 09:34:53 -07:00
Nicholas Ambur
46c4ba27d1 expand test API for DSP kephrase trigger
Expands the existing test API to include the KeyphraseExtra information
in the fake DSP trigger event.

Test: atest CtsVoiceInteractionTestCases
Test: atest CtsVoiceInteractionHostTestCases
Bug: 193232191
Change-Id: I3392cb37afaed6f67fb2f3b22edcbe7c869d1eba
2022-03-15 09:34:53 -07:00
Nicholas Ambur
fabe3ca4ba catch stopRecognition exceptions in destroy()
Ignore any exceptions coming out of the HotwordDetector#destroy()
method when stopRecognition is called. The stopRecognition call here is
a best effort call which should not be retried if it fails.

Test: atest CtsVoiceInteractionTestCases
Test: atest CtsVoiceInteractionHostTestCases
Bug: 193232191
Change-Id: Ie4f8e68ca9078dca0e30fe73408947a2525c5b9a
2022-03-15 09:34:53 -07:00
Nicholas Ambur
274f05a896 move HotwordDetector ctor work to initialize()
new package-private initialize() method is added to
AbstractHotwordDetector to perform work which was previously done in the
implementing class' ctor. This allows the creator,
VoiceInteractionService to control when the initialize work is done
after create.

This change is apart of a larger topic to allow multiple detectors to be
active in parallel. By separating work done in the ctor to another
method, we can freely create detectors without impacting the other
services it communicates with.

This is an internal cleanup, and the client app using the detector will
observe no behavior change.

Test: atest VoiceInteractionSystemApiTest
Bug: 193232191
Change-Id: Ib63cff09e6a0c22fb0f77a0e721637dbb5ae7ed0
2022-03-15 09:34:53 -07:00
Rob Carr
9f33e09f0a Merge "WMS/ViewRoot: Prepare for Async BLAST Sync [1/N]" into tm-dev am: 6caacdcf72
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17100717

Change-Id: Ib978f36892c86f7a5544aefd39a61654fc0ebfd5
2022-03-14 23:03:08 +00:00
Robert Carr
027b59d90a WMS/ViewRoot: Prepare for Async BLAST Sync [1/N]
We would like to make relayoutWindow a non-blocking call,
and of course why not, who likes blocking. However it functions
as a critical path of BLASTSync. To understand why examine the
Guarantee described in BLASTSync.md.

In order to implement this guarantee we need to know
“Which frame has the client finished drawing” when it calls
finishDrawing. The current answer to this question is
“The frame reflecting the state observed in the last call
to relayoutWindow”. The comments on mPending and mCurrentDrawHandlers
also have a lot more context on how this works currently. Since
relayoutWindow has a critical section, it also ensures that changes
to syncable state and preparation of sync will be observed atomically
(since they are both observed over relayoutWindow, which is always
called before any frame drawing updated syncable state).

We design a new protocol described in BLASTSync.md, which uses a seqId
to track which call to finishDrawing reflects which syncable state.
We implement this seqId based system. Unfortunately the WindowManager
doesn’t quite conform to the requirements specified by the protocol,
and a follow up CL ensures that syncable state changes will
always be sent with the seqId.

This CL simply adds the protocol specification and makes some required
interface changes. It can be seen to be a no-op.

Bug: 161810301
Bug: 175861051
Bug: 175861127
Bug: 200285149
Change-Id: If2dea07121fe7de5d2524c5b63678dddf955d4b7
2022-03-14 08:08:40 -07:00
Fabian Kozynski
aed7ff46ca Merge changes from topics "172251878", "presubmit-am-7890421506ee474b9057d3c5d333e341" into tm-dev am: 82b2876457
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17124902

Change-Id: Ida0f9d3874fd53c4da4ac75c81d633598a1a68ce
2022-03-10 20:44:09 +00:00
Fabian Kozynski
82b2876457 Merge changes from topics "172251878", "presubmit-am-7890421506ee474b9057d3c5d333e341" into tm-dev
* changes:
  CompatChange to use hidden API in TileService
  Fix loopers in TileServices
2022-03-10 19:09:25 +00:00
Fabian Kozynski
af6c54c109 CompatChange to use hidden API in TileService
This adds a new hidden API in StatusBarManager for active
TileService#requestListeningState. That way, we can verify that the
calling package is the same as the one belonging to the tile.
This is enforced using CompatChange for apps that target T+.

Test: atest StatusBarManagerServiceTest
Test: atest TileServicesTest
Test: atest CtsSystemUiHostTestCases
Test: sample app targetting T
Fixes: 172251878

Change-Id: Ic9b8aca55dcfc2b32b018a5308f19e49a933c4c9
2022-03-10 16:47:27 +00:00
Darrell Shi
f57924ea28 Merge "Change default showClockAndComplications to false." into tm-dev am: 485e5e223c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17127504

Change-Id: I566cd48197d0bd16ebe828e54c84cb3db7238d92
2022-03-09 17:14:48 +00:00
Darrell Shi
485e5e223c Merge "Change default showClockAndComplications to false." into tm-dev 2022-03-09 17:00:35 +00:00
Bryce Lee
265145a341 Merge "Clear reference to DreamActivity window." into tm-dev am: 650bc974bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17075004

Change-Id: If5f7926c28dc34980a58167ead0a96d8780d6390
2022-03-09 00:50:28 +00:00
Bryce Lee
650bc974bf Merge "Clear reference to DreamActivity window." into tm-dev 2022-03-09 00:22:19 +00:00
Peiyong Lin
7fd2f7f29f Add permission for takeScreenshot API.
takeScreenshot is a system API of GameSession and hence should be
guarded by MANAGE_GAME_ACTIVITY permission.

Bug: b/217986003
Test: atest GameServiceTest
Change-Id: I5591435245ba07abf6c9020ef89905f195309a92
2022-03-08 23:41:10 +00:00
Darrell Shi
008d1da7f5 Change default showClockAndComplications to false.
This makes sure existing behaviors don't change, and only dreams that
specify show dream overlay complications get them.

Change-Id: Ic5f440d0519432e6158c5aa64409abd402d48139
Test: atest DreamOverlayServiceTest
Bug: 214456383
Fix: 214456383
2022-03-08 22:02:14 +00:00
Xiang Wang
a138a782de Merge "Provide game task bitmap to TakeScreenshotService as screenshot" into tm-dev am: 81aa0eac27
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16938819

Change-Id: Ica276f86e62a5a86015eebd0e4f5269089869449
2022-03-08 20:21:50 +00:00
Xiang Wang
81aa0eac27 Merge "Provide game task bitmap to TakeScreenshotService as screenshot" into tm-dev 2022-03-08 20:06:57 +00:00