Commit Graph

7585 Commits

Author SHA1 Message Date
Songchun Fan
197105097a Merge changes from topic "fix-steaming-splits"
* changes:
  use shell to open v4 signature file
  fix streaming installation for splits
2020-02-24 16:30:10 +00:00
Automerger Merge Worker
0483b7ad92 Merge "Add DSU default userdata partition size" am: 59d40857ad am: 026c077b36 am: 020b636ab7 am: ec318a1152 am: 221f4dda0a
Change-Id: I828edafb51eb0b0bef0bd252df7a9a57d302919c
2020-02-24 10:02:25 +00:00
Automerger Merge Worker
020b636ab7 Merge "Add DSU default userdata partition size" am: 59d40857ad am: 026c077b36
Change-Id: I635689b5051e503f3cdcb5d06695bca01ea0572a
2020-02-24 09:39:04 +00:00
Automerger Merge Worker
026c077b36 Merge "Add DSU default userdata partition size" am: 59d40857ad
Change-Id: I90d675f1ff0426c751b77442c6ce1c6e09fe6c72
2020-02-24 09:26:22 +00:00
Yo Chiang
f41e145480 Add DSU default userdata partition size
Use DEFAULT_USERDATA_SIZE as userdata partition size if the calling
Intent desn't specify the userdata size or the specified size is zero.

Bug: 145891687
Test: adb shell am start-activity \
  -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
  -a android.os.image.action.START_INSTALL \
  -d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip

Change-Id: I52767dfefef394403c5e16fcfd40792b14ff9a71
2020-02-24 15:06:56 +08:00
Songchun Fan
cdbcb34c2b use shell to open v4 signature file
BUG: 133435829
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I8e57b00f042f8b6c85d5f905460dd2da6199accc
2020-02-23 21:44:53 -08:00
Makoto Onuki
dd70ba27c1 Merge "Squash same ApplicationInfo's in Parcel" 2020-02-22 01:58:36 +00:00
Makoto Onuki
7d09275d70 Squash same ApplicationInfo's in Parcel
ApplicationInfo now automatically tries to "squash" the same instances in a
Parcel.

NOTE: This CL still does *not* optimize the package manager APIs that return a
list. e.g. PM.queryContentProviders() still return duplicate AppInfo's.
We can optimize them by making ParcelableListSlice call "allowSquashing",
but that *could* have negative side effects, so I'm not doing it in this CL.
I think we can do that for S.

Bug: 148588589
Test: atest CtsContentTestCases # except for two preexsiting failures:
- android.content.pm.cts.PackageManagerTest#testGetIcon
- android.content.pm.cts.PackageManagerTest#testGetPreferredActivities

Test: Use the debugger and make sure bindApplication() is not receiving
duplicate AppInfo's in the provider list.

Change-Id: I3ba2c047a469169340c0f75c36bdfd394bc5d627
2020-02-21 14:19:43 -08:00
Sudheer Shanka
77f2a2c3dd Merge "Update BlobStoreMS to augment storage stats with blobs data." 2020-02-21 19:28:09 +00:00
Chris Ye
e078ee507e Merge "Add native Thermal Throttling API to libandroid." 2020-02-21 03:21:18 +00:00
Iavor-Valentin Iftime
4eb7c72945 Merge "Address API council suggestions for UserManager APIs" 2020-02-20 20:35:44 +00:00
Valentin Iftime
4bf82c8206 Address API council suggestions for UserManager APIs
Test: atest UserManagerTest
Bug: 149742406
Change-Id: I8b408a17de0282b91fcb5c0b66e9d0404fda54b1
2020-02-20 14:29:43 +01:00
Charles Chen
c56ce6fd08 Merge "Exempt-From-Owner-Approval: Report non-visual Context misuse" 2020-02-20 12:30:06 +00:00
TreeHugger Robot
58a8b7f51d Merge "Switch to new project ID constants." 2020-02-20 07:59:07 +00:00
Andrii Kulian
5877c7d6c0 Exempt-From-Owner-Approval: Report non-visual Context misuse
Make obtaining a visual service from non-visual Context instance
report a strict mode violation and print the stacktrace.

Make calling getDisplay() throw an exception if called on an instance
that is not associated with a display. For existing usages introduce
a new internal method that does not perform the verification until
the usages are properly fixed.

