Delete vdex/odex files when a package is marked globally hibernating. We
expose the delete OAT artifacts API in PackageManagerInternal for app
hibernation service to call.
Bug: 183140824
Test: atest AppHibernationServiceTest
Test: atest PackageManagerServiceHibernationTests
Test: manual test
Change-Id: I2ca9f561f79992e37e0bad2d4bb7dda4cd21b4ed
Since developers can declare the "neverForLocation" flag in their
manifest as public API, we should also offer a way to inspect the
value that we parsed from the manifest. We do this by surfacing it
through the existing PackageInfo.requestedPermissionsFlags field.
This also means we can remove the PackageManagerInternal API, since
interested parties can now check PackageInfo directly.
Fix a potential security issue by only accepting flags from manifest
when the application is targeting a modern enough SDK.
Bug: 181812281
Test: atest CtsContentTestCases:PackageManagerTest
Test: atest FrameworksServicesTests:PackageParserTest
Test: atest com.android.server.pm.parsing
Change-Id: I877768c06ee15281f3334794034f4af563e74569
As part of an upcoming feature, developers will need the ability to
clearly communicate that they'll never use a permission derive the
physical location of the device, regardless of ACCESS_FINE_LOCATION
and/or ACCESS_COARSE_LOCATION being granted. The first use of this
is the BLUETOOTH permission, but developers may need to communicate
this for other permissions such as READ_PHONE_STATE, etc.
This change begins parsing this developer declaration as one of
multiple "usesPermissionFlags", which are then stored in a new
ParsedUsesPermission object. To minimize refactoring, we continue
to offer this data through the older String-based APIs.
Bug: 181812281
Test: atest FrameworksServicesTests:PackageParserTest
Test: atest com.android.server.pm.parsing
Test: atest -p core/java/android/content/pm \
core/java/com/android/internal/content \
services/core/java/com/android/server/pm \
services/tests/servicestests/src/com/android/server/pm
Change-Id: I2ccda05cf416653d311151591f91ae55a729e05b
Migrate wellbeing to use the role infrastructure. Based on ag/13357357.
Bug: 158878560
Test: atest com.google.android.wellbeing.gts.WellbeingTest
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Test: atest FrameworksServicesTests:AppStandbyControllerTests
Change-Id: I0a6c986fe9a53be52013f300ba7795dfdd0887e6
Added comments and annotations to the PowerStatsInternal and
PowerStatsHALWrapper classes. Also fixed the native code to return
partial results if available.
Bug: 179684579
Test: On battery I no longer see crash
Change-Id: Ic97fb56af6559a3fa65f857c527b10303238ac42
Add a statsd puller to record CPU usage of system server threads: all
and binder.
Bug: 173227907
Test: cmd stats pull-source 10098
Test: atest CpuStatsTests
Change-Id: I0d5c6e1e8d772bae6efdcbe62767932cc2fefe02
(This partially reverts ag/13481636)
Turns out Launcher still uses
LauncherApps.onPackageLoadingProgressChanged(), which relies on the
internal listener exposed via PackageManagerInternal. Adding it back.
We don't need the unregister method, because all the progress listeners
will be automatically removed when the app is fully loaded.
BUG: 175135603
Test: manual with incremental install via Phonesky
Change-Id: Ief09d3c7775080f35568b6ec51d6351a9373f04e
RROs have historically been APK packages. We now have the ability to
generate RROs on-the-fly. These "fabricated" RROs are not APKs.
ApplicationInfo#resourceDirs documentation states that it only contains
paths to packages. To prevent changing the behavior of resourceDirs
until we can deprecate and remove it, a new overlayPaths field has been
added to ApplicationInfo. This new field contains APK overlay paths as
well as non-APK overlay paths.
Bug: 172471315
Test: boot enable/disable overlays and examine overlays working as well
as package manager dumpsys
Change-Id: I78c5eeef73b7d8bada61edc0f64a12a3cdc1ce16
Launcher gets loading progress from LauncherActivityInfo directly and
does not need to use the listener. Removing unused methods, plus a bit
of code cleanup.
BUG: 175135603
Test: atest CtsInstalledLoadingProgressHostTests
Test: atest FrameworksServicesTests:com.android.server.pm.IncrementalStatesTest
Change-Id: Icf96f5ca23e567396cfc233725619ba91a953c97
Listener is more secure as nobody can send a broadcast with invalid
digests.
Bug: 160605420
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I5f6ec3f0fa975d274d456d11d57be61d0b245e80
Also remove redundant PlatformIdle stats section from history details
Bug: 173132005
Bug: 178315485
Test: Ran device to drain battery then checked dumpsys batterystats
Test: Verified that Historian could correctly parse the bugreport
Change-Id: I65c1824695dd026231f83664b00f72912dee2164
EnergyConsumerId has been replaced with EnergyConsumerType and an ordinal int to determine an EnergyConsumer type
Bug: 178048034
Test: manual ("adb shell dumpsys batterystats --measured-energy" on
PowerStatshal2.0 enabled devices should report energy consumption data
while on battery)
Change-Id: Ie78b46fcb59d0327c00a20fbe2481dc537b910eb
PowerStatsService will handle PowerStatsHal queries, PowerStatsInternal
will provide the LocalService for querying PowerStatsHal derived data
from other System services.
Bug: 173077356
Test: atest FrameworksCoreTests:com.android.internal.power.MeasuredEnergyStatsTest
Test: atest com.android.server.powerstats.PowerStatsServiceTest
Change-Id: Ibc0165a44ffdbbcc9328c250f1dca3d29616c766
When a package is frozen(install/update etc.), for the incoming request
to start/bind to the services in the package, delay the actual action
until the package is unfrozen.
Bug: 168292935
Test: see b/168292935#comment34
Change-Id: I80d928925a2ffe36deb19da37e11dbc66881f617
isPermissionEnforced() always returns true and is only exposed on AIDL
and there is actually no API, so it is directly removed.
setPermissionEnforced() currently doesn't affect anything so its
remaining implementation is removed as well, and we consider all
permissions enforced when needed for compatibility of dumping.
Bug: 158736025
Test: presubmit
Change-Id: I0584553ac0171147b6f131b5359ddb2964113a1d
In preparation for permission BROADCAST_CLOSE_SYSTEM_DIALOGS
(go/close-system-dialogs), which will be signature|recents in order to
lock down Intent.ACTION_CLOSE_SYSTEM_DIALOGS. That intent is used by
recents when it's invoked.
Currently, recents is configured via existing config
config_recentsComponentName, so using that to determine the recents
package in PM.
It's my understanding that the package defined in such config will be
responsible for recents no matter which launcher is active. It's also my
understanding that the package being explicit in the system config means
that package has to come from the system image, hence it's fine to use
ensureSystemPackageName() in PM. Please advise if any of
this is wrong.
Test: Will work on CTS once we agree on the proposal here.
Bug: 159105552
Change-Id: I9f73e1f05d8df26666da156b672e370dce5030de
Moving this class out of android.os will reportedly
greatly reduce ART overhead.
Test: compiles
Test: atest FrameworksServicesTests FrameworksCoreTests
Bug: 165817914
Exempt-From-Owner-Approval: no-op refactoring
Change-Id: I1f3e77120979e2f336e5f42e4ec6e459d6492083
Better error cases handling.
Using internal handler to process digests to not overcommit
PackageManager's.
Fixes: 170777013
Test: atest OrgOwnedProfileOwnerTest#testSecurityLogging
Change-Id: I741c10ef3ceeec01e5436f92caa6a52d0c6b6003
This reverts commit 69475be847.
Also reverts commit Iaf8e2c075f188df95c68824b71362629c6adabfc.
Reason for revert: Trying again but will submit with new tests
BUG: 165841645
Test: atest NexusLauncherOutOfProcTests
Test: atest LauncherAppsSingleUserTest
Test: atest LauncherAppsMultiUserTest
Test: atest LauncherAppsProfileTest
Test: atest LimitAppIconHidingTest
Change-Id: I5ed5871ccddefbd922b3aa3ee4c1ad53cc0bfa9b
The numbers of KnownPackage should be continuous and the string
representation should not be unknown.
Fix: 170356374
Test: atest PackageManagerServiceTest
Change-Id: I2d96ca74a49b8f24ff87f8e21981d8cc0d43a469
Alongside SIGNATURE and ACTOR_SIGNATURE policies, add CONFIG_SIGNATURE
policy to overlayable that overlay fulfills if it is signed with the
same certificate as the reference package whose package name is
declared in 'config-signature' tag of SystemConfig and is vetted by
OMS that it's a system pre-installed package.
BUG: 158726924
TEST: regular aapt2, idmap2, OMS tests
Merged-In: I645ee72271496008742886274be0d63a2985201b
Change-Id: I645ee72271496008742886274be0d63a2985201b
Exposing package state changes and progress changes via LauncherApps
and LauncherActivityInfo as public APIs.
BUG: 165841645
Test: builds (will add CTS tests)
CTS-Coverage-Bug: 168925573
Change-Id: I2b5ea698799f9a762b7d9c79d62636d3db187c1f
Add helpful known-packages section in bugreport.
Fix: 121374459
Test: Using 'adb shell dumpsys package (known-packages)' to check
whether these known packages are dumped.
Change-Id: Ie43871d7ba8adca01bc17761dd9137129f47c58e
It wasn't including pre-created users; as such, apps that were not
installed on pre-created users got installed on reboot.
To test it:
adb shell pm create-user --pre-create-only
m ApiDemos
adb install --user current ~/Downloads/apk/ApiDemos.apk
adb shell dumpsys package com.example.android.apis |egrep ".*User .*:"|grep installed
adb shell stop && adb shell start
adb shell dumpsys package com.example.android.apis |egrep ".*User .*:"|grep installed
Without this fix, the second dumpsys would show the app installed
for the pre-created user.
Test: manual test (see above)
Test: atest CtsMultiUserHostTestCases:android.host.multiuser.PreCreateUsersTest
Bug: 160252062
Change-Id: I46c2ec94a3ab422e3e39b66239c21fb6cbff5a8e
Incremental Serivce periodically polls loading progress and sends to
Package Manager Service. Package Manager provides APIs for other
interested parties to listen to the loading progress.
BUG: 165841827
Test: unit test
Change-Id: I44b9e17c2240b9efe53bc09fc728b6671f1f7dfe
It wasn't including pre-created users; as such, apps that were not
installed on pre-created users got installed on reboot.
To test it:
adb shell pm create-user --pre-create-only
m ApiDemos
adb install --user current ~/Downloads/apk/ApiDemos.apk
adb shell dumpsys package com.example.android.apis |egrep ".*User .*:"|grep installed
adb shell stop && adb shell start
adb shell dumpsys package com.example.android.apis |egrep ".*User .*:"|grep installed
Without this fix, the second dumpsys would show the app installed
for the pre-created user.
Test: see above
Test: atest CtsMultiUserHostTestCases:android.host.multiuser.PreCreateUsersTest # will be added later on AOSP branch
Bug: 160252062
Change-Id: I46c2ec94a3ab422e3e39b66239c21fb6cbff5a8e
Merged-In: I46c2ec94a3ab422e3e39b66239c21fb6cbff5a8e
(cherry picked from commit 2c43b50331eaf428df3e7cb1886fd7d60f41ad54)