Commit Graph

7750 Commits

Author SHA1 Message Date
Nikita Ioffe
27d6605c52 Merge "Respect MANAGE_EXTERNAL_STORAGE in checks for READ/WRITE_EXTERNAL_STORAGE" into rvc-dev 2020-06-16 10:02:49 +00:00
Nikita Ioffe
fc3a740282 Respect MANAGE_EXTERNAL_STORAGE in checks for READ/WRITE_EXTERNAL_STORAGE
Test: test app mentioned in the bug
Bug: 158316513
Change-Id: I254479d6616d2e09349fcd9c569c5092dbdefaca
2020-06-15 13:01:06 +01:00
Alex Buynytskyy
0403545508 Don't provide read logs for shell-initiated installations.
Only if the application is profileable.

Bug: 158238023
Fixes: 158238023
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageParserTest
Change-Id: I8575830ec3f29850297fdbfbaa157072d6350a28
Merged-In: I8575830ec3f29850297fdbfbaa157072d6350a28
2020-06-12 13:30:45 -07:00
Adam Bookatz
a677e1c6f9 Merge "Default isUserSwitcherEnabled showEvenIfNotActionable" into rvc-dev 2020-06-12 00:47:47 +00:00
Lais Andrade
ef5d8751e6 Add details to VibrationEffect waveform documentation
Explain the time unit of timings argument and copy explanation of
amplitude values to the summary segments of the javadocs.

Fix: 140846849
Test: N/A
Change-Id: Ia6fd6cb5d0e16076a54f24f7c3d2f3d4ca78d5bd
2020-06-11 16:39:36 +00:00
Adam Bookatz
600210d7cb Default isUserSwitcherEnabled showEvenIfNotActionable
In ag/11573771, the default value for isUserSwitcherEnabled() was
put as false, but it was supposed to be true (as it had been
in patch 1 of that cl).

Bug: 157881376
Test: manual
Change-Id: I456e7eb9527dad8da5d5f99ecbfc8bcf40b7bdcc
2020-06-11 00:22:37 +00:00
TreeHugger Robot
8434b9fc88 Merge "Apply app data isolation on isolated or app zygote processes" into rvc-dev 2020-06-08 11:03:56 +00:00
Ricky Wai
e986bc4cad Apply app data isolation on isolated or app zygote processes
Fix: 158088415
Test: atest AppDataIsolationTests
Change-Id: Ic55464397039645938822ac20eb12e375bbe4a72
2020-06-05 11:50:50 +01:00
TreeHugger Robot
d5fb11a761 Merge "Get the instance count as the initial value" into rvc-dev 2020-06-05 03:34:32 +00:00
Jeff Sharkey
0a8e32c124 Logging to aid bug investigation.
We're trying to figure out where volumes are disappearing.

Bug: 158059178
Test: none
Change-Id: I68959f0a163e2fece13fcb08a6c9f55ec1beb0f6
2020-06-04 17:35:38 -06:00
Peiyong Lin
1371b76afd Merge "Allow to load implicit layer from /vendor/app." into rvc-dev 2020-06-04 00:40:15 +00:00
Peiyong Lin
eb1c5a4c28 Allow to load implicit layer from /vendor/app.
Currently when loading implicit layers from apks, NativeLoaderNamespace
doesn't allow to dlopen the binaries if they come from apks from
/vendor/app. Implicit layers ship within /vendor/app should work like
other implicit layers. This patch extracts the construction of library
paths of the implicit layers and includes those paths when
NativeLoaderNamespace is created as the part of the permitted library
paths.

Bug: b/157832445
Test: atest android.gputools.cts.CtsRootlessGpuDebugHostTest
Test: setup debug layer and use adb logcat to check vulkan loader output
Change-Id: Ie2ca989bcab890578b5aa540d07f2aee2a0182bd
2020-06-03 21:30:08 +00:00
Zhen Zhang
2260f7102f Merge "Allow low ram device to have multiple users and managed profies" into rvc-dev 2020-06-03 17:19:30 +00:00
Martijn Coenen
0a8ef2b45f Merge "Use killProcessGroup when killing app zygote." into rvc-dev 2020-06-02 06:54:46 +00:00
Jeff Sharkey
c99a508218 Merge "Revert "Apps shouldn't be disabling StrictMode checks."" into rvc-dev 2020-06-01 15:55:14 +00:00
Jeff Sharkey
3080fb7c9e Revert "Apps shouldn't be disabling StrictMode checks."
This reverts commit 14e961870a.

