Commit Graph

21207 Commits

Author SHA1 Message Date
TreeHugger Robot
b3137b3b86 Merge "New hidden DPM methods: getLogoutUserId() and clearLogoutUser()." into sc-v2-dev 2021-11-13 01:22:24 +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
TreeHugger Robot
a6f7644ef0 Merge "Don't allow background apps to change theme" into sc-v2-dev 2021-11-11 19:56:46 +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
TreeHugger Robot
60422ba05a Merge "Revert "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent"" into sc-v2-dev 2021-11-11 14:13:01 +00:00
Alex Chau
930739c45a Revert "[RESTRICT AUTOMERGE] Associate SystemUiContext with DisplayContent"
This reverts commit 71b2172abc.

Reason for revert: See b/205859784, breaks launcher tests
Bug: 205859784
Bug: 194262507
Bug: 191064581

Change-Id: Iaac32bd4142c0539300725dc2f6e4255fefc8b2f
2021-11-11 10:09:10 +00:00
TreeHugger Robot
5908bbe04d Merge "Renamed setStopBackgroundUsersOnSwitch to setStopUserOnSwitch()" into sc-v2-dev 2021-11-11 04:51:15 +00:00
Varun Shah
0b0b81f505 Merge "Update deletion conditions for a package's UsageStats." into sc-dev am: 2a14be36ff am: e1a38189da
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16222839

Change-Id: I10b4e4a641752585cc23ef4a08f25517aa4be791
2021-11-11 01:37:54 +00:00
Varun Shah
e1a38189da Merge "Update deletion conditions for a package's UsageStats." into sc-dev am: 2a14be36ff
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16222839

Change-Id: Ic05768dc4213e00f93829ace282fd847dc2e5fed
2021-11-11 01:19:38 +00:00
Varun Shah
157fbcfbe4 Update deletion conditions for a package's UsageStats.
If a profile owner is defined for a specific user, do not delete usage
stats for a package on package deletion.

