Commit Graph

3604 Commits

Author SHA1 Message Date
Daniel
2bd78dee3a Add proximity state to the HotwordDetectedResult
HotwordDetectionConnection will interact with AttentionService to
receive updated proximity state. Then it will fill the
HotwordDetectedResult returned from Hotword service to set
proximity state.

Bug: 214395649
Test: atest CtsVoiceInteractionTestCases
Change-Id: I71e9d3da999cda2d9b17e3abc900fa42e4364c90
2022-08-08 22:42:23 +00:00
Ivan Chiang
6c8dafdd06 Merge "Use noteOpNoThrow instead of checkOpNoThrow in AssistDataRequester" 2022-08-03 07:13:55 +00:00
Felipe Leme
76273beffd Merge "Fixed VIMS to postpone ASSISTANT rule change on pre-created users." 2022-08-03 06:58:01 +00:00
Felipe Leme
39acca1d72 Fixed VIMS to postpone ASSISTANT rule change on pre-created users.
RoleService should not be calling onRoleHoldersChanged() on
pre-created users, but that behavior cannot be changed because its
implemented by a system app, and pre-created users APIs are hidden.

To test it:

$ adb shell pm create-user --pre-create-only  --guest
Success: created user id 12

$ adb shell pm create-user --guest ElGuesto
Success: created user id 12

$ adb shell cmd user list --all -v
4 users:

0: id=0, name=Driver, type=system.HEADLESS, flags=ADMIN|INITIALIZED|PRIMARY|SYSTEM (running)
1: id=10, name=Driver, type=full.SECONDARY, flags=ADMIN|FULL|INITIALIZED (running) (current)
2: id=11, name=null, type=full.SECONDARY, flags=FULL|INITIALIZED (pre-created)
3: id=12, name=ElGuesto, type=full.GUEST, flags=EPHEMERAL|FULL|GUEST|INITIALIZED (converted)

$ adb shell am switch-user 12

$ adb shell dumpsys voiceinteraction |egrep '(mBound|implementation)'
  mBound=true mService=android.service.voice.IVoiceInteractionService$Stub$Proxy@77da1bc

$ adb shell cmd voiceinteraction show

Test: see bove
Bug: 216141085
Bug: 226201975

Change-Id: I12d9bb32e144ecf91ee4b452affea0dcea546127
2022-08-02 12:57:59 -07:00
Jon Eckenrode
9991cfe392 Merge "Fixed typo in class description." am: 9f59ca049c am: 5376d1acc7 am: 4a1d3071ed am: 3f3bdc48c5 am: 47c3d18be2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2168523

Change-Id: Ib7fa77b65cc7179d4586f4835316bef74ceba773
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 02:01:36 +00:00
Jon Eckenrode
47c3d18be2 Merge "Fixed typo in class description." am: 9f59ca049c am: 5376d1acc7 am: 4a1d3071ed am: 3f3bdc48c5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2168523

Change-Id: I4bee6fcddba7c4917816e38f59752fcc54fd398b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 01:35:55 +00:00
Jon Eckenrode
5376d1acc7 Merge "Fixed typo in class description." am: 9f59ca049c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2168523

Change-Id: Iacf41b70ef71e01a6427dcff7dfc742bce31f0ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 00:44:27 +00:00
Tiger Huang
ae9d2aa672 Merge "Send size-compat scale to the client" into tm-qpr-dev am: 93a238d15d am: 3995c4d303
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19149526

Change-Id: Ic48b954694b8d6cafce8b421dcbcd94f63793acc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 09:47:33 +00:00
Tiger Huang
3995c4d303 Merge "Send size-compat scale to the client" into tm-qpr-dev am: 93a238d15d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19149526

