Commit Graph

22276 Commits

Author SHA1 Message Date
Evan Severson
ab30d8d89a Merge "Copy pointer to sOnOpNotedCallback before queuing dispatch" 2021-11-23 23:44:16 +00:00
Sally Yuen
b9c9a4a068 Merge "Refactor A11yInteractionClient so every service has its own cache" 2021-11-23 19:44:19 +00:00
Evan Severson
877ec88298 Copy pointer to sOnOpNotedCallback before queuing dispatch
Test: Reproduce with attached test app
Fixes: 207324098
Change-Id: I9680c6f574d4355fcc5732c32e2287c5c1ccd4f2
2021-11-23 06:18:37 -08:00
Felipe Leme
9153d23d29 Merge "Added AM APIs to get switch from / to user messages." into sc-v2-dev am: 7df16f2d42 am: 210ec75126
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16289546

Change-Id: I82167bc11d169217dc60d273488e15ac405cd776
2021-11-23 00:41:00 +00:00
Felipe Leme
210ec75126 Merge "Added AM APIs to get switch from / to user messages." into sc-v2-dev am: 7df16f2d42
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16289546

Change-Id: I09e8d32e4f4f07918b9e4cd052c81e4237103231
2021-11-23 00:37:14 +00:00
Felipe Leme
7df16f2d42 Merge "Added AM APIs to get switch from / to user messages." into sc-v2-dev 2021-11-23 00:25:49 +00:00
sallyyuen
85cfe63e23 Refactor A11yInteractionClient so every service has its own cache
- Maintain a static collection of caches (sCaches). Lock is
sConnectionCache
- Initialize a cache when a connection is added. (client.addConnection)
- Remove the cache when a connection is removed. (client.removeConnection)
- System server should not have its cache initialized, can remove
parameter in AccessibiltyInteractionClient constructor

I tried to maintain a local reference (mAccessibilityCache) to the
service cache for each client to avoid accessing the static
collection for each request. But since the process is not immediately
killed when the service is turned off, ensuring resources are cleared
correctly is big time investment that can be done later if desired.

Bug: 192489177
Test: Build and use talkback, do the slew of tests.

atest CtsAccessibilityServiceTestCases  CtsAccessibilityTestCases
CtsUiAutomationTestCases
FrameworksServicesTests:com.android.server.accessibility
FrameworksCoreTests:com.android.internal.accessibility
FrameworksCoreTests:android.view.accessibiliity

Change-Id: Ic30f6915c7b3c186a512ed8b410bf6e842eff5fb
2021-11-22 15:54:41 -08:00
Felipe Leme
4ce8bf537d Added AM APIs to get switch from / to user messages.
Test: adb shell dumpsys activity users|grep mSwitching
Fixes: 206873264

