Commit Graph

7563 Commits

Author SHA1 Message Date
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
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
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
Martijn Coenen
ca8106f200 Merge "Give installers/DownloadManager/MTP correct GIDs." 2020-02-12 08:14:19 +00:00
Makoto Onuki
553df30582 Finalize @SystemApi annotation for StatsFrameworkInitializer (retry)
Change-Id: I3c8bce84fbdbe4e65ec430eb5046a1a46cc6fbfb
Fix: 148225705
Test: build / treehugger
2020-02-11 16:26:18 -08:00
Alex Buynytskyy
f3b2e68fae Merge "Incremental installations in PackageManagerShellCommand." 2020-02-11 21:24:55 +00:00
Alex Buynytskyy
04f7391fc3 Incremental installations in PackageManagerShellCommand.
- onPrepareImage in native,
- allow to check installation type and choose native or managed
dataloaders,
- native data loader for Incremental,
- install-incremental shell command.

Test: atest PackageManagerShellCommandTest
Test: atest IncrementalServiceTest
Bug: b/136132412 b/133435829
Change-Id: I530a8a203fb50132c1869abd0b869036add18699
2020-02-11 13:11:31 -08:00
TreeHugger Robot
14e6a15b45 Merge "Access to Device Vibrator State" 2020-02-11 20:13:08 +00:00
Fiona Campbell
004e36da64 Merge "Add support for brightness as a float" 2020-02-11 18:51:02 +00:00
Martijn Coenen
bc3a5111d1 Give installers/DownloadManager/MTP correct GIDs.
On devices without sdcardfs, these classes of apps get the right storage
access by being a part of the correct group.

Bug: 146419093
Test: manually verify apps get the correct GID
Change-Id: I7021cbf8a2e84bda7a49519da36e84fcf3f479a8
2020-02-11 12:24:18 +01:00
Lee Shombert
ebe2a0baeb Binder cache for isUserUnlocked().
Bug: 140788621

Test: A special build that puts the PropertyInvalidatedCache in
verification mode was loaded on the device.  Then one iteration of MPTS
was executed.  No cache inconsistencies were found and no SELinux
violations (associated with the binder cache) were found.  The number of
cache misses was approximately 10% of the total binder calls.  All
binder calls went through the cache.  Added a new user and later deleted
the same user; verified that caches were invalidated as expected and no
errors were detected by the PropertyInvalidatedCache verification mode.

Passed the CtsMultiUserHostTestCases test.

Change-Id: I32e3e39768e288101c82b02e63a7eb20d5ed7f93
2020-02-11 01:58:37 +00:00
Chris Ye
473c84ff4c Access to Device Vibrator State
Add API to access vibrator state and vibrator state listener.

Bug: 135949568
Change-Id: I96636b432d581cea03a9fc9fecba4c08045f5006
2020-02-11 00:02:37 +00:00
Fiona Campbell
d4eb295196 Add support for brightness as a float
Change the framework to handle brightness as a float rather than an int.

Test: AutomaticBrightnessControllerTest
BrightnessConfigurationTest
BrightnessMappingStrategyTest
BrightnessUtilsTest
DevicePolicyManagerTest
DisplayManagerServiceTest
DisplayTest
DozeScreenBrightnessTest
PowerManagerTest
PowerManagerVrTest
SettingsProviderTest

Exempt-From-Owner-Approval: Changing param from int to float

Change-Id: I413641cd987c5ec8f82753c0388a33f85a9682de
2020-02-10 23:44:40 +00:00
Alex Buynytskyy
cd4d3875e2 Incremental install via adb.
- passing V4 signature to IncFS,
- cleanup and use InstallationFile everywhere,
- pass params to DataLoader creation,
- minor refactor for PackageManagerShellCommandDataLoader to prepare for
Incremental data loading.