Change-Id: If3a51277578c31ba2c0e8c75341b33cd1f5cd9ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 09:23:15 +00:00
Jon Eckenrode
93b956e9c0 Fixed typo in class description.
Change-Id: I0c2afdd0a8c914854d96e27c924ee74af488e1e4
2022-07-28 14:53:47 +00:00
Wenhao Wang
b24224d9c2 Detail the REASON_LOCKDOWN docs
Bug: 231496716
Test: N/A
Ignore-AOSP-First: pending fix for a security issue.
Change-Id: I25294c75e3180d177b5e7259e12874ae27437c46
2022-07-27 22:05:57 -07:00
Tiger Huang
c77eaf873d Send size-compat scale to the client
The client computes the window frame on its own in ViewRootImpl#setView.
However, the bounds obtained from WindowConfiguration is not size-
compatible, which makes legacy apps produce wrong frames. The frame is
larger than expected, so when computing WindowInsets with size-
compatible InsetsState, the window cannot receive insets.

Although the client will receive the correct window frame from relayout,
but the first WindowInsets has been dispatched before that.

This CL sends the size-compat scale to the client, so the client can use
the correct WindowConfiguration to compute frames.

This is also a step to enable the client to perform local window layout.

Bug: 237749017
Bug: 161810301
Bug: 175861127
Test: atest StartingSurfaceDrawerTests WindowAddRemovePerfTest
      ActivityRecordTests WindowManagerServiceTests
Change-Id: I6b23901f4b1f009444c04da7e078ea971a386ad7
2022-07-27 14:10:10 +08:00
Ivan Chiang
36e6fecf63 Use noteOpNoThrow instead of checkOpNoThrow in AssistDataRequester
To audit data access and verify the uid and package are consistent,
use noteOpNoThrow instead of checkOpNoThrow.

Bug: 187439908
Test: atest AssistDataRequesterTest
Test: atest CtsVoiceInteractionTestCases
Test: atest CtsAssistTestCases
Change-Id: Ib48040b5b55be09958da4398f4d663908573568c
2022-07-18 05:55:59 +00:00
Andy Labrada
eb8161a0e0 Merge "SurfaceFlinger: Remove usage of window types to implement policy" 2022-07-08 23:15:53 +00:00
Alexus Allen
c87e1ce1f0 SurfaceFlinger: Remove usage of window types to implement policy
Java side for a new API, setFrameRateDefault, where policy implementation logic is made using setFrameRateDefault instead of checking window types.
Bug b/192291754
Test: manual

Change-Id: I3ff35dbe3551746b90448531dccec09d8355824c
2022-07-06 17:46:07 +00:00
Hani Kazmi
c7cdc8ca72 Merge "Migrate Bundle/Intent APIs to new, type checked, variants" 2022-07-05 10:32:47 +00:00
Hani Kazmi
4f221e5c51 Migrate Bundle/Intent APIs to new, type checked, variants
Part of go/safer-parcel. Follow up to ag/16639043. Migrates the following unsafe APIs:

* Parcel.readArray()
* Parcel.readParcelableArray()
* Bundle.getSerializable()
* Bundle.getParcelable()
* Bundle.getParcelableArrayList()
* Bundle.getParcelableArray()
* Bundle.getSparseParcelableArray()
* Intent.getSerializableExtra()
* Intent.getParcelableExtra()
* Intent.getParcelableArrayExtra()
* Intent.getParcelableArrayListExtra

Bug: 227458983
Test: m and presubmit pass
Change-Id: I72f206cb18eb5c669a7fff07a6845bed1c433fdb
2022-07-01 10:53:53 +00:00
Treehugger Robot
6c731486a1 Merge "Add more owners to appprediction and smartspace services" am: b015109200 am: d5f11c7387 am: ad54b5f97b am: 7f7f6bc2c9 am: 20c004024e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2142732

Change-Id: I64580f2793813a3ab744dd48b98a72da89d3f3f9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 00:39:01 +00:00
Treehugger Robot
20c004024e Merge "Add more owners to appprediction and smartspace services" am: b015109200 am: d5f11c7387 am: ad54b5f97b am: 7f7f6bc2c9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2142732

