APIs that return package usage data (such as the new ArtManager)
must ensure that callers hold both the PACKAGE_USAGE_STATS permission
and the OP_GET_USAGE_STATS app-op.
Bug: 77662908
Test: atest vendor/xts/gts-tests/hostsidetests/dexapis/host/
Change-Id: I7a85d959f1682d2bd5cf3684415e368fece88101
Added explanation that callers can use a format string which takes a
single argument which is the name of the suspended app that the user
tried to launch.
Test: make docs
Bug: 77507744
Change-Id: I0a5259048332030385265ceab9c7d76766abac7d
Replace checkSignatures() calls in AccountManager with a new,
rotation-aware call to PackageManagerInternal. Also add a new
AUTH cert capability to reflect the distinction between these
permissions and others.
Bug: 77651077
Test: Builds. CtsAccountManagerTestCases
Change-Id: Idd412cd984acf7d37555deb5879f2d6a0a10c2b6
Also extend the timeout to 60 seconds.
- Because each provider / service dump may time out, the total time should relatively be large.
Bug: 78017892
Fix: 78017892
Test: Manual test with the following dumpsys commands:
dumpsys activity provider all
dumpsys activity provider all-platform
dumpsys activity provider all-non-platform
dumpsys activity provider com.android.providers.contacts/com.android.providers.contacts.VoicemailContentProvider
dumpsys activity provider com.android.providers.contacts/.VoicemailContentProvider
dumpsys activity provider contacts
dumpsys activity provider voicemail
dumpsys activity provider 4d45a78
dumpsys activity service all
dumpsys activity service all-platform
dumpsys activity service all-non-platform
dumpsys activity service bluetooth
Test: atest /android/pi-dev/frameworks/base/core/tests/coretests/src/com/android/internal/util/DumpTest.java
Test: atest /android/pi-dev/frameworks/base/core/tests/coretests/src/com/android/internal/util/ParseUtilsTest.java
Test: Manual test with "adb bugreport" with adding sleep(10s) to ProviderMap.dumpProvider()
Change-Id: I00bce0090b8dbb947d7f8b1e5d01bb8a70d84bd8
This adds checks that the secondary ABI for an instrumentation package
matchs that of its target before using it when forced and warns of
mismatches.
Change-Id: I394427721c83cbd1c3c6af6cee24a93b18d8c65f
Fixes: 77152863
Test: gts-tradefed > run gts -m GtsBackupHostTestCases -a armeabi-v7a do not all fail with NPE
During API review, PackageInfo#signingCertificateHistory was changed
to PackageInfo#signingInfo. This was not reflected everywhere in
the documentation. Update it.
Bug: 74831530
Test: Doc change only, builds.
Change-Id: I497cdd732dffacf376ac05f7ccd181004c947210
The stats currently shown in sync manager dumpsys is the total *since wipe* so
they're usually pretty much useless.
So let's add "today" and "yesterday" stats too.
- Also add "# failures" and "# cancels".
- Also split up SERVER to OTHER and FEED (i.e. subscribedfeeds).
Bug: 76035392
Test: Boot, run some sync, then do "cmd content reset-today-stats"
- Also tested with actually setting the clock to 23:59 and wait
- Check the result with "dumpsys content".
Sample output:
=======================================================================
Authority Syncable Enabled Stats Loc Poll Per Feed User Othr Tot Fail Can Time Last Sync Backoff
------------------------------------------------------------------------------------------------------------------------------------------------------------------
com.android.calendar 1 true Total 0 0 0 1 0 7 8 0 2 8s FEED SUCCESS
Today 1 5 6 7s 2018-04-12 15:21:24
Yestr 0s
com.android.chrome 0 false Total 0 0 0 0 0 0 0 0 0 0s
Today 0s
Change-Id: Id0ea42435a9f759e47d4b9490292759270f8e9a5
Update the docs about getInstalledPackages() returns installed apps
on current user not on the device.
Test: NULL
Bug:77955905
Change-Id: I3d9c48be54f6355dc1701d2c359785a575fbc1db
This reverts commit b00eb64591.
Reason for revert: Boot issues after OTA
Bug: 76228188
Fixes: 77888575
Change-Id: I5ca2605cb6befea46ce50198bc72bdd4b6e84f1a
Clarified the package extras bundle returned from
getSuspendedPackageAppExtras.
Moved the bundle arg to the last in LauncherApps.onPackagesSuspended and
clarified the contents of the Bundle.
isPackageSuspended(String) now throws a NameNotFoundException if the
package is not found.
Also, removed a permission check from isPackageSuspendedForUser.
Test: builds, boots, existing tests:
atest com.android.server.pm.SuspendPackagesTest
Bug: 77518983, 77517955, 77507744, 77801528
Change-Id: I06b5f69f8f8a079c206863cb6122e90be58366cd
Attempt to simplify the exposure of package signing information via
PackageInfo by creating a new class and corresponding methods for
querying a package's signing information.
Bug: 74831530
Test: PkgInstallSignatureVerificationTest
Change-Id: Idbc008b41a921f89cefb224b26f910da4d238dea
Consider an app targeting the final API 28, but running on an older
build where "P" is still API 10000. Those apps need to be treated as
legacy apps.
In general, the logical pattern that should be used when enforcing
target SDK behaviors is below.
For applying behavior to legacy apps:
// BROKEN
if (targetSdkVersion <= Build.VERSION_CODES.N_MR1) {
// CORRECT
if (targetSdkVersion < Build.VERSION_CODES.O) {
For applying behavior to new apps:
// BROKEN
if (targetSdkVersion > Build.VERSION_CODES.N_MR1) {
// CORRECT
if (targetSdkVersion >= Build.VERSION_CODES.O) {
Bug: 77865751
Test: builds, boots
Change-Id: Ia83bd446a940751d51a6542c7a5b9cca174c5296
Also make these configurable so we have the flexibility to change it if
necessary.
Setting the policy inside ActivityManagerService is not ideal, as that
means that AMS is the only place where the policy in ApplicationInfo is
correct. It should really be set inside PackageManagerService. However,
if it's set there, it would get out of date when the settings change, and
we'd have to update inside AMS anyway. So putting it only here seems ok
for now.
Test: $ adb shell settings put global hidden_api_policy_pre_p_apps 2
Test: $ adb shell settings put global hidden_api_policy_p_apps 2
Bug: 64382372
Change-Id: Ic4cbbb1e6464623e90c17ae08c0b6cbbe0dfa125
Earlier setPackagesSuspended ignored the rest of the paramters when
suspend state did not change. This was a problem because then there was
no good way to update the other parameters without unsuspending the app,
which is not desirable.
Removed setSuspendedPackageAppExtras as now they can be update with this
api.
Also sending broadcasts when packages get unsuspended due to suspending
package removed.
Test: Existing tests pass:
atest com.android.server.pm.PackageUserStateTest
atest com.android.server.pm.SuspendPackagesTest
atest com.android.server.pm.PackageManagerSettingsTests
Bug: 77522553
Change-Id: I72a3c228d3d65c430e242da97b2bc6997ec6a135
Prior to this change there was a chance that an updating app would not
exist in mPackages and cause a permission check for that app to fail.
This change moves all permission checks to use mSettings and the cached
package it contains to do the checks.
Change-Id: I0717bddbb08b1d0dbab3ea79fa0d2067aa858753
Fixes: 76228188
Test: Manual - system starts, permission checks work before / after update
Address API review by describing relationship between the
PackageManager.hasSigningCertificate() methods and the PackageInfo
GET_SIGNING_CERTIFICATES method, as well as differentiating the
UID documentation from the package-name based one.
Bug: 74831566
Test: None, doc change.
Change-Id: I11c556325f9b2efbc2e5e1cf896b9c58db092ae8
Use the common rethrowFromSystemServer() pattern. Carefully only
throws for calls going to system_server; leaves existing behavior
intact when calling a ContentProvider.
Bug: 77671218
Test: builds, boots
Change-Id: Ie5e0763fb5e62b832f2b6a03c8f9d72dab3bf89a
It seems pretty unlikely that we'd ever want to disallow access to the
light greylist in P, since doing do would break do many apps. We don't need
this policy here as an opt-in for apps now, since the StrictMode work will
achieve the same thing.
Instead, make a "just warn" policy which allows access to all APIs, but
leaves the detection and logging logic in place. This gives us the option
of disabling enforcement, but still gathering logs to find out which apps
use which APIs.
Bug: 77517571
Test: Boot device
Test: Hardcode policy of HIDDEN_API_ENFORCEMENT_JUST_WARN and verify log
Change-Id: I588f347716a79ac5887b74763c8afc16b3be699b
Added an AlertActivity to intercept the start for an activity belonging
to a suspended app. More details will be shown if the suspending app
also defines an activity to handle the API action
SHOW_SUSPENDED_APP_DETAILS.
Test: Added tests to existing classes. Can be run via:
atest com.android.server.pm.SuspendPackagesTest
atest com.android.server.pm.PackageManagerSettingsTests
atest com.android.server.pm.PackageUserStateTest
Bug: 75332201
Change-Id: I85dc4e9efd15eedba306ed5b856f651e3abd3e99
This change plumbs the original uid of a startActivity call through to
PackageManagerService#queryIntentActivitiesInternal so that we properly
filter.
Test: manual - launch previously failing instant app
Change-Id: I0a62195f67c2e08315ce2d87f1d8c516c2327ba6
Fixes: 77489209
This compatibility change ensures that apps built for pre-P that rely
on reflection to access ApplicationInfo#versionCode don't crash. The
move to long version code introduces a new field and all modifications
of the field are wrapped in a method that ensures both the new and old
fields are set appropriately.
Test: manual - impacted app runs
Change-Id: I5fb37c65b0fb04042dda12479d1e1a76590daa3d
Fixes: 74393568
This means that APKs signed with the platform cert are allowed to use
hidden APIs, even if they are not on the package whitelist, and if they are
not in the system image. It will also allow a number of packages to be
removed from the package whitelist.
Also remove all platform cert signed apps from the package whitelist, as
there is no longer any need for them to be in there.
Bug: 64382372
Test: device boots
Change-Id: Id805419918de51f946c1f592581bab36ae79de83