Reason for revert: satayev@
Bug: 156336269

Change-Id: Ic0d3a650156c06f58fce4c28157191f4497469f0
2020-06-01 15:54:41 +00:00
Jeff Sharkey
fd71805e1c Merge "Support getStorageVolume() for synthetic volumes." into rvc-dev 2020-06-01 14:18:32 +00:00
Jeff Sharkey
4d96602de0 Merge "Apps shouldn't be disabling StrictMode checks." into rvc-dev 2020-06-01 14:16:54 +00:00
Zhen Zhang
bd16014d0b Allow low ram device to have multiple users and managed profies
Remove these runtime restrictions of low ram device.
This change wouldn't bring the features onto low ram device, because
manufacturers need to change some configs to enable the features, but
would allow the usage.

Bug: 153016458
Test: build successful; multiple users and managed profiles can be
enabled with config changes

Change-Id: Ibe59219dab7e138d7dae19df77d36477e9e76b8e
2020-05-29 22:29:01 +00:00
felipeal
283e3c388d Fixed how ShellCommand show exceptions.
Prior to this change, it was duplicating the exception. Example:

$ adb shell cmd car_service create-user --flags 4444 --timeout 100 --hal-only Dude

Exception occurred while executing: new user flags mismatch on existing users on {.requestId = 2, .newUserInfo = {.userId = 11, .flags = 0x115c}, .newUserName = Dude, .usersInfo = {.currentUser = {.userId = 11, .flags = NONE}, .numberUsers = 3, .existingUsers = [{.userId = 0, .flags = 0x9}, {.userId = 10, .flags = ADMIN}, {.userId = 11, .flags = NONE}]}}
java.lang.IllegalArgumentException: new user flags mismatch on existing users on {.requestId = 2, .newUserInfo = {.userId = 11, .flags = 0x115c}, .newUserName = Dude, .usersInfo = {.currentUser = {.userId = 11, .flags = NONE}, .numberUsers = 3, .existingUsers = [{.userId = 0, .flags = 0x9}, {.userId = 10, .flags = ADMIN}, {.userId = 11, .flags = NONE}]}}
	at com.android.internal.util.Preconditions.checkArgument(Preconditions.java:69)
	at android.car.userlib.UserHalHelper.toVehiclePropValue(UserHalHelper.java:503)
	at com.android.car.hal.UserHalService.createUser(UserHalService.java:339)

Now it's showing the failed command instead:

Exception occurred while executing 'create-user --flags 4444 --timeout 100 --hal-only Dude':
java.lang.IllegalArgumentException: new user flags mismatch on existing users on {.requestId = 2, .newUserInfo = {.userId = 11, .flags = 0x115c}, .newUserName = Dude, .usersInfo = {.currentUser = {.userId = 11, .flags = NONE}, .numberUsers = 3, .existingUsers = [{.userId = 0, .flags = 0x9}, {.userId = 10, .flags = ADMIN}, {.userId = 11, .flags = NONE}]}}
	at com.android.internal.util.Preconditions.checkArgument(Preconditions.java:69)
	at android.car.userlib.UserHalHelper.toVehiclePropValue(UserHalHelper.java:503)
	at com.android.car.hal.UserHalService.createUser(UserHalService.java:339)

Test: manual verification
Bug: 150408921

Change-Id: I42221fbe2410770b0755c32d16620acc71d8d5d2
2020-05-29 21:21:56 +00:00
Martijn Coenen
6bec07ec39 Use killProcessGroup when killing app zygote.
To make sure we kill all untracked children, too.

Bug: 156741968
Bug: 157598956
Test: manual inspection, PoC no longer works.
Change-Id: I5d8efeb05ddec08a7fc7c00eabca6590c4cfdd8c
2020-05-29 14:49:25 +02:00
Jeff Sharkey
88818fe7b2 Support getStorageVolume() for synthetic volumes.
The MediaStore.VOLUME_EXTERNAL volume is a synthetic collection of
all currently mounted storage volumes, so if someone wants to find
the underlying StorageVolume for one of these Uris, we need to query
to resolve the real volume name.

