Commit Graph

6689 Commits

Author SHA1 Message Date
Jeff Sharkey
3b25e5306c Merge "Protect usage data with OP_GET_USAGE_STATS." into pi-dev am: ddb15c471c
am: 37bbe98e86

Change-Id: If8cfddaf96d28b3815dd6dca6aa52a7b9bd15da6
2018-04-19 20:08:03 -07:00
Jeff Sharkey
ddb15c471c Merge "Protect usage data with OP_GET_USAGE_STATS." into pi-dev 2018-04-20 02:38:01 +00:00
Jeff Sharkey
0ad6283da7 Protect usage data with OP_GET_USAGE_STATS.
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
2018-04-19 15:46:59 -06:00
Makoto Onuki
c5e8e23e57 Merge "SyncManager: Dump per-source last sync time too." into pi-dev am: d329ae8010
am: 5bb2f9b14d

Change-Id: I0a7c222e33cf8ff95ab8834c4ec31c7a69e0e605
2018-04-19 11:09:57 -07:00
Makoto Onuki
c52be80cb7 Merge "Split provider / service dumpsys into platform and non-platform" into pi-dev am: dbdf5df96e
am: c7ed7f0074

Change-Id: I84fd648bf5b47690ab0082516a99c4bbd7be1914
2018-04-19 11:00:05 -07:00
Makoto Onuki
d329ae8010 Merge "SyncManager: Dump per-source last sync time too." into pi-dev 2018-04-19 17:37:45 +00:00
Makoto Onuki
dbdf5df96e Merge "Split provider / service dumpsys into platform and non-platform" into pi-dev 2018-04-19 17:21:48 +00:00
Suprabh Shukla
7f7c493ac0 Merge "Added more documentation for dialogMessage" into pi-dev am: 4d5d3a0254
am: 74ef44e6eb

Change-Id: If381c630587490361af78b6e95d29fc33ad224f8
2018-04-18 17:52:32 -07:00
TreeHugger Robot
4d5d3a0254 Merge "Added more documentation for dialogMessage" into pi-dev 2018-04-19 00:13:13 +00:00
Suprabh Shukla
3e03ab9312 Added more documentation for dialogMessage
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
2018-04-18 16:01:29 -07:00
Dan Cashman
9fa0a7788f Merge "Add AccountManager key rotation awareness." into pi-dev am: 3091d60a70
am: a8992ecf37

Change-Id: I3ba929f0732a34a7f2694c96cec9fcb03b453838
2018-04-18 12:18:06 -07:00
Dan Cashman
303c4bbb40 Add AccountManager key rotation awareness.
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
2018-04-17 14:29:34 -07:00
Patrick Baumann
6111bb3891 Merge "Checks that secondary instrumentation ABI matches" into pi-dev am: 096e0587d2
am: ee2a275142

Change-Id: I4afd73a30f2f7db2423e4456c4320c4fe9a5913d
2018-04-17 11:52:43 -07:00
Makoto Onuki
0b575a3cdf Split provider / service dumpsys into platform and non-platform
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
2018-04-17 10:41:40 -07:00
Patrick Baumann
eb59580abd Checks that secondary instrumentation ABI matches
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
2018-04-17 09:55:47 -07:00
Makoto Onuki
e94874eed0 Merge "Add 1-day sync stats in syncmanager dumpsys." into pi-dev am: d7732b4c8a
am: 38f0cb4961

Change-Id: If710e543654f26213ff1143ca8e3335160e7371a
2018-04-16 19:16:56 -07:00
Makoto Onuki
f74cf940fe SyncManager: Dump per-source last sync time too.
Example:

