Commit Graph

7726 Commits

Author SHA1 Message Date
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
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
Andrew Sapperstein
8fe35e5f21 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Exempt-From-Owner-Approval: cherry-picked from master
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
Merged-In: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
(cherry picked from commit e0624c7a40)
2020-05-01 18:25:32 +00:00
Brad Ebinger
c4815d409c Merge "Add clearAll method to RegistrantList for easier cleanup" into rvc-dev 2020-04-30 20:07:31 +00:00
Jeff Sharkey
1eb3fcfb33 Merge "Update more Parcelables to send Strings UTF-8." into rvc-dev 2020-04-29 23:55:03 +00:00
Brad Ebinger
eb4355ae4e Add clearAll method to RegistrantList for easier cleanup
Bug: 155320231
Test: atest FrameworksTelephonyTests
Change-Id: I6f1896ae163e77cff30e89a5b01b41162fc58200
2020-04-29 15:19:52 -07:00
Jeff Sharkey
1639e6b8ee Update more Parcelables to send Strings UTF-8.
An earlier CL with benchmarks has shown that sending strings as UTF-8
is 50% faster for US-ASCII strings, and still 68% faster for complex
strings referencing higher Unicode planes.  (So an improvement in
both cases!)

Since code across the OS still makes heavy assumptions about Parcel
strings typically being UTF-16, we need to carefully migrate
Parcelables by hand, which is what this CLs begins doing.

Bug: 154436100
Test: manual
Change-Id: I9a675473e0ce3a4a5c5e305dd851b40bb1560e1c
2020-04-29 14:54:44 -06:00
Martijn Coenen
1ed01451ed Merge "Add buildExternalStorageAndroidObbDirs()." into rvc-dev 2020-04-29 18:53:13 +00:00
Yifan Hong
325bbcf799 Merge "Update cleanupAppliedPayload comment." into rvc-dev 2020-04-29 00:08:37 +00:00
Yifan Hong
524d0f5c28 Update cleanupAppliedPayload comment.
ServiceSpecificException might be thrown, but it is not
actionable by the caller. Hence hide the comment.

Fixes: 151156841
Test: none
Change-Id: I07836fe2c5cc361fa81f6fc24851ad2b0721591b
(cherry picked from commit d3abb6d385)
Merged-In: I07836fe2c5cc361fa81f6fc24851ad2b0721591b
2020-04-28 14:41:50 -07:00
Martijn Coenen
806a185ba5 Add buildExternalStorageAndroidObbDirs().
For use by DownloadManager.

Bug: 153504419
Test: atest CtsDownloadManagerInstaller
Change-Id: Ifd45ad779087fb5ba3d885d8e648bc24bc8656eb
2020-04-27 14:09:01 +02:00
TreeHugger Robot
8f0b08f178 Merge "Migrate clients from Binder.waitForService to ServiceManager.waitForService" into rvc-dev 2020-04-24 21:16:54 +00:00
TreeHugger Robot
137f875360 Merge "Use waitForDeclaredService to get Lights HAL" into rvc-dev 2020-04-24 17:23:42 +00:00
Robin Lee
9e1181302a Use waitForDeclaredService to get Lights HAL
We cache the reference to the HAL and use a DeathRecipient to keep track
of whether it's still good.

Adds waitForService and waitForDeclaredService to the ServiceManager
Java implementation because they were missing.

Test: atest LightsManagerTest
Test: atest LightsServiceTest
Bug: 152509747
Bug: 154631113
Bug: 154627432
Bug: 154629168
Change-Id: Ife8471f3a7e47b48bb31015ddf40f1d7fef6240f
2020-04-24 16:12:27 +02:00
Paul Chang
b43fb9b839 Merge "Send intent to let calling app show UI safely without interfering the bugreport/screenshot generation." into rvc-dev 2020-04-24 08:23:21 +00:00
Robin Lee
3124f5c44e Migrate clients from Binder.waitForService to ServiceManager.waitForService
Change-Id: I749203ba09b63dd4aafd6e7df9b87b3fd7955689
Test: ApexManagerTest # (and manually flash a device)
Fix: 154629168
2020-04-23 21:05:46 +00:00
fengjinlan
6c2adc82cc Add method in Handler to remove messages with equal object
Bug: 142293357
Test: atest AudioDeviceBrokerTest