Bug: 128338354
Test: StrictModeTest#testIncorrectContextUse_GetSystemService
Test: StrictModeTest#testIncorrectContextUse_GetDisplay
Change-Id: Id25d590eca6e10066e55d7ed6436d3bc9e433beb
2020-02-20 01:29:25 +00:00
Chris Ye
48dbcaae41 Add native Thermal Throttling API to libandroid.
Add native thermal manager API of thermal mananger service into
libandroid. Export Thermal API as NDK library.

Bug: 137151587
Bug: 136285293
Test: build, atest thermalmanager-test atest CtsThermalTestCases

Change-Id: Ia49fb2133624ffcd6168af804ae612ef2bb190f2
2020-02-19 16:25:25 -08:00
Sudheer Shanka
e9232d6d6f Update BlobStoreMS to augment storage stats with blobs data.
- Any pending sessions data is attributed to the apps
  which contributed them.
- Any commited blobs data is attributed to the app which
  has a lease on it. If multiple apps have lease on a blob, don't
  attribute the blob to those apps for now.
- Remove StorageStatsAugmenter.augmentStatsForUser as it
  is not used for anything currently.
- Fix an issue in how we override existing committers and leasees.

Bug: 148694869
Test: atest cts/tests/BlobStore/src/com/android/cts/blob/BlobStoreManagerTest.java
Test: atest tests/tests/os/src/android/os/storage/cts/StorageStatsManagerTest.java
Test: atest hostsidetests/appsecurity/src/android/appsecurity/cts/StorageHostTest.java
Test: manual
Change-Id: Ia4af0a2549c75db66741f2d1979de95d2d150bc8
2020-02-19 14:45:12 -08:00
Yurii Zubrytskyi
df7c050e16 Add a version field to the v4 signature file format
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest
Bug: b/136132412 b/133435829
Change-Id: I09fd36eb5914f59d63c5c244e34db75aa4f43639
2020-02-19 14:03:23 -08:00
Ricky Wai
62048287d9 Merge "Bind mount obb directory in emulated storage." 2020-02-19 19:42:13 +00:00
Pavel Grafov
fba650eaed Merge "Add "Forgot my password" to start profile in locked state." 2020-02-19 19:09:20 +00:00
Dan Stoza
a6781c835d Merge "Add PowerManager#getThermalHeadroom" 2020-02-19 18:18:31 +00:00
Martijn Coenen
fd12f36fb9 Switch to new project ID constants.
These are used on devices without sdcardfs.

Bug: 146419093
Test: lsattr -pR
Change-Id: I87c900d409c90770fb3eaa595324dab385458c6c
2020-02-19 16:04:02 +01:00
Martijn Coenen
961709fbab Merge "Fixup OBB directories correctly after package install." 2020-02-19 14:02:25 +00:00
Pavel Grafov
4513e24323 Add "Forgot my password" to start profile in locked state.
Feature is disabled on non-FBE devices since the profile user will
end up in RUNNING_UNLOCKED state.

Bug: 143516540
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Test: manual
Change-Id: Ib87492577b4e5153a8108036af89c547e4bb76ee
2020-02-19 12:44:12 +00:00
Ricky Wai
e5088d92df Bind mount obb directory in emulated storage.
- Create obb directories for packages when zygote starts.

- During zygote fork, bind all visible obb package directories
for an app.

- If app data isolation is not enabled for that process, bind
mount the whole obb directory instead.

Bug: 148049767
Bug: 137890172
Test: atest android.appsecurity.cts.AdoptableHostTest
Change-Id: I841e98c120d447b148c22cfd809d738427b04f2e
2020-02-19 12:37:23 +00:00
Dan Stoza
b04705837a Add PowerManager#getThermalHeadroom
Adds getThermalHeadroom, which allows users to determine how close the
device currently is to SEVERE thermal throttling. For intensive
applications which can scale their workloads, this allows them to help
manage the thermal envelope of the device.