Bug: 153664437
Test: atest android.provider.cts.MediaStoreTest
Change-Id: I7b28ba3bfd5b7a4cc577830940de4a2e1cbd1932
2020-05-28 19:18:40 -06:00
Jeff Sharkey
14e961870a Apps shouldn't be disabling StrictMode checks.
Since Android N we've helpfully guided apps towards using content://
Uris when sharing data, but some obstinate apps have tried bypassing
these helpful checks.  Since we're finally changing the storage model
in Android R, we really to communicate strongly that apps must be
using content://, and these methods should not be used.

Bug: 156336269
Test: manual
Change-Id: Id8707ecb51f3a24747b4c84d86c70591fb5f7ffc
2020-05-28 15:34:11 -06:00
Songchun Fan
f2a6af4b8a Merge "[incremental] respect extractNativeLibs in native lib config" into rvc-dev 2020-05-27 22:17:23 +00:00
Songchun Fan
14f6c3c735 [incremental] respect extractNativeLibs in native lib config
Makes sure the behavior is consistent with legacy installs:

When the flag is on, the native libs will be extracted to subdirs under
lib/.
When the flag is off, the lib/ subdirs will be created but the native
libs are not extracted.
When the flag is off, check if the native libs are uncompressed and well
aligned.

Test: atest android.extractnativelibs.cts.CtsExtractNativeLibsHostTest
BUG: 157173358
Change-Id: Idb57fd7ca1115f787faf5cde3056c32ff3f60890
2020-05-27 22:16:57 +00:00
Adam Bookatz
203a17d955 Merge "Unify multiuser switcher enabled setting" into rvc-dev 2020-05-27 17:15:33 +00:00
Alex Johnston
155d909a08 Merge "Per-profile user restrictions in org-owned managed profile" into rvc-dev 2020-05-27 13:12:43 +00:00
Adam Bookatz
d626fd310c Unify multiuser switcher enabled setting
This does the following:
1. The multiuser switcher (in Settings and SysUI)
is now disabled by default. In order for it to be enabled
one of the following must be true:
  a. the user has explicitly toggled it on in Settings
  b. a new user gets created (via any means)
  c. config_showUserSwitcherByDefault overrides this default

2. Even if a new user is added, if the user had explicitly
*disabled* the switcher, the switcher still won't be enabled.

3. SystemUI and Settings (et al.) all use
UserManager.isUserSwitcherEnabled as the source of
truth in this regard.
No one else reads USER_SWITCHER_ENABLED directly.

4. If the switcher is enabled, then SystemUI will show the
switcher avatar, even if there are no other users on the device,
as long as new users can be created. This way, if the user
has enabled the switcher, the user can use the avatar to add
guest/secondary users (which would not be possible if enabled
status was tied solely to the existence of other users).

Bug: 137943217
Bug: 141372193
Bug: 149973281
Bug: 130270878

Test: manual: Settings > Multiuser doesn't turn on the systemui avatar
Test: manual: Settings > Multiuser is initially disabled
Test: manual: adb shell pm create-user A, does turn on sysui avatar
              even if the user didn't enable, but not if they disabled

Change-Id: Ia440b4db78792da76f94322a563d93db0c68e933
2020-05-26 23:01:55 +00:00
Alex Buynytskyy
8ef61aebee Lifecycle: detecting blocked and unhealthy.
Part 1: interfaces and PM implementation.

Bug: 153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I312dd919d2bb552bea3d72fb49fd1579882da14b
2020-05-26 19:34:39 +00:00
Collin Fijalkovich
adfe0e9193 Merge "Cache isUserUnlockingOrUnlocked Binder calls" into rvc-dev 2020-05-26 17:49:51 +00:00
Alex Johnston
97b68a53fb Per-profile user restrictions in org-owned managed profile
Background
* Some user restrictions should be per-profile
  instead of per-device to allow for more
  granularity.
