Commit Graph

6629 Commits

Author SHA1 Message Date
Mathew Inwood
5d52e3f5ea Merge "Fix typo in comments." into pi-dev am: 6c73779442
am: 9dd68c73ee

Change-Id: I28237550fb37a7c0680c763fa84cc6129755fb02
2018-04-06 07:43:05 -07:00
Mathew Inwood
703063a52a Merge "Replace ALL_LISTS policy with JUST_WARN." into pi-dev am: 1f8757d35f
am: fa631b1247

Change-Id: I5dfd8a8002e23ba012af0e642af7eeb336e3eb80
2018-04-06 05:56:32 -07:00
Mathew Inwood
5e986dccfd Fix typo in comments.
Keep the nitpickers happy.

Test: m
Bug: 77517571
Change-Id: I70374c05df3e366b5a0ce3bbb103dce28f48d4b8
2018-04-06 13:55:44 +01:00
Mathew Inwood
1f8757d35f Merge "Replace ALL_LISTS policy with JUST_WARN." into pi-dev 2018-04-06 12:32:42 +00:00
Suprabh Shukla
acdfc1df62 Merge "Activity interceptor dialog for suspended apps" into pi-dev am: 822ce4f3aa
am: fce7bf015e

Change-Id: I20ef2001636ee1a75bcf5d9d7b097848bb15c710
2018-04-05 14:41:00 -07:00
TreeHugger Robot
822ce4f3aa Merge "Activity interceptor dialog for suspended apps" into pi-dev 2018-04-05 21:15:19 +00:00
Patrick Baumann
988440729a Merge "Fixes non-web AIA internal launch" into pi-dev am: cb331c32db
am: cf180c376d

Change-Id: I61205d6cd0b514e4c9140c53b7022ed862eac178
2018-04-05 11:15:14 -07:00
Patrick Baumann
1b33e25e8d Merge "Copy ApplicationInfo#versionCode field" into pi-dev am: a4d6570b2f
am: d5160491ef

Change-Id: Id8349ebdd4790b4fac61403155c4c55d40a0247b
2018-04-05 10:27:26 -07:00
TreeHugger Robot
cb331c32db Merge "Fixes non-web AIA internal launch" into pi-dev 2018-04-05 17:07:14 +00:00
TreeHugger Robot
a4d6570b2f Merge "Copy ApplicationInfo#versionCode field" into pi-dev 2018-04-05 16:20:25 +00:00
Mathew Inwood
a6d02fb104 Replace ALL_LISTS policy with JUST_WARN.
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
2018-04-05 16:27:50 +01:00
Mathew Inwood
c89245f5e6 Merge "Exempt platform-cert signed apps from hidden API checks." into pi-dev am: 0e650c1c55
am: 85a2c917bd

Change-Id: I54a5fc64c5c1f1bfba3f4e90a6af811ddecd2689
2018-04-05 04:07:42 -07:00
Mathew Inwood
0e650c1c55 Merge "Exempt platform-cert signed apps from hidden API checks." into pi-dev 2018-04-05 10:43:12 +00:00
Rubin Xu
354cb645fa Merge "Device ID attestation: Add feature flag." into pi-dev am: 73961397e5
am: 1352861682

Change-Id: I564a99552bd1292dcc0dc85add1b836de028f85f
2018-04-05 03:13:25 -07:00
Rubin Xu
73961397e5 Merge "Device ID attestation: Add feature flag." into pi-dev 2018-04-05 09:38:28 +00:00
Suprabh Shukla
3c3af1406e Activity interceptor dialog for suspended apps
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
2018-04-04 18:40:19 -07:00
Suprabh Shukla
c84671aa24 Merge "Hiding windows for suspended packages" into pi-dev am: fe99686d8a
am: c027b065f4

Change-Id: I501b078bc6eb1b5fb89c2b1c8862c7e172e93b87
2018-04-04 16:59:05 -07:00
TreeHugger Robot
fe99686d8a Merge "Hiding windows for suspended packages" into pi-dev 2018-04-04 22:42:37 +00:00
Patrick Baumann
7838027fb0 Fixes non-web AIA internal launch
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
2018-04-04 14:32:26 -07:00
Patrick Baumann
c2def58ec0 Copy ApplicationInfo#versionCode field
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
2018-04-04 12:18:16 -07:00
Mathew Inwood
9d89543d48 Exempt platform-cert signed apps from hidden API checks.
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
2018-04-04 17:49:48 +01:00
Suprabh Shukla
69c71423ec Hiding windows for suspended packages
Suspended packages get their activities intercepted at start, but they
can still show system_alert or toast_windows from other components.
These need to be hidden when the app goes into suspend and unhidden when
it is unsuspended.

Test: atest com.android.server.wm.WindowStateTests

Bug: 77498821
Change-Id: I9ac446f20feb23e2090ba306b4435c46b9aeec95
2018-04-03 17:00:09 -07:00
Daniel Cashman
629a5f9705 Add ROLLBACK past signing cert capability.
Add a new capability that may be granted to past signing certificates
after changing to a new signing certificate that will allow applications
to go back to a previous signing certificate.  This capability is
intended to not be granted, but may be added later in the event that
a signing certificate change caused undesirable behavior.