Per Adapter History
     :
  mak...@gmail.com/com.google u0 [com.google.android.gms.people]
    Per source last syncs:
         OTHER  Success: 2018-04-16 17:03:38  Failure: 2018-04-16 17:04:27
         LOCAL  Success: N/A  Failure: N/A
          POLL  Success: N/A  Failure: N/A
          USER  Success: N/A  Failure: N/A
      PERIODIC  Success: N/A  Failure: N/A
          FEED  Success: N/A  Failure: N/A
    Last syncs:
      2018-04-16 17:04:27 io-error Source=OTHER Elapsed=0s Reason=AutoSync Extras=[]
      2018-04-16 17:03:38 success Source=OTHER Elapsed=5s Reason=AutoSync Extras=[]
      2018-04-16 17:03:20 success Source=OTHER Elapsed=3s Reason=AutoSync Extras=[]

Bug: 76035392
Change-Id: Id73cb10636897c4fe45caad5df13dca8b75381bd
Fixes: 76035392
Test: Manual test with dumpsys content with triggering various syncs
2018-04-16 17:20:19 -07:00
Makoto Onuki
d7732b4c8a Merge "Add 1-day sync stats in syncmanager dumpsys." into pi-dev 2018-04-17 00:11:25 +00:00
Dan Cashman
d5ad6a4f8d Merge "Replace PackageInfo#signingCertificateHistory field doc reference." into pi-dev am: 82f36b120d
am: cc369093f6

Change-Id: I1c2e82b513035872f831d2fd55063e451a383439
2018-04-16 16:27:19 -07:00
Dan Cashman
e942b914a4 Replace PackageInfo#signingCertificateHistory field doc reference.
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
2018-04-16 14:44:13 -07:00
Makoto Onuki
9498621f41 Add 1-day sync stats in syncmanager dumpsys.
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
2018-04-16 12:23:26 -07:00
Ricky Wai
2604d6ef05 Merge "Update PackageManager.getInstalledPackages() docs" into pi-dev am: ed2a3cadc1
am: 8798ae731c

Change-Id: I0136e13cab068ee93aab0820061adaef28bbc362
2018-04-16 12:07:05 -07:00
Ricky Wai
ed2a3cadc1 Merge "Update PackageManager.getInstalledPackages() docs" into pi-dev 2018-04-16 18:19:00 +00:00
Ricky Wai
9964f70f6a Update PackageManager.getInstalledPackages() docs
Update the docs about getInstalledPackages() returns installed apps
on current user not on the device.

Test: NULL
Bug:77955905
Change-Id: I3d9c48be54f6355dc1701d2c359785a575fbc1db
2018-04-13 13:50:00 +00:00
Benjamin Franz
8a27dc8598 Merge "Silently ignore force stop API for protected packages" into pi-dev am: df88614db2
am: 83612737a1

Change-Id: I3dc4209e0310495a2c6a035094e919a46f75a03f
2018-04-13 01:04:21 -07:00
Benjamin Franz
df88614db2 Merge "Silently ignore force stop API for protected packages" into pi-dev 2018-04-13 07:37:25 +00:00
Jeff Sharkey
266ee2b1f1 Merge "Fix broken target SDK checks." into pi-dev am: aab3304a22
am: 87caa7b9ad

Change-Id: I2d0d813284e483b05bf73d5d91fcfa13bce967d8
2018-04-11 21:58:49 -07:00
TreeHugger Robot
aab3304a22 Merge "Fix broken target SDK checks." into pi-dev 2018-04-12 04:40:06 +00:00
Daniel Cashman
934b61ddcb Merge "Add SigningInfo class to expose package signing details." into pi-dev am: 960a0c6c57
am: 63b447531e

Change-Id: Ie311660c339d1293c2b332dc4da0e865a1d21685
2018-04-11 13:07:50 -07:00
Daniel Cashman
960a0c6c57 Merge "Add SigningInfo class to expose package signing details." into pi-dev 2018-04-11 19:21:07 +00:00
Patrick Baumann
9c6579f3ad Merge "Revert "Check permissions only against packagesettings"" into pi-dev am: 61aebf6d39
am: 364100b737