Test: Manual, modify Filament test app to call and observe values
Test: PowerManagerTest#testGetThermalHeadroom
Test: atest android.os.cts.PowerManager_ThermalTest
Test: atest com.android.systemui.statusbar.phone.StatusBarTest
Test: atest CachedDeviceStateServiceTest
Test: atest AbstractAccessibilityServiceConnectionTest
Test: atest KeyEventDispatcherTest
Test: atest AttentionManagerServiceTest
Test: atest HdmiControlServiceTest
Test: atest ThermalManagerServiceTest
Test: atest RecoverySystemServiceTest
Bug: 136285293
Change-Id: I26e1c849c4b08cbf7ee0057f555cf0893750da43
2020-02-18 17:29:26 -08:00
Automerger Merge Worker
1f82fbb4ac Merge "Improve BaseBundle#kindofEquals" am: 42ab50d14b
Change-Id: Ic5c2c5bcf979236c77344d0507d071bbb83f624e
2020-02-19 00:33:09 +00:00
Treehugger Robot
42ab50d14b Merge "Improve BaseBundle#kindofEquals" 2020-02-18 23:56:30 +00:00
Collin Fijalkovich
ceb5e24ae6 Merge "Cache PowerManager binder calls" 2020-02-18 19:31:36 +00:00
Martijn Coenen
b3562f43d2 Fixup OBB directories correctly after package install.
The installer may pre-create OBB directories for packages that it is
installing on external storage, in locations like
/storage/emulated/0/data/obb/com.foo . The permissions on this directory
is never explicitly setup; instead, sdcardfs magically fixed up the
permissions to match the package name "com.foo".

With sdcardfs going away in devices launching with R, we need to set
the permissions for these paths up explicitly. Since only vold can do
that, have PackageManager call into StorageManager after an app
install/upgrade to do the correct setup.

Bug: 146419093
Test: manually verify directories are setup correctly
Change-Id: I530c8de196011b1dc97c7a9ab612e5d6dc9403a1
2020-02-18 15:23:35 +01:00
Treehugger Robot
46d77cf71c Merge "Add getAvbPublicKey to IDynamicSystemService" am: ecd7c440df am: d584bb1ef0 am: 0ed127a6b6
Change-Id: I8d6ae5ccebe085e08f48abc6f7624419e4de043e
2020-02-18 13:19:50 +00:00
Treehugger Robot
0ed127a6b6 Merge "Add getAvbPublicKey to IDynamicSystemService" am: ecd7c440df am: d584bb1ef0
Change-Id: I6014b4ad6cf0bf6ee08ff999447625a89b522794
2020-02-18 13:03:44 +00:00
Treehugger Robot
d584bb1ef0 Merge "Add getAvbPublicKey to IDynamicSystemService" am: ecd7c440df
Change-Id: Id7554e8aa2ac376627a8181a1cb716fd53f53f22
2020-02-18 12:36:56 +00:00
Yo Chiang
d25e639b4e Add getAvbPublicKey to IDynamicSystemService
Wrapper for IGsiService::getAvbPublicKey()

Bug: 146418878
Test: Build pass
Change-Id: I67030bf0587297dc20e791c856c7373d473ae027
2020-02-18 18:32:44 +08:00
Nandana Dutt
5ff3568929 Merge changes from topic "preserve_legacy"
* changes:
  Enforce the preserveLegacyExternalStorage manifest attribute
  Support preserveLegacyExternalStorage manifest attribute
  Introduce preserveLegacyExternalStorage manifest attribute
2020-02-15 21:59:23 +00:00
TreeHugger Robot
d836b829c2 Merge "Improve BaseBundle#kindofEquals" 2020-02-15 00:54:50 +00:00
Suprabh Shukla
3b413dd57e Improve BaseBundle#kindofEquals
If both BaseBundles are empty, we can infer that without needing to
unparcel any of them.

Test: atest FrameworksCoreTests:android.os.BundleTest

Bug: 146037505
Change-Id: I04c28cdd1293227d9887b0c17e178f61328c1959
Merged-In: I04c28cdd1293227d9887b0c17e178f61328c1959
2020-02-14 14:05:00 -08:00
Suprabh Shukla
0e8c9c4daa Improve BaseBundle#kindofEquals
If both BaseBundles are empty, we can infer that without needing to
unparcel any of them.

Test: atest FrameworksCoreTests:android.os.BundleTest

Bug: 146037505
Change-Id: I04c28cdd1293227d9887b0c17e178f61328c1959
2020-02-14 13:43:53 -08:00
Collin Fijalkovich
24d1336f17 Cache PowerManager binder calls
Use PropertyInvalidatedCache to save on redundant
binder calls for isPowerSaveMode and isInteractive.

Bug: 140788621
Test: atest BatterySaverTest
Test: atest PowerManagerTest
Change-Id: I849a48eb7c901d3178097d33dce01630dbb78267
2020-02-14 10:03:44 -08:00
Zim
3ce38499e4 Enforce the preserveLegacyExternalStorage manifest attribute
In Q, a manifest flag requestLegacyExternalStorage was
introduced to grant legacy apps full access to external storage.

This flag was sticky across app updates so an app already installed on
a users device would typically always have the legacy_storage appop
even if it received an update to stop requesting the manifest flag.