* For this reason, the profile owner of an
  organization-owned managed profile should
  apply user restrictions the same way as the
  profile owner on the personal user
  (instead of the device owner).

Changes
* Move per-profile user restrictions from
  PROFILE_OWNER_ORGANIZATION_OWNED_GLOBAL_RESTRICTIONS
  to PROFILE_OWNER_ORGANIZATION_OWNED_LOCAL_RESTRICTIONS
  in UserRestrictionsUtils
* Update UserManager javadocs
* Update DevicePolicyManagerTest

Bug: 148453838
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testDevicePolicyManagerParentSupport
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testUserRestrictionSetOnParentLogged
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testUserRestrictionsSetOnParentAreNotPersisted
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testPerProfileUserRestrictionOnParent
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testPerDeviceUserRestrictionOnParent
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testCameraDisabledOnParentIsEnforced
      atest com.android.cts.devicepolicy.OrgOwnedProfileOwnerTest#testCameraDisabledOnParentLogged
Change-Id: I431f7b9bf45a24b77f62899794561d6098f2a54b
2020-05-26 14:32:01 +01:00
Adam Bookatz
535e4abdd2 Merge "UserRestriction doc fix: primary -> admin" into rvc-dev 2020-05-21 22:44:53 +00:00
Chilun
762f0493ca Get the instance count as the initial value
Developer may not be able to enable strict mode before creating any
activities. The initial value of expected instance count may not always
be 1.

This CL use the instance count from InstanceTracker as the initial
value.

Bug: 152348723
Test: atest ActivityLeakTests
      atest NexusLauncherTests
Change-Id: I8d34c87748deac72cf8b6e5cc247029901bbffb3
2020-05-21 18:53:44 +08:00
shafik
3acc77cc7b Reconfigure Scoped Storage experiment: force ScSt on list of apps
Add a DeviceConfig feature that denotes a list of apps we want to force
into scoped storage. This would allow us to test these apps behaviours
under scoped storage at scale.

Also add the feature to StorageManagerService#dump.

Test: manual:
$ adb shell device_config put storage_native_boot forced_scoped_storage_whitelist <pkg>
$ adb reboot
$ adb shell dumpsys appops --package <pkg> # observe LEGACY_STORAGE
mode=ignored
Test: adb shell dumpsys mount
Bug: 151735608

Change-Id: I6a43e987ebf8d14fb64103a74bafde28f5863ae2
2020-05-20 12:37:24 +01:00
TreeHugger Robot
669b6a5987 Merge "Update documentation for ACTION_CLEAR_APP_CACHE" into rvc-dev 2020-05-18 10:27:53 +00:00
shafik
75bb8caa55 Update documentation for ACTION_CLEAR_APP_CACHE
The actual cache clearing is not async anymore, so we can report the
status to the calling app. Here, we just change the documentation to
make the caller aware of the 3rd possible activity result: EIO.

This value is returned if an error happens while MediaProvider is
clearing the cache. In this case, we don't know how much of the cache
was deleted, if at all.

Test: build
Bug: 155290762
Change-Id: I3a04a9b5b6b07c6ec61e97a4cb0d3bc8b10b0370
2020-05-18 10:26:37 +00:00
TreeHugger Robot
7588f0d7a0 Merge "Fix for goat detection code" into rvc-dev 2020-05-16 01:41:30 +00:00
Collin Fijalkovich
3e7d47a09d Cache isUserUnlockingOrUnlocked Binder calls
isUserUnlocked and isUserUnlockingOrUnlocked share the same service-side
dependencies, so we can add a cache to the client-side of transaction
and hook into the isUserUnlocked cache invalidation infrastructure.

Bug: 140788621
Test: atest CtsMultiUserHostTestCases while validating cache operations.
Change-Id: Icf11b1e777936ec9922ce4a47f8cfccbd22ad5ef
2020-05-15 17:03:57 -07:00
Amith Yamasani
1f6e0b89b2 Fix for goat detection code
Since as of R, apps can no longer query other apps by default,
deprecate the isUserAGoat API's undocumented behavior and
always return false.