Bug: 73927694
Test: PkgInstallSignatureVerificationTest
Change-Id: I7453a2da00e740a55de45e7b144f308a9bc33772
(cherry picked from commit a1d0cf74f9)
2018-04-02 20:12:14 +00:00
TreeHugger Robot
96453af19b Merge "Add ROLLBACK past signing cert capability." 2018-04-02 19:47:39 +00:00
Daniel Cashman
a1d0cf74f9 Add ROLLBACK past signing cert capability.
Add a new capability that may be granted to past signing certificates
after changing to a new signing certificate that will allow applications
to go back to a previous signing certificate.  This capability is
intended to not be granted, but may be added later in the event that
a signing certificate change caused undesirable behavior.

Bug: 73927694
Test: PkgInstallSignatureVerificationTest
Change-Id: I7453a2da00e740a55de45e7b144f308a9bc33772
2018-03-31 08:44:32 -07:00
Suprabh Shukla
1f9089af51 Merge "Adding LauncherApps apis for suspended packages" into pi-dev am: a6d6a5aa79
am: 733b8340a4

Change-Id: Id76853b6b65f128f193ce054491c5b0aaa672d05
2018-03-31 06:44:30 +00:00
TreeHugger Robot
a6d6a5aa79 Merge "Adding LauncherApps apis for suspended packages" into pi-dev 2018-03-31 00:39:52 +00:00
Suprabh Shukla
19b41f34a5 Adding LauncherApps apis for suspended packages
The suspending app can provide a Bundle of information to be used by the
launcher for handling suspended packages. Added APIs:
 - getSuspendedPackageLauncherExtras(String, UserHandle): To retrieve
 the launcher extras for the given package and user.
 - Callback#onPackagesSuspended(String[], UserHandle, Bundle): A
 callback that will be invoked with the package names and the launcher
 extras whenever sent packages are suspended.

Test: atest com.android.server.pm.SuspendPackagesTest

Bug: 76119578
Change-Id: I505d134809639a57c3314f994af34d576d905e74
2018-03-30 21:21:41 +00:00
Makoto Onuki
c2b812647c Merge "AppStandby exemption: sync requested by FG apps" into pi-dev am: 929ce0086a
am: b819348712

Change-Id: I3efc9b914a4654d77f6a17033bb88c45a7f28a1b
2018-03-30 15:30:20 +00:00
Makoto Onuki
75ad2496eb AppStandby exemption: sync requested by FG apps
Bug: 72443754
Fix: 72443754

Test: atest ${ANDROID_BUILD_TOP}/frameworks/base/services/tests/servicestests/src/com/android/server/content/SyncOperationTest.java
Test: Manual test with contacts sync:

Precondition: Put the contacts sync in RARE bucket.

adb shell dumpsys deviceidle tempwhitelist -r com.google.android.syncadapters.contacts
adb shell am make-uid-idle com.google.android.syncadapters.contacts
adb shell am set-standby-bucket com.google.android.syncadapters.contacts 40

Test 1: Toggle contacts sync from the Settings -> Account

- Make sure a sync happens.

Test 2: Mutate a contact on the WEB

- Sync is scheduled, but won't run because it has no network access.
- am set-standby-bucket com.google.android.syncadapters.contacts 30
- Sync run runs.

Test 3. adb shell requestsync -n ACCOUNT -t com.google -a com.android.contacts

- Sync is scheduled but won't run.

Test 4. adb shell requestsync -n ACCOUNT -t com.google -a com.android.contacts -f

- Sync is scheduled but it still won't run.

Test 5. adb shell requestsync -n ACCOUNT -t com.google -a com.android.contacts -F

- Sync now runs

Change-Id: I1eb972ed321d2a1a782ae23ccb806671926d3e6b
2018-03-29 14:53:02 -07:00
Eran Messeri
adaf68cd62 Device ID attestation: Add feature flag.
Add a feature flag to find out if Device ID attestation is supported or
not, as it is an optional feature.
Otherwise, the cts tests could not meaningfully say if the device
correctly supports this feature or not.

Bug: 72642093
Bug: 73448533
Test: Modified CTS tests.
Change-Id: Ia6ba47a5262412ab24afa700d1b891be10a21df9
2018-03-29 21:56:37 +01:00
Joshua Baxter
8914ab76c2 Merge "docs: fixed a couple of typos" into oc-mr1-dev am: 651ffd426c am: 9a2d959eff
am: affc3087f5

Change-Id: I1e9ea0a3ffc11090bf6d7c08b1c2354fc08809a8
2018-03-29 01:24:52 +00:00
Joshua Baxter
9a2d959eff Merge "docs: fixed a couple of typos" into oc-mr1-dev
am: 651ffd426c

Change-Id: Ie6fb97aae76637023657d751f6ad0ebbc74ff284
2018-03-28 22:06:24 +00:00
TreeHugger Robot
dedfd8fec7 Merge "Convert compilation reason and filter to int-enum before logging" into pi-dev 2018-03-28 20:35:37 +00:00
Jiuyu Sun
2679f76f6f Merge "Add grant and revoke default permissions to active LUI app." into pi-dev am: b1adae546c
am: 64034c6edd