With the R scoped storage model, we would like to break this
stickiness for 2 reasons:
1. Increase the impact of the storage restrictions
2. Ease testing. Because of the stickyness it is difficult
for apps targeting R to actually lose their legacy_storage appop

Unfortunately, we have to still provide a path for apps who care about
migirating their data on external storage from unreachable locations
on R devices. The canonical example is an app with 3 versions:
(1) Qcannot_migrate, (2) Qcan_migrate, (3) Rcannot_migrate

An update from: 1 -> 2 -> 3 will be fine because (2) will migrate the
apps data. However, apps can very well update from (1) - (3) thereby
losing access to their data in unreachable storage locations on R devices.

To facilitate this migration, apps (targeting R) can explicitly
request the preserveLegacyExternalStorage manifest flag. This will
ensure that if they get updated on a device with a previous version of
their app with the legacy_storage appop, they'll keep legacy_storage
status. Of course, fresh installs (of target R apps) will not have the
legacy_storage appop even if they have requestLegacyExternalStorage
and preserveLegacyExternalStorage flags.

By default, this new flag will be false, legacy status will *not* be
preserved (the legacy_storage appop will *not* be sticky). But apps
that care about migrating data can set the flag to true and
will preserve whatever legacy status they had on an existing install.

Test: atest RestrictedPermissionsTest
Test: atest RestrictedStoragePermissionSharedUidTest
Bug: 148944140
Change-Id: Ifd3410ed1a60f4c0e8414fce904139b539e13ad8
2020-02-14 14:33:51 +00:00
Shafik Nassar
5a885658c9 Merge "Add intent to clear app cache" 2020-02-14 11:10:18 +00:00
Alex Buynytskyy
17d9da0523 Incremental installations in adb, DataLoader/device side.
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest
Test: adb install --wait --incremental ~/v4/v4-only-original.apk
Bug: b/136132412 b/133435829
Change-Id: I41b72021e3c7703b57b3e14f58d5aab6c1271f04
2020-02-13 13:03:13 -08:00
shafik
0f2c4d12eb Add intent to clear app cache
Adds a new public API intent action that should be used to launch a
dialog that prompts the user to clear app caches.
The intent can be used by apps holding MANAGE_EXTERNAL_STORAGE
permission or with OP_MANAGE_EXTERNAL_STORAGE allowed

Bug: 144341120
Test: build

Change-Id: Icc6de16da4f892f1ed46ffc89e51071647a17400
2020-02-13 20:13:46 +00:00
Automerger Merge Worker
2ddf24b6a8 Merge "Do not disable tracing in zygote." am: 88be2985c4 am: aee51d9eab
Change-Id: I8b6280d305ea53c5361442e4b7bb45aa164fb5d2
2020-02-13 16:20:06 +00:00
Automerger Merge Worker
aee51d9eab Merge "Do not disable tracing in zygote." am: 88be2985c4
Change-Id: If850e4ff9da2b0c1259a366caac1fd95a8eb1c3c
2020-02-13 16:07:04 +00:00
Alex Buynytskyy
8e9e6a3255 Signature streaming from local file, property to disable incremental.
+Tests

Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest
Bug: b/136132412 b/133435829

Change-Id: I826900e120c72e7cdd0549c70da28d817982dcd3
2020-02-12 11:24:47 -08:00
TreeHugger Robot
98a201dcd9 Merge "Finalize @SystemApi annotation for StatsFrameworkInitializer (retry)" 2020-02-12 17:36:49 +00:00
Florian Mayer
5845bdf66e Do not disable tracing in zygote.
We now use the sequence number of the atrace tag rather than a Binder
transaction, so zygote can observe changes to the tags.

Test: m
Bug: 137366208
Bug: 147667830

This is a cherry-pick of e38797be84.

Change-Id: I50e32a19c538dd255097c035836504b4746b172b
Merged-In: I50e32a19c538dd255097c035836504b4746b172b
2020-02-12 17:35:15 +00:00
Florian Mayer
fab4628666 Merge "Do not disable tracing in zygote." 2020-02-12 17:28:07 +00:00
Florian Mayer
e38797be84 Do not disable tracing in zygote.
We now use the sequence number of the atrace tag rather than a Binder
transaction, so zygote can observe changes to the tags.

Test: m; flash; adb shell atrace dalvik | grep hprof
Bug: 137366208
Bug: 147667830

Change-Id: I50e32a19c538dd255097c035836504b4746b172b
2020-02-12 16:01:16 +00:00