Test: atest PackageManagerShellCommandTest
Bug: b/136132412 b/133435829
Change-Id: Iacc3e4c51c0fa3410b076147ce153a1303246189
2020-02-10 07:06:34 -08:00
Automerger Merge Worker
55c7b67de9 DO NOT MERGE - Enable blacklist for headless system user am: f8c0b31524
Change-Id: I9da9ffcb0f8498b3a01295c23e3c78d4f85dbb20
2020-02-08 03:48:16 +00:00
TreeHugger Robot
0dff4461ac Merge changes from topic "statsd_libbinder_ndk"
* changes:
  Use StatsDimensionsValueParcel within statsd apex
  Use cpp aidl_interface within statsd
2020-02-08 03:33:25 +00:00
Yan Zhu
f8c0b31524 DO NOT MERGE - Enable blacklist for headless system user
- Get all packages for system user
- Reuse split system user's logic to blacklist packages when headless system
user is enabled
- Add new method in UserManager to get headless sytem user mode (same as
in master)

Bug: 145626101
Test: edit device's sysconfig file, use tag: system-user-blacklisted-app to blacklist app
make services && adb sync system && adb reboot
cts test

Change-Id: I98d1bc33e7dd59ffa3ac6426f95af708671138da
(cherry picked from commit 9c4cf4945d57d45e429bc7d33bf6ffa68eb0838c)
2020-02-08 00:29:19 +00:00
TreeHugger Robot
0bfb664126 Merge "Refactor GraphicsStatsService for updateability" 2020-02-08 00:00:36 +00:00
Ruchir Rastogi
56da4c3862 Use StatsDimensionsValueParcel within statsd apex
Because statsd now uses StatsDimensionsValueParcel instead of
StatsDimensionsValue.h/c, statsd no longer has to depend on libservices.

Test: m -j
Test: atest StatsdHostTestCases#testBroadcastSubscriber
Bug: 148604617
Change-Id: I6d65383ccec99f4672d6575232981c0f6cc40fcf
2020-02-07 15:55:11 -08:00
Songchun Fan
4889c7a823 Merge "Incremental native lib extraction" 2020-02-07 23:32:00 +00:00
Anna Trostanetski
35bbc9d4ba Merge "Introduce TRACE_TAG_APEX_MANAGER and add timing to getActiveApexInfos" 2020-02-07 19:56:02 +00:00
Songchun Fan
0f8b6fe950 Incremental native lib extraction
Basically we configure all the lib files inside Incremental Service,
e.g., create lib dirs, make lib files, extract original
lib file data from zip and then write data to the lib files on incfs.

Test: manual with incremental installation
BUG: b/136132412 b/133435829
Change-Id: I7544d2e78bcf3bdd76ce4c0766ec31ff13fd2011
2020-02-07 11:35:48 -08:00
Adam Bookatz
688689eb58 Merge "Make UM.hasBaseUserRestriction @TestApi" 2020-02-07 18:04:51 +00:00
Stan Iliev
c90438175f Refactor GraphicsStatsService for updateability
Move GraphicsStatsService to android.graphics package.
Move GraphicsStatsService JNI from libservices.core to
libandroid_runtime.
Declare GraphicsStatsService ctor as the only @SystemApi.
Remove MemoryFile usage from GraphicsStatsService, but use
SharedMemory and other SDK APIs instead. This is done to
avoid using unstable API MemoryFile.getFileDescriptor.
Propose new SharedMemory.getFdDup API for next release, which
is hidden for now.
Refactor statsd puller to avoid proto serialization by moving
data directly into AStatsEventList.
"libprotoutil" is added as a static dependancy to libhwui, which
should be fine because its implementation does not link anything.

Bug: 146353313
Test: Ran "adb shell cmd stats pull-source 10068"
Test: Passed unit tests and GraphicsStatsValidationTest CTS
Change-Id: If16c5addbd519cba33e03bd84ac312595032e0e1
2020-02-07 12:27:07 -05:00
atrost
3f8b733354 Introduce TRACE_TAG_APEX_MANAGER and add timing to getActiveApexInfos
Timing for initialize cache path only. Currently ~3ms.
This will hopefully help catch regressions.

Bug: 148959827
Test: m, flash, boot, inspect logcat.
Change-Id: Ief83b8e1a6f0e58bca509527656c67b3465a4d19
2020-02-07 14:54:08 +00:00