Change-Id: I1e5e3ab26c31bad8190037f22d4fbad2947d9d22
2021-11-22 22:11:22 +00:00
Charles Chen
cb89941f83 [RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent am: 082403816a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16259164

Change-Id: I5f4fa53bdd66b01d491a7c1ac6dbac1e8ce2bc9e
2021-11-22 06:42:43 +00:00
Charles Chen
83d6490629 Merge "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent" into sc-v2-dev 2021-11-22 06:29:28 +00:00
kholoud mohamed
af7fc7b675 Add MANAGE_PROFILE_AND_DEVICE_OWNERS permission to some APIs
Allowed holders of MANAGE_PROFILE_AND_DEVICE_OWNERS to call the following DPM APIs
* isDeviceManaged
* getUserProvisioningState
* isManagedKiosk
* isUnattendedManagedKiosk
* getDeviceOwnerNameOnAnyUser
* getProfileOwnerNameAsUser

Test: N/A
Bug: 188410712
Bug: 205707885
Bug: 206107027
Change-Id: I12cf55bf58004ecd4adb57129f2ac4f9e5e82b42
2021-11-21 14:47:27 +00:00
Jay Wang
8eccfdce16 Revert "Require QUERY_ALL_PACKAGES getDeviceOwnerComponent"
Revert "Add test for isDeviceOwnerApp"

Revert submission 15660377-ayushsha_185896465

Reason for revert: DroidMonitor-triggered revert due to breakage bug http://b/207143396
BUG: 207143396
Reverted Changes:
I774ec2a09:Add test for isDeviceOwnerApp
Ibd611bfe2:Require QUERY_ALL_PACKAGES getDeviceOwnerComponent...

Change-Id: I30a701efefed6eeaf232497019282a7a96ff0424
2021-11-19 23:50:08 +00:00
Ayush Sharma
11b08fc14b Require QUERY_ALL_PACKAGES getDeviceOwnerComponent
Add permission check QUERY_ALL_PACKAGES in API
getDeviceOwnerComponent.

Bug: 185896465
Test: atest DevicePolicyManagerTest#testDeviceOwnerMigration
      atest DevicePolicyManagerTest#testGetDeviceOwnerAdminLocked

Change-Id: Ibd611bfe2b96227a09df81a60c6e2109851c1938
2021-11-19 12:29:55 +00:00
TreeHugger Robot
115f6abe6f Merge "Javadoc changes for additional DPC-settable extras" into sc-v2-dev am: 34a0dd0d91 am: 3e7d377cf7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16197801

Change-Id: I945a962df2d69fe73dfcf9ed248f6748b053792d
2021-11-19 10:05:22 +00:00
TreeHugger Robot
3e7d377cf7 Merge "Javadoc changes for additional DPC-settable extras" into sc-v2-dev am: 34a0dd0d91
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16197801

Change-Id: I3f896a4d5988510b72b1e3b6566ccff0f85e44f6
2021-11-19 09:55:25 +00:00
TreeHugger Robot
34a0dd0d91 Merge "Javadoc changes for additional DPC-settable extras" into sc-v2-dev 2021-11-19 09:38:28 +00:00
Beth Thibodeau
822e72d1cb Merge "Check media session token type" into sc-v2-dev am: 313b9e923d am: f784affa98
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16250175

Change-Id: I7a6397d336f1779d8975b0b1ed0e20d904a81453
2021-11-19 00:16:26 +00:00
Beth Thibodeau
f784affa98 Merge "Check media session token type" into sc-v2-dev am: 313b9e923d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16250175

Change-Id: I99e4e1afb185a53f1b15c4a156b18f674b63520e
2021-11-18 23:58:18 +00:00
Beth Thibodeau
313b9e923d Merge "Check media session token type" into sc-v2-dev 2021-11-18 23:43:21 +00:00
Peiyong Lin
a46aae5388 Merge "Add owners for GameManager and GameManagerService" am: 6e9b910de2 am: 3afdacc87b am: 9e526c1d91 am: 0f14b251a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1896952

Change-Id: Ia5935dc2d357f80a7d525d18025429b7541fb648
2021-11-18 23:30:19 +00:00
Peiyong Lin
0f14b251a5 Merge "Add owners for GameManager and GameManagerService" am: 6e9b910de2 am: 3afdacc87b am: 9e526c1d91
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1896952

Change-Id: Ic2bc74de3241c56a8805ef72be2d1391d1ec11e3
2021-11-18 23:23:32 +00:00
Peiyong Lin
9e526c1d91 Merge "Add owners for GameManager and GameManagerService" am: 6e9b910de2 am: 3afdacc87b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1896952

Change-Id: Ic5c758c011bf2a98db0d6393b288d058f71dfba8
2021-11-18 23:04:05 +00:00
Peiyong Lin
3afdacc87b Merge "Add owners for GameManager and GameManagerService" am: 6e9b910de2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1896952

Change-Id: I743b627784dd5b39cfd645fe41eb67bd5587acf0
2021-11-18 22:47:30 +00:00
Peiyong Lin
ab0ae6b571 Add owners for GameManager and GameManagerService
Bug: N/A
Test: N/A
Change-Id: I48f986e1ca5eadc6c23ca693143f122e415eeefd
2021-11-18 18:25:14 +00:00
Xin Li
10d9972786 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I13199bc39e9445929195f3d15579cbffe94e92b0
Change-Id: I35fa3c6c2abf679c51033f1395a08d511ed8739f
2021-11-18 17:00:37 +00:00
Charles Chen
082403816a [RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent
Before this CL, SystemUiContexts were fixed to the Display metrics
when the SystemUiContexts were created. It is the same mechanism
as DisplayContext but applies to SystemUiContexts unexpectedly.
This CL makes SystemUiContexts associate with DisplayContent with
the corresponding display ID. In this way, SystemUiContext would
receive updates when there is a Display property change.

Bug: 194262507
Bug: 191064581
Bug: 205859784
Test: atest InputMethodMenuControllerTest WindowContextControllerTest
Test: atest NexusLauncherTests

Change-Id: I64a1614f32d097785915f6105b1813a929e0fe32
2021-11-18 22:44:59 +08:00
Gavin Corkery
29b5b4da7d Merge "Start SupplementalProcessManagerService" 2021-11-18 09:57:57 +00:00
Makoto Onuki
543acbc321 Merge "Use different exceptions for different crash reasons" into sc-v2-dev am: 5dcf36ad8d am: abdd86b297
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16276394

Change-Id: I0b67b009bf110b56fdb86778213092f15e758fab
2021-11-17 18:18:24 +00:00
Makoto Onuki
abdd86b297 Merge "Use different exceptions for different crash reasons" into sc-v2-dev am: 5dcf36ad8d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16276394

Change-Id: I3fd688c3241e6c9ae34286b337f6ee0b2bfc525e
2021-11-17 18:05:05 +00:00
Xiaowen Lei
c62495431d Merge "Add OWNERS file for app/communal." 2021-11-17 17:25:37 +00:00
Beth Thibodeau
e91aa6cb7d Check media session token type
When checking whether a notification has a media session, make sure that
the value in the extra is the correct type.

In addition, moves this check inside of
Notification#isMediaNotification for consistency - existing usages either
already checked both or will not be impacted, given that valid MediaStyle
notifications are now shown in the media carousel instead of with other
notifications in the shade.

Fixes: 205570941
Test: atest
Test: manual, repro case in bug
Change-Id: I5d0134d2ce81e9e6a2ed16748f84252bf765a1c9
2021-11-17 11:18:35 -05:00
Makoto Onuki
b20c14d2af Use different exceptions for different crash reasons
Always throwing RemoteServiceException would make it impossible to
tell the cause of a crash without the string message.

Let's use a different exception type so developers can cluster crashes
without the exception message.

Bug: 124137635
Bug: 172001574
Test: Treehugger

Change-Id: If04f8c66efcc32a5200efa70ea20d97e13006039
2021-11-16 14:20:56 -08:00
Makoto Onuki
15b2e036ee Merge "Add new APIs to android.os.Process" 2021-11-16 22:10:35 +00:00
Makoto Onuki
13f2f6a511 Add new APIs to android.os.Process
- APIs the get the current process name
- APIs to get the process start "request" time

Fix: 205629074
Fix: 205337677
Test: atest CtsProcessTest

Change-Id: Id284fa169eb303011cdade6c3ab96e7026654612
2021-11-15 15:37:37 -08:00
Xiaowen Lei
3bb6b5e717 Move ALLOW_COMMUNAL_MODE_* constants into CommunalManager.java.
Test: atest FrameworksMockingServicesTests:CommunalManagerServiceTest

Bug: 198325535
Change-Id: Iebd18230b1a4d25a5c5c186337cb0019944e6c0f
2021-11-15 23:14:15 +00:00
TreeHugger Robot
0216e279ef Merge "New hidden DPM methods: getLogoutUserId() and clearLogoutUser()." into sc-v2-dev am: b3137b3b86 am: 3740f52ea4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16245093

Change-Id: I5e5355fbde455ba76b8c98f64f6414fac3947822
2021-11-13 01:49:54 +00:00
TreeHugger Robot
3740f52ea4 Merge "New hidden DPM methods: getLogoutUserId() and clearLogoutUser()." into sc-v2-dev am: b3137b3b86
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16245093

Change-Id: I73aded8d5b2f1bd38adba570d2eab4c6d84cdea8
2021-11-13 01:33:32 +00:00
TreeHugger Robot
b3137b3b86 Merge "New hidden DPM methods: getLogoutUserId() and clearLogoutUser()." into sc-v2-dev 2021-11-13 01:22:24 +00:00
TreeHugger Robot
2e99dcc4c6 Merge "Fixed permisssions on setStopBackgroundUsersOnSwitch()." into sc-v2-dev am: 174e83c8ec am: 2484637c43
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16224123

Change-Id: I33f260272ab37e39b0721a2743e8bb9b1b81af83
2021-11-12 18:40:57 +00:00
TreeHugger Robot
2484637c43 Merge "Fixed permisssions on setStopBackgroundUsersOnSwitch()." into sc-v2-dev am: 174e83c8ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16224123

Change-Id: I8158038b500efbbb3aafe0e4dd342adb5cf07890
2021-11-12 18:39:24 +00:00
Gavin Corkery
02958c9aff Start SupplementalProcessManagerService
Calls the SupplementalProcessFrameworkInitializer to
register the supplemental process service. This service
is started from SystemServer.

Test: Manual. Check logcat to ensure service has started
Bug: 204989700
Change-Id: Iaafb45fcc0d0be2c15bb6a6206114d59fe4bbf17
2021-11-12 11:45:40 +00:00
Felipe Leme
670c8895be New hidden DPM methods: getLogoutUserId() and clearLogoutUser().
Also fixed how the logout user was cleared after a successful switch.

They will be used by CarSystemUi to end a session.

Test: Manual verification with CtsVerifier and TestDpc on automotive

Bug: 205185521
Bug: 204483021

Change-Id: Ieda0a22625ef705fcd705aedfc2dbf2cf570bf81
2021-11-11 18:14:28 -08:00
Felipe Leme
1f37c4f7c7 Fixed permisssions on setStopBackgroundUsersOnSwitch().
It was requiring INTERACT_ACROSS_USERS_FULL (instead of
INTERACT_ACROSS_USERS), which cannot be granted by Shell
(and hence cannot be used by CtsVerifier).

Test: m update-api
Test: manual verification
Bug: 203752848

Change-Id: Ie84311e6500cefa055548e309ee6d629c62fb10d
2021-11-11 17:42:24 -08:00
Xiaowen Lei
ec026955fa Add OWNERS file for app/communal.
This directory was added by lusila@ in ag/16006734. Adding an OWNERS
doesn't bypass API council requirement; It just helps with the +2.

Test: none

Ignore-AOSP-First: Feature not yet in AOSP.

Change-Id: I7e2f2d0ad44a325b25eebfa0e18777e137274817
2021-11-12 01:18:39 +00:00
TreeHugger Robot
3142c5b5b7 Merge "Don't allow background apps to change theme" into sc-v2-dev am: a6f7644ef0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16203175

Change-Id: Ia566b6199eee6fa35ac8b978ae20d7223c85c9e5
2021-11-11 20:15:13 +00:00
TreeHugger Robot
a6f7644ef0 Merge "Don't allow background apps to change theme" into sc-v2-dev 2021-11-11 19:56:46 +00:00
TreeHugger Robot
20d9c1fc36 Merge "Don't allow background apps to change theme" 2021-11-11 18:28:18 +00:00
Lucas Dupin
6fd464985a Don't allow background apps to change theme
A background app that changes the wallpaper, was able to change the
device theme.

This change will apply the theme if the app is on the foreground, like
WallpaperPicker would be, but would defer the event until the next power
button cycles, like we do with Live Wallpapers, to avoid the same type
of DoS.

Test: manual
Test: atest ThemeOverlayControllerTest
Fixes: 205140487
Change-Id: I2086b29ef9bf3bb6fb7d9ebba6e7b8db9392e459
Merged-In: I2086b29ef9bf3bb6fb7d9ebba6e7b8db9392e459
2021-11-11 17:53:06 +00:00
Alex Chau
29283a4610 Revert "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent" am: 930739c45a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16238819

Change-Id: Ib98b2e6427a789067b25a1cb28fc189ec5a9e368
2021-11-11 14:32:59 +00:00
TreeHugger Robot
60422ba05a Merge "Revert "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent"" into sc-v2-dev 2021-11-11 14:13:01 +00:00