Change-Id: I93e4227c225dcd0c804f2ed478030a8fdac4feff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-01 00:34:03 +00:00
Treehugger Robot
d5f11c7387 Merge "Add more owners to appprediction and smartspace services" am: b015109200
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2142732

Change-Id: I5e6dd1e6909610c4cc9d8d6481700ed44d9d4bd7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-30 23:30:46 +00:00
Hyunyoung Song
fa1b102045 Add more owners to appprediction and smartspace services
Test: not needed as modifying OWNERS file

Change-Id: Id4d57d2067828bee102ee5d5335b15790e454e9f
2022-06-30 22:05:47 +00:00
Peter Li
c6931d97cb Create proper ui context if original context is not a ui context
Since Android API 31 there is a new check in StrictMode, this
check ensures that any ui-related operations involving context
object are only performed on the ui context. If the context is
not the ui context, it will fail with error when calling the
ui-related methods.

So we need to create proper ui context if original context is
not a ui context.

Bug: 220698651
Test: atest CtsVoiceInteractionTestCases
Test: manual. Test VoiceInteractionSession UI.
Change-Id: Ibbeae9b135b90078b3b9e36a2d0c5a92f6184b2a
2022-06-28 20:27:16 +08:00
Tiger Huang
0db1030479 Merge "Revert "Introduce updateVisibility and updateLayout"" into tm-qpr-dev am: cf1e9e2682 am: d20e6a8d27
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19009478

Change-Id: I84d51bf1bcf029893b7eabe93155a1690ea4d816
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-24 07:29:15 +00:00
Tiger Huang
676f060ada Merge "Send the attached frame to the client" into tm-qpr-dev am: 228988d5e7 am: 9dbae141fa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17860764

Change-Id: I35ea6111b8b706797eb724481bb9f07bc95fc8d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-23 06:51:51 +00:00
Tiger Huang
20eb3c91db Revert "Introduce updateVisibility and updateLayout"
This reverts commit:
db407ef12d, and
d8aa7f7882.

Reason for revert:
The surface size would be reduced by mTranslator unexpectedly.

Fix: 233017734
Test: Open a legacy app which has CompatibilityInfo.SCALING_REQUIRED
      and see if the app is cropped.
Change-Id: If830866328a5709cf6856fe840a804b304052003
2022-06-22 21:41:18 +08:00
Tiger Huang
157514510f Send the attached frame to the client
The attached frame is the frame of the parent window that its child
attaches to, as long as the child is not
TYPE_APPLICATION_ATTACHED_DIALOG. It is a factor while computing the
window frame.

Previously, we let the child obtain the attached frame from its parent
view root. However, if the parent and the child are not in the same
process, it can be tricky.

This CL sends the attached frame from the server to the client via
ClientWindowFrames. In this way, the child can compute its window frame
without having to accessing the parent view root.

Bug: 161810301
Bug: 175861127
Test: atest ActivityRecordTests WindowLayoutTests
Change-Id: Ia844a4c927027e305a56114216eaee2bf7933b1f
2022-06-20 21:09:40 +08:00
Nikolas Havrikov
2c4b146037 Replace LinkedList by a more performant collection
This is a semi-automatic change.
See https://errorprone.info/bugpattern/JdkObsolete for the rationale.

Test: make
Bug: 221046110
Change-Id: I24c97cdc20097eb4b820c7d50ca18ab5581bb43c
2022-06-14 16:43:10 +02:00
Chet Haase
f6541ab73e Pause animators when app is not visible am: b99cc5b4c8 am: f2e66fa4ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18528824

Change-Id: I4a220654954199c26f29a93d8afc3ad8a448547e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 20:28:07 +00:00
Chet Haase
f2e66fa4ed Pause animators when app is not visible am: b99cc5b4c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18528824

Change-Id: I2b041e112cfa55949a9d3f753388de3536dbd33a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 20:06:35 +00:00
Chet Haase
4551f51dcd Pause animators when app is not visible am: b99cc5b4c8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18528824

