Commit Graph

6257 Commits

Author SHA1 Message Date
Jeff Sharkey
c9cbc3e5fc Merge "FBE devices now fully support adoptable storage." 2018-01-05 03:53:56 +00:00
Jeff Sharkey
8eb783b21e FBE devices now fully support adoptable storage.
We've finished all the underlying work to support adoptable storage
on FBE devices, so remove the code that was disabling it by default.

Introduce feature flag to make it easier to detect devices that
support adoptable storage.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 29923055, 25861755, 33252673, 37289651
Change-Id: I3630d690c9e66c7e41e316a4263ea2eb1e752ad3
2018-01-04 18:50:14 -07:00
Philip P. Moltmann
e92d9e1156 Merge changes from topic "BackupManagerModernInstallInterface"
* changes:
  Disable installation via adb restore
  Use modern install method in backup service
2018-01-04 23:50:40 +00:00
Philip P. Moltmann
79c238ada6 Use modern install method in backup service
Test: adb backup -apk myApp -f backup ; adb restore backup
Change-Id: I2bbcb0487ecc525a6dc8a2693b15ce624db275b0
2018-01-04 13:26:28 -08:00
Eric Enslen
1e423b950a Default grant coarse loc perm to use-open-wifi app
Bug: 70843697
Test: flashed onto walleye and confirmed permission granted when WFA is
enabled.

Change-Id: Ic53886478ec6b8bef311f2f94e0976f7870c8cd1
2018-01-04 10:43:46 -08:00
Todd Kennedy
42d61605d8 Auto udpate package list
Change-Id: I4e4f1666f5cdfb74800435642f564bc98e1fad4e
Fixes: 69963506
Test: Manual. Can add users w/o blocking
2018-01-02 15:08:54 +00:00
Tony Mak
9240c7fdc0 Fix the lint checking of CROSS_PROFILE_APPS_SERVICE
Bug: 67765768
Test: BUILD

Change-Id: I6ce794c5266018c55ccbdf73c9c9cc5dd944a66b
2017-12-29 11:02:19 +00:00
Svet Ganov
8f90bcc50a Document which sys services can be accessed by instant apps
This change documents that some system services are not available
to instant apps due to the restricted security sandbox they run in.
Also ensure that if target SDK is P WallpaperManager is null if the
backing system service cannot be looked up to be consistent with
the way other system services behave.

Test: Manual

Fixes: 70984822
Fixes: 69848394

Change-Id: I9aae884d5840c92136c7d713fac87e7732dc2642
2017-12-23 20:47:12 +00:00
Svet Ganov
d223db316d Add infrastructure for running a11y tests in instant mode
This change adds a special flag when binding to a service to request
instant apps to be considered as well (assuming the caller has the
permission to see instant apps). This flag is scoped only for the
platform to use and is intended only for development and testing.
Specifically, we have a class of CTS tests that has tests plus service
in the same APK (accessibility, printing, autofill, any other plugin
based sub-system).

Instead of doing the tediuous work split all these into one APK with
tests and one with the services where the latter exposes a remote
interface to the former, we will be adding shell commands to the
dedicated sub-system to allow temporary binding to plugins provided
by instant apps. The goal is not validating the plugin behavious,
rather a working plugin is required to test app side funcionality.

This change adds a shell command to allow the a11y manager serivce
to bind to plugins provided by instant apps. This is required to
be able to run relevant CTS test cases in instant mode.

Test: cts-tradefed run cts-dev -m CtsAccessibilityTestCases
      cts-tradefed run cts-dev -m CtsAccessibilityServiceTestCases

Bug: 70978575

Change-Id: Ifced735a9a6e495747372dd8b00fdd64933a09c7
2017-12-23 02:36:46 +00:00
TreeHugger Robot
edf829f41b Merge "Enforce platform level animation in CrossProfileApps.startMainActivity" 2017-12-22 11:24:28 +00:00
Hall Liu
aa9347980e Merge "Add feature flag and EMBMS bug fixes" am: 465f2916e0 am: 3424136a59
am: effcd1f508

Change-Id: Ibefdba1da5da4bfdf93d7db4c0f42a79ad75be46
2017-12-22 01:01:50 +00:00
Hall Liu
effcd1f508 Merge "Add feature flag and EMBMS bug fixes" am: 465f2916e0
am: 3424136a59