Bug: 197399948
Test: atest UserUsageStatsServiceTest
Test: atest UsageStatsTest [all]
Change-Id: I94a8e3dfca8ef4c7616f77944d61726e06043b85
Merged-In: I94a8e3dfca8ef4c7616f77944d61726e06043b85
2021-11-10 17:11:32 +00:00
Charles Chen
71b2172abc [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
Test: atest InputMethodMenuControllerTest WindowContextControllerTest

Change-Id: Idd74da965c18bdbf8912bd45e89be21f652dcf93
2021-11-10 14:19:53 +08:00
Felipe Leme
61292e22ed Renamed setStopBackgroundUsersOnSwitch to setStopUserOnSwitch()
Test: atest NeneTest:UsersTest
Test: m update-api CtsVerifier
Test: adb shell cmd activity set-stop-user-on-switch false
Test: adb shell cmd activity set-stop-user-on-switch
Test: adb shell dumpsys activity users|grep OnSwitch

Bug: 203752848

Merged-In: Iea03164319768abf159bf8ae2ccc539620cb30fe
Change-Id: Iea03164319768abf159bf8ae2ccc539620cb30fe
2021-11-08 16:32:42 -08:00
wilsonshih
966a61366e setTurnScreenOn can only used as wakeup
setTurnScreenOn shouldn't dismiss keyguard automatically even when the
keyguard is insecure.
The keyguard state should only be affected by requestDismissKeyguard
and/or setShowWhenLocked, and for either case setTurnScreenOn can be
used to wakeup device if the activity is going to be resumed and
visible.

Bug: 201103497
Test: atest ActivityVisibilityTests KeyguardTests KeyguardLockedTests
Change-Id: I283dea469a33286fc9cf835e39ee5a3be2444739
(cherry picked from commit f3a1274a38)
2021-11-08 07:18:20 +00:00
Felipe Leme
7c1c6a691c Merge "New TestAPIs on ActivityManager to not stop bg users on switch." into sc-v2-dev 2021-11-05 18:06:02 +00:00
Felipe Leme
502344efe5 Merge "Centralise owners for Enterprise Platform team." into sc-v2-dev 2021-11-05 17:49:30 +00:00
Felipe Leme
ef61167cf4 Merge "Disabled some password-related APIs on automotive." into sc-v2-dev 2021-11-05 16:06:13 +00:00
Felipe Leme
f1f95597f0 Merge "Fixed DPM.logoutUser() for headless system user mode." into sc-v2-dev 2021-11-05 15:45:19 +00:00
Felipe Leme
9cab317f2a New TestAPIs on ActivityManager to not stop bg users on switch.
Test: atest NeneTest:UsersTest
Test: m update-api
Test: adb shell cmd activity set-stop-user-on-switch false
Test: adb shell cmd activity set-stop-user-on-switch
Test: adb shell dumpsys activity users|grep OnSwitch

Bug: 203752848

Change-Id: Ib57989aff323dc1f7d98720d01215e4f7c79ba3a
2021-11-04 12:36:56 -07:00
Felipe Leme
bc671b859a Fixed DPM.logoutUser() for headless system user mode.
On "traditional" devices, this method switches back to the "primary"
user, which is the system user. But on devices running with headless
system user mode, it should switch to the previous user instead.

Test: manual verification (TestDpc/CtsVerifier) on car and phone
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_LogoutUser
Bug: 204483021

Change-Id: I3ccbc1f31f8bcc4dae8fcb71cf5de7a7ad8882fe
2021-11-04 10:54:40 -07:00
Mady Mellor
80a34bc07e Merge "Add locusId as something taskOrganizers care about" into sc-v2-dev 2021-11-03 00:47:12 +00:00
Mady Mellor
5468eedde5 Add locusId as something taskOrganizers care about
This ensures that a locusId change will trigger an
onTaskInfoChange immediately. Previously it would just
be sent with the next info change event which isn't
sufficient.

Test: atest NotificationManagerTest
Bug: 204260661
Change-Id: I2b53f63b6efd6d2c22a877b7c33f5a12832a8e1d
2021-11-02 15:31:41 -07:00
TreeHugger Robot
bae76ba745 Merge "Close ParcelFileDesciptor properly" into sc-v2-dev 2021-11-02 09:38:51 +00:00
Felipe Leme
97e42e2785 Disabled some password-related APIs on automotive.
The APIs are deprecated (in favor of setRequiredPasswordComplexity())
and some automotive OEMs might not even provide the option to
set passwords (just PINs and patterns).

Fixes: 204252236

Test: atest CtsDevicePolicyTestCases:android.devicepolicy.cts.DeprecatedPasswordAPIsTest # on automotive and phone

Change-Id: I6272bdd0e893f6fd8f1d126d384d1b332e61bac2
2021-10-29 16:18:04 -07:00
Jonathan Scott
c8e719e4b5 Centralise owners for Enterprise Platform team.
This will allow us to point other directories at these files for OWNERS
and make it easier to update after future team changes.

Test: N/A
Bug: 202714830
Change-Id: Iaaf5b8eb7568be4ebfd1b30abae0b757153f0391
(cherry picked from commit 7443751dd9)
2021-10-28 12:00:08 -07:00
Charles Chen
a9efae988e Merge "Fix ClassLoader issue of WindowContext" into sc-v2-dev 2021-10-28 09:24:08 +00:00
Charles Chen
09c03ec912 Fix ClassLoader issue of WindowContext
The root cause of this issue is that we pass mClassLoader to new created
Resources, but it may be null if we don't set ClassLoader from
container.
This CL fixes this issue by use ContextImpl#getClassLoader instead.

Bug: 203027987
Test: reproducible steps mentioned in bug

Change-Id: Ic88a351b3e9bbcf8382b9aefea63e2be2f190cb6
2021-10-27 21:34:54 +08:00
Pierre Barbier de Reuille
acfcc90ebd Check if APK paths are valid right before creating the context.
The check has to be done in RemoteViews and in AppWidgetHostView right
before creating the context used to inflate the app widget. Further, the
APK is cached potentially in two places: in the APK with code and the
APK without codes, so both places are updated if present.

Test: manual, see bug for details
Fix: 202369942

Change-Id: I5718f67711a3332a942d3c037eef7f30379549a4
2021-10-25 08:20:10 +00:00
tomnatan
d223334e60 Make ActivityOptions#setLaunchTaskId a system API
This is needed for digital wellbeing, see go/dwb-dialog-multi-window-dd for more information.

Bug: 199825187
Test: N/A
Change-Id: Ic0acbb034f326d0e8bc0e63d8c1a7b3f35a0e931
2021-10-21 08:33:35 +00:00
Wu Ahan
ba4eba6ca1 Close ParcelFileDesciptor properly
We missed closing ParcelFileDescriptor, so close it.

Bug: 200947065
Test: Manually
Change-Id: If8ee9153898801f7c57cecebbc79e0cad611efc4
2021-10-19 12:59:29 +00:00
Tom Natan
282c40c660 Merge "Make isVisible member in TaskInfo public for digital wellbeing" into sc-v2-dev 2021-10-15 14:56:51 +00:00
tomnatan
8d78842f93 Make isVisible member in TaskInfo public for digital wellbeing
Bug: 199825187
Test: N/A
Change-Id: If2e8ff32e865591ea8b2de68e5cb1e8b05e06f35
2021-10-14 10:17:51 +00:00
Wei Sheng Shih
f754d5df69 Merge "Fixes the flicker when transfer splash screen view to client" into sc-v2-dev 2021-10-13 09:32:59 +00:00
Wei Sheng Shih
275b113621 Merge "setTurnScreenOn can only used as wakeup" into sc-v2-dev 2021-10-12 03:49:24 +00:00
Nick Chameyev
46578a254a Rename shouldUseDefaultDisplayStateChangeTransition attribute
Renames the shouldUseDefaultDeviceStateChangeTransition attribute name to
shouldUseDefaultUnfoldTransition to make it less generic.

Test: manual
Fixes: 200730817
Change-Id: Icc7f25f20758162c318e0b0896fb9a7bb2de5911
2021-10-07 15:10:37 +00:00
wilsonshih
379994b4f8 Fixes the flicker when transfer splash screen view to client
Use applyTransactionOnDraw to ensure all transaction happen
during the same frame, including
- hide the starting window.
- reparent the remote SurfaceView to client.

Bug: 198593932
Test: continues launch test app several times then verify with winscope
to ensure there is no flicker anymore.

Merged-In: I03c600afdc477ca0c8064b215f2b361468db9f3c
Change-Id: I03c600afdc477ca0c8064b215f2b361468db9f3c
2021-10-06 11:14:11 +08:00
Chilun Huang
69c8b1aef6 Merge "Use post-execution state for ActivityResultItem" into sc-v2-dev 2021-10-05 07:31:59 +00:00
Wei Sheng Shih
6717096333 Merge "Fix two typos on comment." into sc-v2-dev 2021-10-05 03:08:29 +00:00
Louis Chang
5df8cac564 Merge "Removing TaskFragment token from LaunchActivityItem" into sc-v2-dev 2021-10-05 03:00:24 +00:00
wilsonshih
f3a1274a38 setTurnScreenOn can only used as wakeup
setTurnScreenOn shouldn't dismiss keyguard automatically even when the
keyguard is insecure.
The keyguard state should only be affected by requestDismissKeyguard
and/or setShowWhenLocked, and for either case setTurnScreenOn can be
used to wakeup device if the activity is going to be resumed and
visible.

Bug: 201103497
Test: atest ActivityVisibilityTests KeyguardTests KeyguardLockedTests
Change-Id: I283dea469a33286fc9cf835e39ee5a3be2444739
2021-10-05 10:56:03 +08:00
Miranda Kephart
a7d22696a5 Merge "Offset ghost views by the containing view's location" into sc-v2-dev 2021-10-04 14:53:49 +00:00
Chilun
3e0f315f8c Use post-execution state for ActivityResultItem
onActivityResult was called before onStart when resuming an activity
from STOPPED state.

Ensure the onActivityResult callback to be called before onResume.
But we only fix this after Android S to avoid some app compatibility
issues.

Bug: 78294732
Bug: 130178098
Test: atest ActivityLifecycleTests
Change-Id: I9ff060ff26d3fc517aae0a094fc041887326a963
2021-10-04 17:09:36 +08:00
Nick Chameyev
3d984a776f Merge "Rename shouldUseDefaultDeviceStateChangeTransition attribute" into sc-v2-dev 2021-10-04 09:00:00 +00:00
TreeHugger Robot
ed8da6fc5f Merge "Don't ret admin info from createAdminSupportIntent" into sc-qpr1-dev am: 66b1090499
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15843713

Change-Id: I215629f6a299254641cf6ff5c111787ac2e8b0d1
2021-10-01 18:21:22 +00:00
TreeHugger Robot
66b1090499 Merge "Don't ret admin info from createAdminSupportIntent" into sc-qpr1-dev 2021-10-01 18:15:57 +00:00
TreeHugger Robot
442864cace Merge "Added a DevicePolicyManager.setDeviceOwnerOnly() method." into sc-v2-dev 2021-10-01 15:37:15 +00:00
Nick Chameyev
5985d390d6 Rename shouldUseDefaultDeviceStateChangeTransition attribute
Renames the shouldUseDefaultDeviceStateChangeTransition attribute name to
shouldUseDefaultDisplayStateChangeTransition to make it less generic.

Test: manual
Fixes: 200698833
Change-Id: Ib6f90bcba2e75485e954bdbc1833fd67728e51c6
2021-09-30 11:39:03 +00:00
Felipe Leme
895f3ba3f0 Added a DevicePolicyManager.setDeviceOwnerOnly() method.
It will be used by the test infra to just set the device owner,
without setting the profile owner on current user on systems
using headless system user.

Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testDeviceOwnerSetup
Test: adb shell dpm set-device-owner --user 0 --device-owner-only com.afwsamples.testdpc/.DeviceAdminReceiver
Test: m update-api

Fixes: 201313785
Bug: 192395248

Change-Id: I41c2cf187c1eceebe7c6ef30f9cff693b9dcbc15
2021-09-29 09:30:53 -07:00
Louis Chang
6dc124025d Removing TaskFragment token from LaunchActivityItem
The token was needed because the TaskFragment info may not
sent to the organizer before activity created.

The token is no longer necessary because the TaskFragment
info is now ensured to be updated before activity created.

Bug: 200303250
Test: wm presubmit
Change-Id: I69a42fa35efde4fc7f37ab50334de5de146da90d
2021-09-29 13:53:43 +08:00
TreeHugger Robot
80fcbc8fe0 Merge "[NGA v2] Reliable Visible Activity Lookup" into sc-v2-dev 2021-09-28 17:50:34 +00:00