Change-Id: I560f0875e7408f41393246c62ea73931e862a986
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-07 19:57:37 +00:00
Lucas Silva
bc20407897 Merge "Use try-with-resource statement for dream metadata to ensure proper cleanup." into tm-dev am: 2aa3ecaf9e am: 717707e390
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18700386

Change-Id: I8a10990fccf4fa381b9451364472aa8f532d8146
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-03 14:36:06 +00:00
Lucas Silva
ecae4748db Merge "Use try-with-resource statement for dream metadata to ensure proper cleanup." into tm-dev am: 2aa3ecaf9e am: 11d36d2ff3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18700386

Change-Id: Iddaa9b911980877e14def72e5c1ff83d3b4ef82b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-03 14:35:52 +00:00
Lucas Silva
b30b1683e1 Use try-with-resource statement for dream metadata to ensure proper
cleanup.

This ensures the memory is properly cleaned up if an exception is thrown
while building the DreamMetadata object.

Bug: 234343900
Test: locally on device
Change-Id: I29b2bed30c216d5e353fa0a8b0da74579b33cecb
2022-06-01 19:04:57 +00:00
TreeHugger Robot
00d502f5a3 Merge "Add support for onReject and onError for external hotword." into tm-dev am: 90579f32b3 am: ddb61b7bbf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18308197

Change-Id: I0a5e1da74b3d5096b518cda16d8911a05debe047
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 18:01:49 +00:00
TreeHugger Robot
72d9e091c4 Merge "Add support for onReject and onError for external hotword." into tm-dev am: 90579f32b3 am: 5ec4c563ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18308197

Change-Id: Ic3ec74aaaa851b3860e7bddcab1decc9a9db34e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-26 17:46:37 +00:00
TreeHugger Robot
90579f32b3 Merge "Add support for onReject and onError for external hotword." into tm-dev 2022-05-26 17:14:11 +00:00
Wenhao Wang
aef3f71243 Merge "Improve the REASON_LOCKDOWN docs" 2022-05-25 17:05:17 +00:00
Riddle Hsu
fa1480449b Merge "Do not force relayout for wallpaper visibility change" into tm-qpr-dev am: 9496a69d0b am: 0126c44904
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18558386

Change-Id: I4bc27fdf12e058f1caeb5991856f5139b6259057
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 06:59:16 +00:00
Riddle Hsu
9496a69d0b Merge "Do not force relayout for wallpaper visibility change" into tm-qpr-dev 2022-05-25 06:20:23 +00:00
Riddle Hsu
07f2a71eda Do not force relayout for wallpaper visibility change
The force-relayout was added in [1] for the side effect of [2].
Since the preserve-surface has been completely removed in [3].
So [1] can be restored to avoid unnecessary cost.

WallpaperService always calls relayout with View.VISIBLE, so
unless it requests to remove the wallpaper window, its surface
should not be removed. Though currently there might be no such
cases, add a log in case something goes wrong.

[1]: I79f97df61696eea325183e9b9057cbb10ce8cc66
[2]: Iea8ed86a9c4a7674804152aa44df7ef3d6341768
[3]: I4574ac0d3b8a63b13ac44846e729b73ca0f88f23

Bug: 233599092
Test: No additional relayout from wallpaper when turning on screen,
      swiping/closing up to home.
Test: Toggle overview from wallpaper picker while using live wallpaper.
      The wallpaper won't disappear.