Change-Id: Iebc092e58752f32b6abfad612901ae094e083449
2017-12-22 00:54:14 +00:00
TreeHugger Robot
316de4a7f9 Merge "Add plsCertsNoVerifyOnlyCerts to ApkSignatureVerifier." 2017-12-21 16:00:22 +00:00
Dan Cashman
636ea5e888 Add plsCertsNoVerifyOnlyCerts to ApkSignatureVerifier.
There are currently two conceptual operations performed by PackageParser
while parsing APKs: collecting certificates and verifying them.
ApkSignatureVerifier relies on the systemDir flag to indicate whether or
not it should do a full verification of a package, but this only applies
when verifying V1 (jar signed) APKs.  This distinction should be explicitly
made.  This creates cleaner code and also saves time when verifying V2
signed systemDir APKs.

Bug: 64686581
Test: Builds, boots, passes
android.appsecurity.cts.PkgInstallSignatureVerificationTest.

Change-Id: Ie8a0f8cad3dd8f70da791f2f1f4516e84e2ae4d0
2017-12-20 16:02:51 -08:00
Ian Lake
1f4e67b6e1 Improve Fragment+Loader deprecation Javadoc
Make it clear that the framework versions of
Fragments and Loaders should be replaced with their
identically named versions in the Support Library.

Reference the recent work on Lifecycle as an example
of a Support Library only change that should motivate
developers to switch to the Support Library
equivalents.

Test: Reviewed new Javadoc
BUG: 70336450
Change-Id: I93151fa0a316bba824c2e55f80f7de9d30bed3c6
2017-12-20 18:16:40 +00:00
Tony Mak
089c35e931 Enforce platform level animation in CrossProfileApps.startMainActivity
With this change, whenever apps start an activity in another profile
using CrossProfileApps.startMainActivity, an animation will be enforced.
For now, we are showing the "open task" animation.
We may put something fancier if we have time in P.

Test: cts-tradefed run cts-dev --module DevicePolicyManager --test - com.android.cts.devicepolicy.CrossProfileAppsHostsideTest
Test: atest services/tests/servicestests/src/com/android/server/pm/crossprofile/CrossProfileAppsServiceImplTest.java
Bug: 70799822

Change-Id: I03525080151c6112633108419d69d64e76a511f3
2017-12-20 17:04:15 +00:00
Kevin Hufnagle
1c48aea609 docs: Touch-up edits to ShortcutManager class reference. am: 4777f37f78
am: 6f2f0f639b

Change-Id: I7be85e7c7dbbc26a76a840422cfe4c95041840b0
2017-12-18 22:07:56 +00:00
Kevin Hufnagle
6f2f0f639b docs: Touch-up edits to ShortcutManager class reference.
am: 4777f37f78

Change-Id: Ibc90a8a2771a3e9fe5e59398be986b75490c60c2
2017-12-18 21:55:02 +00:00
TreeHugger Robot
c9d65a29ed Merge "Returns signing version from ApkSignatureVerifier" 2017-12-18 20:58:13 +00:00
Kevin Hufnagle
4777f37f78 docs: Touch-up edits to ShortcutManager class reference.
Test: make ds-docs -j16

Bug: 64727234
Change-Id: Ieb2c2f6ee6706f206e2cc0d5be8bc3a5cdd9f345
2017-12-18 10:47:58 -08:00
Kevin Hufnagle
01bd4f3baa Merge "docs: Revised wording, section order for ShortcutManager API ref." into oc-mr1-dev am: d642148c84
am: 87ce35c371

Change-Id: I0de0bea5712143e70f851f42fadaed0aa0eece64
2017-12-18 18:01:46 +00:00
Patrick Baumann
9ff55740c2 Returns signing version from ApkSignatureVerifier
This is a first step at a larger goal of moving instant app
verifications from parsing logic into install logic.

Test: manual - install v1 and v2 instant app and static lib
Test: android.appsecurity.cts.PkgInstallSignatureVerificationTest passes.
Change-Id: Iab50b91a6fb8ef014b573bb9f733d30c1aa6022f
Bug: 68860689
2017-12-18 09:58:22 -08:00
Kevin Hufnagle
87ce35c371 Merge "docs: Revised wording, section order for ShortcutManager API ref." into oc-mr1-dev
am: d642148c84