Change-Id: I7b75d147c808f7f5b43ff2d722e61f72a51eebab
2018-03-28 18:21:36 +00:00
Jiuyu Sun
b1adae546c Merge "Add grant and revoke default permissions to active LUI app." into pi-dev 2018-03-28 17:44:35 +00:00
Suprabh Shukla
bd6826dc4c Merge "Sending MY_PACKAGE_SUSPENDED to suspended apps" into pi-dev am: 1c73370df4
am: 33333ae877

Change-Id: I5ebfd6c2eca1a164a4875ec221792bae9803605e
2018-03-28 03:14:54 +00:00
TreeHugger Robot
1c73370df4 Merge "Sending MY_PACKAGE_SUSPENDED to suspended apps" into pi-dev 2018-03-28 00:45:23 +00:00
Joshua Baxter
9a841a6519 docs: fixed a couple of typos
Test: make ds-docs

Bug: 36948822
Bug: 36946883

Change-Id: I4de699dc7d5a69e456b0656de890f76b9787aafa
2018-03-27 21:44:55 +00:00
Calin Juravle
a86783b87d Convert compilation reason and filter to int-enum before logging
Test: adb logcat -b events | grep sysui_multi_action
Bug: 73102540
Change-Id: I052df3d4e65ef16b43190c14a236421945c86e21
(cherry picked from commit c7a44be7b3)
2018-03-27 20:28:11 +00:00
Calin Juravle
c7a44be7b3 Convert compilation reason and filter to int-enum before logging
Test: adb logcat -b events | grep sysui_multi_action
Bug: 73102540
Change-Id: I052df3d4e65ef16b43190c14a236421945c86e21
2018-03-27 11:51:51 -07:00
TreeHugger Robot
c6d9f7ce1d Merge "More flexible API enforcement policy." into pi-dev 2018-03-27 10:34:38 +00:00
Mathew Inwood
e3299533b5 More flexible API enforcement policy.
This CL adds the basics to set black, dark gray or light gray list
enforcement, rather than just black as before. It's not possible to
actually set the policy per-package yet.

PackageDexOptimizer still uses a single bit, for API checks on/off, rather
than the new enum. It assumes blacklist enforcement internally. This can
be improved in a follow up CL.

(cherry-picked from commit e52130ae4c)

Test: m
Test: Boot device

BUG: 73337509
Change-Id: Ieb4bd9cc439c6a5b8fb9424d8902d8b46aec309f
Merged-In: Idd73c9938592c5c4d67cfb9efefdffed0dd5f262
2018-03-27 09:28:33 +01:00
Holly Jiuyu Sun
349e214dc2 Add grant and revoke default permissions to active LUI app.
Grant the camera permission to the active LUI app since LUI uses QR scanner
to download profile.
Before it, revoke the previously granted permissions first.

Bug: 35068517
Test: test on phone
Change-Id: I2db9597eed423835b9499ef6000579b5ee5b2cb6
2018-03-26 20:19:58 -07:00
Suprabh Shukla
2fd43ba63e Sending MY_PACKAGE_SUSPENDED to suspended apps
Added new broadcast actions MY_PACKAGE_SUSPENDED and
MY_PACKAGE_UNSUSPENDED, which are sent to the package that is affected
by the suspend state change. A suspended package also receives a bundle
of app extras to pass more information. This makes it easier for
packages to deal with being suspended/unsuspended.

Also updated some existing documentation to make it clearer.

Test: atest com.android.server.pm.SuspendPackagesTest

Bug: 75036698
Change-Id: I772cf0c023669bc946e07ced4ebccfa74f6835b2
2018-03-26 18:01:13 -07:00
Philip P. Moltmann
4d5c36a19c Merge "Make PackageManager#getNamesForUids testable." into pi-dev am: 9360a31f5f
am: 895b6a19a6

Change-Id: I91c97b4755173c0c870f692b0026886b0e03faf5
2018-03-26 23:08:15 +00:00
Philip P. Moltmann
895b6a19a6 Merge "Make PackageManager#getNamesForUids testable." into pi-dev
am: 9360a31f5f

Change-Id: Ie4c8cb0ffa78bd1a008aad2eae9caae6c2c0afb5
2018-03-26 22:56:01 +00:00
TreeHugger Robot
9360a31f5f Merge "Make PackageManager#getNamesForUids testable." into pi-dev 2018-03-26 22:36:45 +00:00
Chris Craik
c38e97fcaa Merge "Merge "Remove incorrect @NonNull annotations on getDrawable() and variants." into pi-dev am: d52c532df7" into pi-dev-plus-aosp
am: 51b58b2479

Change-Id: I61aae2f93b0aa0991b33ea376e4809ebce23df31
2018-03-26 21:17:36 +00:00
Chris Craik
407488584c Merge "Remove incorrect @NonNull annotations on getDrawable() and variants." into pi-dev
am: d52c532df7

Change-Id: Ib503211113d175ed633a6e2045cd01938ba0d4c0
2018-03-26 20:42:10 +00:00