Fixes: 156543788
Test: atest CtsMultiUserTestCases
Change-Id: I9743d87b762aabb01dc010ba6d5a6c01643a1f92
2020-05-15 14:45:01 -07:00
Wenjie Zhou
751c7c947a mCallback defined in BringYourOwnSection should be an object instead of a reference.
The referenced object could be destroyed and result in native crash when
mCallback is used.

Bug: 156536687
Test: manual test with registering a section from an app
Change-Id: Ie36c0e6e64be1246539f12999f037c24377686dd
2020-05-14 15:24:39 -07:00
TreeHugger Robot
eb191392e6 Merge "Don't try to recreate IncrementalFileStorages on re-commit." into rvc-dev 2020-05-13 16:01:39 +00:00
Alex Buynytskyy
4dbc0607ee Don't try to recreate IncrementalFileStorages on re-commit.
Bug: 156287164
Fixes 156287164
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest

Change-Id: I75e392a1fa84df8b6ac0b855233f9a2662998e96
2020-05-12 13:49:29 -07:00
Michael Wright
2e7e81c950 Add OWNERS for display, haptics, input and power
Bug: 156349083
Test: N/A
Change-Id: Ia8afccfc2e470095ae3d52c827c0ac78b7c120ae
2020-05-12 19:11:13 +01:00
Adam Bookatz
d521185f01 UserRestriction doc fix: primary -> admin
These UserRestrictions' caveats actually apply to the
admin user, not the primary user, so we update the
documentation accordingly.

Bug: 132720870
Bug: 132719585
Test: none; it's just documentation
Change-Id: I9828136fe25537a1065423245fb0706520bf7480
2020-05-11 23:42:38 +00:00
Adam Bookatz
a88d4c09e4 Clarify UM.createUser javadoc
When creating admin users, default
UserRestrictions do indeed apply, so updating
the javadoc.

Test: N/A
Bug: 143491938
Change-Id: Id495599abd4ddee100ca2c761d3b420fff315482
2020-05-11 22:22:32 +00:00
Beverly Tai
78a66d6c36 Merge "Add badge colors for dark theme" into rvc-dev 2020-05-10 18:10:15 +00:00
Jing Ji
baf2d6448e Check the isInUse with the lock held in MessageQueue
Fix a potential race condtion when the same message object
is being enqueued by two threads.

Bug: 150263007
Bug: 154867444
Test: atest android.os.cts.MessageQueueTest
Change-Id: Id79448ba8719479cbdb054f2cdd172fdcbe86d47
(cherry picked from commit 96a6fec4d6)
2020-05-08 21:14:23 +00:00
Beverly
2b4306a8ec Add badge colors for dark theme
Test: manual
Test: atest UserManagerTest#testProfileTypeInformation
Fixes: 149669756
Change-Id: Ib3fd377a4902bbe936d574dc52bac4eae6e25dd4
2020-05-07 09:20:19 -04:00
Alex Johnston
9ace11127c Restrict creation of secondary users
Background
* Secondary users should be disabled
  when the device is an organization-owned
  managed profile device.
* This is because supporting secondary
  users would complicate the semantics of
  user restrictions.

Changes
* Add DISALLOW_ADD_USER as a base restriction
  when the device is an organization-owned
  managed profile device.
* Handle removal case when the device is no
  longer in this mode.
* Remove the ability of other admins to apply
  DISALLOW_ADD_USER.

Manual Testing Steps
* Provision an organization-owned managed
  profile device.
* Check Settings > System > Multiple users
  and verify that a user cannot be added.
* Check WP TestDPC 'Set user restrictions
  on parent' and verify 'Disallow add user'
  is not present.

Bug: 155281701
Test: Manual testing
      atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: I83348fc8b854cef20383803124000540b5b130cb
2020-05-07 13:58:31 +01:00
Svet Ganov
38cd221d81 Updating platform SDK version for R
* Finalize resources
  * Update appt/aapt2 constants
  * Update R and SDK constants
  * Fix a crashloop bug

Test: build + boot

bug:150281259

Change-Id: Ie56e12336cd1fcf347ac7164f6988b0c2da77c7d
Merged-In: Ie56e12336cd1fcf347ac7164f6988b0c2da77c7d
2020-05-03 09:58:54 -07:00