Change-Id: Iabb204baf3772b44b6852ec9d7135db0baf228bc
2017-12-18 17:52:36 +00:00
Kevin Hufnagle
d642148c84 Merge "docs: Revised wording, section order for ShortcutManager API ref." into oc-mr1-dev 2017-12-18 17:42:48 +00:00
Kevin Hufnagle
b45780bda0 docs: Revised wording, section order for ShortcutManager API ref.
Provided more thorough description of static shortcut options,
integrated shortcut limits section with the "updating shortcuts"
example, added more links to narrative documentation.

Test: make ds-docs -j8

Bug: 64727234
Change-Id: I70c16082e3e85a31b501c8e313d93200d827c7f4
2017-12-15 15:48:55 -08:00
Dan Cashman
63addbd363 Fix security bug: collect certs for non-systemDir apks.
ag/3340390 changed untrusted value to systemDir while going through
code review, flipping the meaning of the variable, but this was not
reflected in the call site.  As a result, systemDir apps are the
only ones being fully verified, which is the opposite of what we want.

Test: Builds, eventually CTS.

Change-Id: I585ac65c957f0d8db6c73f003d3a3eb2b79c8883
2017-12-14 13:37:17 -08:00
TreeHugger Robot
895d73105b Merge "Add more IntDef prefixes for auto-documenting." 2017-12-14 07:17:52 +00:00
Jeff Sharkey
ce8db99114 Add more IntDef prefixes for auto-documenting.
Test: builds, boots
Bug: 70177949
Exempt-From-Owner-Approval: annotation-only changes
Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
2017-12-13 20:05:36 -07:00
Jason Monk
3706cf9e28 Merge "Add AppComponentFactory API" 2017-12-14 02:21:12 +00:00
TreeHugger Robot
b6c92f00d2 Merge "Refactor PackageParser.collectCerts() to hide signature scheme." 2017-12-14 00:04:18 +00:00
Jeff Sharkey
8439ac08b1 Start accepting Executors instead of Handlers.
After discussion in API council, our new best-practices are to have
developers provide an Executor to dispatch callbacks/listeners on,
instead of the previous guidance of using a Handler.

Define Context.getMainExecutor() to easily obtain an Executor
associated with the main thread of application.  This allows new
APIs to require a @NonNull Executor.  Also define a new
@CallbackExecutor auto-doc annotation that explains background and
points developers at new Context method above.

Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.cts.ContextTest#testMainLooper
Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.cts.ContextTest#testMainExecutor
Bug: 70348426
Change-Id: I536892bcd80fcfba1bb1ddf67648c08a26d7ddd2
2017-12-13 13:59:04 -07:00
Jason Monk
a80bfb5d55 Add AppComponentFactory API
API to allow some classloader control over instantiation of
items from application's manifest. Unlike the first attempt
this does not encourage developers to extend Application, it simply
provides a small surface to allow control over the creation of objects
like Activities, Services, Receivers, and Providers.

Test: manual
Bug: 70623879
Change-Id: Idcab7c60f54ce3f4575ac29dcdcae321cf458bf3
2017-12-13 15:36:26 -05:00
Dan Cashman
e92f8428dd Refactor PackageParser.collectCerts() to hide signature scheme.
PackageParser shoudln't really need to know the gory details of APK
verification, it should just get back the blobs it needs to do its
job.  Move the package verification into its own class which is
*almost* exclusively responsible for verifying app signatures. This
is in preparation for adding APK signature scheme v3, which will add
yet another way to do this.

Bug: 64686581
Test: Builds 'n' boots without issue.
Test: android.appsecurity.cts.PkgInstallSignatureVerificationTest passes.
Change-Id: Ieb76b2353bd44ffdb83e7b894e5ad720d1697dc7
2017-12-13 12:20:21 -08:00
Adam Lesinski
6036449709 Merge "OMS: Only allow trusted overlays to be registered." into oc-mr1-dev
am: a06854e77a