Change-Id: I6673e458b5577f780be17a51cf5de1d6493ab5ca
2022-05-25 05:39:48 +00:00
Wenhao Wang
ed13578a8b Improve the REASON_LOCKDOWN docs
Bug: 231496716
Test: N/A
Ignore-AOSP-First: pending fix for a security issue.
Change-Id: Ia3f9c45e4134a613f60583f5a4aeb66875dad41f
2022-05-24 17:25:55 -07:00
Sergey Volnov
be0edce59a Add support for onReject and onError for external hotword.
Bug: 230658902
Test: atest --no-bazel-mode CtsVoiceInteractionTestCases:HotwordDetectionServiceBasicTest
Change-Id: Ic845f06c2e3943f4968067dd23a0520aecce3973
2022-05-24 01:39:21 +01:00
Chet Haase
b99cc5b4c8 Pause animators when app is not visible
Because animators are not tied to the lifecycle of any UI
elements, it is possible for an app to go into the background
and for the animators to continue running. Ideally, the app would
track the lifecycle of the activity/etc and pause or disable the
animators, but it is common for this to not happen, causing the
animators to continue spinning when the app does not need them.
The animators are not causing as much work as for a foreground
activity (since they do not cause any re-rendering), but they cause
work nonetheless by keeping Choreographer awake to continue pulsing
frames.

The ideal fix would be to introduce new API for animators that
tied them to lifecycle concepts (View, Activity, etc). But that kind
of fix would only be available for future versions of the platform,
and does not address existing app code. A workaround for the current
situation is to address the most egregious problems; infinite animators
running on backgrounded apps.

The fix here is exactly that: when an app's visible surface (either an
activity or, for Wallpapers, a WallpaperService) is backgrounded,
a request is sent to pause animators for that surface. When that surface
comes to the foreground, a request is sent to resume those animators.
Since all animators are handled on the same thread for the same process,
in AnimationHandler, we should only ever pause animators when *all*
surfaces for a process are not visible (and resume them when *any*
surface becomes visible). Also, to mitigate any issues with thrashing
animator state for apps which become only transiently backgrounded,
we delay pausing for some time.

Bug: 228598053
Bug: 233391022
Test: new AnimatorLeak CTS test, plus manual testing for activities
    and wallpapers

Change-Id: I8b9f841cc80babb972244c724968a5c085a06b69
Merged-In: I8b9f841cc80babb972244c724968a5c085a06b69
2022-05-23 20:31:19 +00:00
Shashwat Razdan
f801da6b01 Merge "Unlink to death before removing the callback wrapper in SmartspaceService/AppPredictionServic3e" into tm-dev am: 1ec2fe2e7d am: 187a2c4153 am: fb733f5bde am: 76c197d97d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18475472

Change-Id: I8a44cb0b27d3dce9b694b0f093032b1375c9231c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 18:47:39 +00:00
Shashwat Razdan
fb733f5bde Merge "Unlink to death before removing the callback wrapper in SmartspaceService/AppPredictionServic3e" into tm-dev am: 1ec2fe2e7d am: 187a2c4153
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18475472

Change-Id: I75b8a316fefe229b1fa683baa26c4e50c7b2bb45
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-23 18:29:47 +00:00
Shashwat Razdan
1ec2fe2e7d Merge "Unlink to death before removing the callback wrapper in SmartspaceService/AppPredictionServic3e" into tm-dev 2022-05-23 17:56:46 +00:00
Thiébaud Weksteen
a7a7a9c106 Merge "Migrate game service to @EnforcePermission" 2022-05-23 02:34:15 +00:00
TreeHugger Robot
20c445f403 Merge "Finish DreamActivity on creation if it is obsolete" into tm-dev am: abfe28784c am: 1f9957c76c am: 3daba43266 am: 952a847ebf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18090283

Change-Id: I89ef96997629031104f4fffb381eb0db83ac3916
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-21 22:54:12 +00:00
TreeHugger Robot
3daba43266 Merge "Finish DreamActivity on creation if it is obsolete" into tm-dev am: abfe28784c am: 1f9957c76c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18090283

Change-Id: I28008d17a763141f1c8e08c6ea7bb82c1e3212b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-21 22:09:42 +00:00
TreeHugger Robot
abfe28784c Merge "Finish DreamActivity on creation if it is obsolete" into tm-dev 2022-05-21 21:33:36 +00:00