Change-Id: Ibae80f5008df54f4ac8544abb4cc5863ea3db86d
Merged-In: Ibae80f5008df54f4ac8544abb4cc5863ea3db86d
Signed-off-by: fengjinlan <fengjinlan@xiaomi.com>
2020-04-23 11:20:43 -07:00
Paul Chang
6dcc047940 Send intent to let calling app show UI safely without interfering the bugreport/screenshot generation.
- Calling app needs the intent from platform to show UI safely without interfering the bugreport/screenshot generation.
- Currently IncidentCompanionService can only send the intent to app of personal profile when there is work profile.
- But calling app may be from work profile.
- So change to use BugreportManager to send the intent to calling app.

BUG: 153809412
Test: Flash, press bugreport shortcut and confirm calling app of work profile can receive the intent.
Change-Id: I45b2b7ab8e017ba93c1e71ad53f4aa3607af9106
2020-04-23 18:14:57 +08:00
Yurii Zubrytskyi
f3d4495df9 Merge changes I227d8e0c,Ided4415a into rvc-dev
* changes:
  [incfs] Small cleanup in staging -> final dir rename
  [incfs] Use MountRegistry to import existing mounts on start
2020-04-22 18:26:15 +00:00
Yurii Zubrytskyi
930f1d10bc Merge changes I8942a2db,Ibcef3f40,I6e765563 into rvc-dev
* changes:
  [incfs] Cleanup storage creation and don't use temp directory
  [incfs] Notify IncrementalService about system startup later
  [incfs] Fix bad path::join() path preparation
2020-04-22 18:25:49 +00:00
Yurii Zubrytskyi
08a4c7f70b [incfs] Small cleanup in staging -> final dir rename
Bug: 153704006
Test: atest PackageManagerShellCommandTest \
  PackageManagerShellCommandIncrementalTest \
  IncrementalServiceTest
Change-Id: I227d8e0cba6554bf8cf58a16598f34ccbf3d21c0
2020-04-22 00:49:05 -07:00
Yurii Zubrytskyi
360bbdc720 [incfs] Cleanup storage creation and don't use temp directory
Bug: 153704006
Test: atest PackageManagerShellCommandTest \
  PackageManagerShellCommandIncrementalTest \
  IncrementalServiceTest
Change-Id: I8942a2db766cfdb7c119112cc9b58ee0287f1767
2020-04-22 00:39:44 -07:00
Jeff Sharkey
b67e70aa40 Merge changes from topic "apr19" into rvc-dev
* changes:
  Update some Parcelables to send Strings UTF-8.
  Offer to write Strings through Parcels as UTF-8.
2020-04-21 22:59:40 +00:00
Jeff Sharkey
d387e79ae1 Offer to write Strings through Parcels as UTF-8.
Recently while investigating some Binder limits, I discovered that
we're still sending Strings across Binder as UTF-16, which is very
wasteful for two reasons:

1. The majority of data flowing through APIs like PackageManager is
already limited to US-ASCII, and by sending UTF-16 we're wasting
half of our transactions on null-byte overhead.

2. Internally ART is already "compressing" simple strings by storing
them as US-ASCII instead of UTF-16, meaning every time we want to
write a simple string to Binder, we're forced to first inflate it
to UTF-16.

This change first updates Parcel.cpp to accept char* UTF-8 strings,
similar to how it accepts char16_t* for UTF-16.  It then offers
both UTF-8 and UTF-16 variants to Parcel.java via JNI.  We also
update the String8 handling to behave identical to String16.

This change adds benchmarking to show that these new methods are
about 50% faster for US-ASCII strings, and about 68% faster for
complex strings that reference higher Unicode planes.  (So an
improvement in both cases!)

Bug: 154436100
Test: atest FrameworksCoreTests:ParcelTest
Test: make core-libart conscrypt okhttp bouncycastle vogar caliper && vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/ParcelStringBenchmark.java
Change-Id: I22a11d3497486d922ec8e14c85df66ca096b8f2a
2020-04-21 09:38:36 -06:00
Martijn Coenen
29d6a24fbf Merge "Don't update quota for non-emulated volumes." into rvc-dev 2020-04-21 12:22:48 +00:00
Martijn Coenen
1b981a3aea Don't update quota for non-emulated volumes.
Since they don't support quota. Also, don't throw an exception if we
can't find a volume for the passed-in path, but warn instead: the volume
may be unstable and have disappeared by the time we do this.

Bug: 152618535
Test: boot emulated image; verify no crashes when inserting media on
      public storage
Change-Id: I0e6b8f5c9f9f35b80b7bd5f6255a70e210a30474
2020-04-21 12:51:47 +02:00