Change-Id: I9d4f214b3911fb66fd2baa8ad83e8450246c3c80
2017-12-12 23:36:57 +00:00
TreeHugger Robot
a06854e77a Merge "OMS: Only allow trusted overlays to be registered." into oc-mr1-dev 2017-12-12 21:48:11 +00:00
Przemyslaw Szczepaniak
ab223112d1 Reject apks targeting deprecated sdk
As part of deprecation policy enforcement for android apps, minimum
supported targetSdkVersion will be 17. Apks targeting values lower that
one set in PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION will fail to install.

PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION is currently set to 0 and
will be set to 17 in a following cl.

Installation of deprecated apks can be forced using adb install
--force-sdk flag.

More details in http://go/android-platform-deprecation-policy.

Test: tests are in complementary Cts cl.
Bug: 63926630
Change-Id: I8e55bdebf1fb2cfd951e2c6703ccc87b8d4e9a09
2017-12-12 11:47:12 +00:00
Todd Kennedy
57e6b4fb4d Merge "Fix package manager tests" 2017-12-12 00:37:35 +00:00
Hall Liu
c6703d9af7 Add feature flag and EMBMS bug fixes
Add a feature flag for EMBMS
Modify validation in ServiceInfo constructor
Change return signature of some download methods to better reflect
synchronous errors

Test: run cts tests
Change-Id: I42ee748ba29ba62becf23c5487310cd1e7a397da
2017-12-11 14:10:36 -08:00
TreeHugger Robot
d8171027f3 Merge "OMS: Only allow trusted overlays to be registered." 2017-12-11 21:51:41 +00:00
Todd Kennedy
5b1df2fb5a Fix package manager tests
Test: bit FrameworksServicesTests:com.android.server.pm.
Change-Id: I06089adcdf6cdaebc7176cab30254cc2cbd836eb
2017-12-11 13:36:18 -08:00
Jeff Sharkey
27674aedc0 Merge "Add auto-doc support for @StringDef." 2017-12-11 16:47:13 +00:00
TreeHugger Robot
21ce736414 Merge "PROTECTION_FLAG_VENDOR_PRIVILEGED as @TestApi" 2017-12-09 01:10:58 +00:00
Jeff Sharkey
5db9a91135 Add auto-doc support for @StringDef.
Behaves pretty much the same as @IntDef, but now supports "suffix"
in addition to "prefix" when matching constants.

Test: manual docs output looks sane
Bug: 70406696
Change-Id: I35064b0f9f36f1f13ccdb40302d818a004014f15
2017-12-08 17:33:40 -07:00
Etan Cohen
6df47c6228 Merge "[RTT2] Update RTT service name" 2017-12-08 23:17:28 +00:00
Adam Lesinski
ab56b9d9df OMS: Only allow trusted overlays to be registered.
Bug: 69383160
Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.OverlayHostTest
Change-Id: I930c11716317cff1ec485a3943d1f22f07a423df
2017-12-08 13:55:23 -08:00
TreeHugger Robot
0e1209bedf Merge "Introduce isForegroundDefaultLauncher in ShortcutServiceInternal" 2017-12-08 13:26:35 +00:00
Tony Mak
ed6ef62bda Introduce isForegroundDefaultLauncher in ShortcutServiceInternal
BUG: 70212757

Test: bit FrameworksServicesTests:com.android.server.pm.ShortcutManagerTest{1..10}

Change-Id: Ia85cf990e3fcf1dae129ca9b1fc4c3af2838a284
2017-12-08 11:51:04 +00:00
Jiyong Park
2f24f039c3 PROTECTION_FLAG_VENDOR_PRIVILEGED as @TestApi
The flag is used in CTS.

Bug: 70332172
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermission2TestCases
-t
android.permission2.cts.PermissionPolicyTest#testPlatformPermissionPolicyUnaltered

Change-Id: Iba4ce1475991249980cc6a403037f4dd7bf722e5
2017-12-08 12:25:25 +09:00
TreeHugger Robot
1f5df44cf0 Merge "App Shortcuts: Update javadoc." 2017-12-08 01:57:53 +00:00
Neil Fuller
f3e904d4de Merge "Fix doc typo. Improve class javadoc..." am: e08f918a6e am: 26d28ef826
am: ac8f2c94fd

Change-Id: I3a587c589237460122cd2aacaed20c462e303db9
2017-12-08 01:49:33 +00:00