Change-Id: I8bfcbb451463e1265f43e7d9b3405b328873c5f9
2018-04-11 10:01:45 -07:00
Benjamin Franz
f81bf7fa75 Silently ignore force stop API for protected packages
Bug: 75997475
Test: manual
Change-Id: I804aafe2404eeaac732fed51cf6d3d2e45a3b5bb
2018-04-11 17:21:16 +01:00
TreeHugger Robot
61aebf6d39 Merge "Revert "Check permissions only against packagesettings"" into pi-dev 2018-04-11 16:05:39 +00:00
Patrick Baumann
97b9b5304c Revert "Check permissions only against packagesettings"
This reverts commit b00eb64591.

Reason for revert: Boot issues after OTA
Bug: 76228188
Fixes: 77888575
Change-Id: I5ca2605cb6befea46ce50198bc72bdd4b6e84f1a
2018-04-11 14:52:31 +00:00
Suprabh Shukla
5e5a6c375f Merge "Review of suspend/unsuspend APIs" into pi-dev am: 2188383b8a
am: 03026cb894

Change-Id: Ifd15ef4d5db195b862cf800cf0d2fff11b26745d
2018-04-11 01:08:11 -07:00
Suprabh Shukla
96212bca06 Review of suspend/unsuspend APIs
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
2018-04-10 17:34:12 -07:00
Dan Cashman
5c9f527e33 Add SigningInfo class to expose package signing details.
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
2018-04-10 22:19:20 +00:00
Jeff Sharkey
aa1a911d9a Fix broken target SDK checks.
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
2018-04-10 15:18:15 -06:00
Suprabh Shukla
040bf34479 Merge "setPackagesSuspended now overwrites all the state" into pi-dev am: e901d69ea6
am: f283b41a63

Change-Id: I39ec00edf07095ae63d28dfd2fb69cd6a11f89c9
2018-04-10 13:46:14 -07:00
TreeHugger Robot
e901d69ea6 Merge "setPackagesSuspended now overwrites all the state" into pi-dev 2018-04-10 20:15:24 +00:00
Dan Sandler
28bad11b8d Merge "Fix javadoc xrefs." into pi-dev am: 64c8e13b2a
am: 73615ba5d1

Change-Id: I5ade8bee9b767497872066a9fcccce2eba01f93e
2018-04-10 09:22:38 -07:00
TreeHugger Robot
64c8e13b2a Merge "Fix javadoc xrefs." into pi-dev 2018-04-10 15:56:28 +00:00
Mathew Inwood
8e913755d5 Merge "Different hidden API enforcement policy for P & pre-P." into pi-dev am: 9139bbfa9b
am: 9c5d1784b9

Change-Id: I13ee422263c141cf3c18b46da59acf26d24e6042
2018-04-10 06:33:23 -07:00
Mathew Inwood
1ab3025cc7 Different hidden API enforcement policy for P & pre-P.
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
2018-04-10 10:13:07 +01:00
Patrick Baumann
37b676aa32 Merge "Check permissions only against packagesettings" into pi-dev am: 3f345a99f7
am: b13f71a16c

Change-Id: I3d8e92ddca70f93160af55627c95c15793dad28c
2018-04-09 20:46:35 -07:00
TreeHugger Robot
3f345a99f7 Merge "Check permissions only against packagesettings" into pi-dev 2018-04-10 01:38:48 +00:00
Suprabh Shukla
45b9e40a4f setPackagesSuspended now overwrites all the state
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
2018-04-09 17:49:54 -07:00
Daniel Cashman
c7ff90679f Merge "Clarify PackageManager.hasSigningCertificate docs." into pi-dev am: a5bdeabf15
am: 9b1bd200b2

Change-Id: I08166aa315459aa4228588f392f80963bbc059e8
2018-04-09 17:08:30 -07:00
TreeHugger Robot
a5bdeabf15 Merge "Clarify PackageManager.hasSigningCertificate docs." into pi-dev 2018-04-09 22:56:23 +00:00
Patrick Baumann
b00eb64591 Check permissions only against packagesettings
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
2018-04-09 13:31:39 -07:00