Commit Graph

7592 Commits

Author SHA1 Message Date
Yifan Hong
47af8f93b8 Merge "UpdateEngine: fix cleanupAppliedPayload impl" into rvc-dev 2020-03-05 22:57:08 +00:00
TreeHugger Robot
03a65f1a5e Merge "BatteryStatsManager: Address API council feedback" into rvc-dev 2020-03-05 21:42:12 +00:00
Roshan Pius
cdf5744a77 BatteryStatsManager: Address API council feedback
Bug: 144925883
Test: Compiles
Change-Id: Ibdc61769965a97222fdd968084eca71b997e8feb
2020-03-05 10:34:24 -08:00
Songchun Fan
7f051b5251 remove proxy binder service IIncrementalManager
This is no longer needed because native Incremental Service directly
uses IDataLoaderManager.

BUG: 150406132
Test: atest service.incremental_test
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: Idbde2988883becbf3eb707d42c0558774a6073e8
2020-03-04 19:50:44 -08:00
Songchun Fan
ecd96c2be4 Merge "make IDataLoaderManager and IDataLoader stable interfaces" into rvc-dev 2020-03-04 22:53:12 +00:00
Yifan Hong
8b0eedf99c UpdateEngine: fix cleanupAppliedPayload impl
IUpdateEngine.cleanupSuccessfulUpdate is now asynchronous with a callback.
Update UpdateEngine.cleanupAppliedPayload accordingly to use the new impl.

Bug: 147696014
Test: apply OTA
Change-Id: I9b308316dcb8e6a507063d3060fed7693da82a19
2020-03-04 11:38:59 -08:00
Songchun Fan
6381d6193e make IDataLoaderManager and IDataLoader stable interfaces
Instead of using Bundle, explicitly specify params when initializing a data loader.

BUG: 150406132
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I2f89d3c3ea1058fdbd689da0d5cb801bf4d9a0b4
2020-03-03 21:18:30 -08:00
Kweku Adams
ede42f99ed Add PowerWhitelistManager.isWhitelisted.
The "XXXExceptIdle" lists and methods are expected to be a superset of
the XXX methods. That's not immediately obvious from the method names.
This effort is to clean up the naming and better document actual
behavior. As part of this, we're moving the isApplicationWhitelisted
methods to PowerWhitelistManager to also help clean up the interface
between the apex and the rest of the system.

Bug: 142420609
Bug: 144864180
Bug: 145014493
Test: atest CtsBatterySavingTestCases:DeviceIdleTest
Test: atest CtsSecurityTestCases:DeviceIdleControllerTest
Test: atest FrameworksServicesTests:AppStandbyControllerTests
Change-Id: I1d248a075992e2dc279a7bfec44f38c7e51780b4
2020-03-03 17:03:04 -08:00
Songchun Fan
b8ab0034c6 dataloader/incfs openWrite returns int
Plus minor refactors

BUG: 150470163
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: Ib3a1c7c45a4abaab793be73213545ce91c98510b
Merged-In: Ib3a1c7c45a4abaab793be73213545ce91c98510b
2020-03-03 10:18:56 -08:00
Songchun Fan
38dfe9a0d4 use shell to open v4 signature file
BUG: 133435829
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I8e57b00f042f8b6c85d5f905460dd2da6199accc
(cherry picked from commit cdbcb34c2b)
2020-03-03 09:48:02 -08:00
SongFerngWang
53515a0ea6 CellularBatteryStats: Address API council feedback
Bug: 144925883
Test: Build pass, device boots up
atest TelephonyMetricsTest

Change-Id: Iac5904a3397a42aa5f015cb53bb63318f5c377a4
Merged-In: Iac5904a3397a42aa5f015cb53bb63318f5c377a4
(cherry picked from commit 84dc30fede)
2020-03-02 05:15:08 +00:00
Paul Chang
af730a12bd Merge "Improvements to Bugreporting API." into rvc-dev 2020-02-29 00:20:04 +00:00
Ytai Ben-Tsvi
d5065ba8a5 Pass models to soundtrigger middleware with shared memory
This both avoids the need to make extra copied for the models and
allows exceeding the parcel size limits.

Bug: 150100907
Test: Manual testing of basic sound trigger functionality
Change-Id: Ic4c5c1a9de3e29b1b6fa82442254e1afe7daec19
2020-02-28 13:01:24 -08:00
Paul Chang
1a44ed3a18 Improvements to Bugreporting API.
- Show a toast to indicate screenshot is taken.

BUG:149525300
Test: Flash and press bug report shortcut and check the toast
Change-Id: Ib210c8855d2b588b51f883e32070c8b748ea4e3f
Merged-In: Ib210c8855d2b588b51f883e32070c8b748ea4e3f
2020-02-28 17:14:48 +00:00
Chris Wailes
ee398f9664 Adds Zygote policy flags to control how applications are launched
This patch adds a zygote policy parameter to functions in the
ActivityManagerService (and associated classes) to allow for different
launch behavior based on the triggering event.  This will allow for
latency sensitive applications to utilize the Unspecialized App Process
Pool, without other processes draining the pool and causing excessive
refill events.

Test: Booted and launched several apps
Bug: 147613193
Change-Id: Ib0a51c8720f95a7eafcab4ad2b5bb08f27a58d8c
(cherry picked from commit 4d05188588)
2020-02-27 20:33:12 +00:00
Makoto Onuki
9577cd78ff Merge "Squash same ApplicationInfo's in Parcel" into rvc-dev 2020-02-25 15:17:14 +00:00
Makoto Onuki
2d80ca09fc 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
(cherry picked from commit 7d09275d70)
2020-02-24 22:22:13 +00:00
Yo Chiang
9834448ca1 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

Merged-In: I52767dfefef394403c5e16fcfd40792b14ff9a71
Change-Id: I52767dfefef394403c5e16fcfd40792b14ff9a71
(cherry picked from commit f41e145480)
2020-02-24 17:13:20 +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
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
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