140 Commits

Author SHA1 Message Date
Jeff Sharkey
8b0cff7108 Give hidden API behavior to legacy apps.
Starting in R, there is a new public API overload that delivers a
flags argument.  Some apps may be relying on a previous hidden API
that delivered a userId argument, and this change is used to control
delivery of the new flags argument in its place.

There are dozens of these hidden API users are in the system UID,
either in the system process or the Settings app, so we hard-code
giving them the legacy behavior, since refactoring would be messy
between internal and AOSP branches.

Also adjust incoming and outgoing method signatures to use slightly
more flexible Collection<Uri>, which has handy methods like
contains() and isEmpty().

Bug: 150939131
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If6a77449e19215cf1c60d4217e62fc04b0959bfc
2020-03-10 16:36:21 -06:00
Peter Wang
2361687bec [API Review] Expose sendOrderedBroadcast
with appOp as String and options as Bundle

Bug: 139077993
Bug: 146423958
Test: Build
Change-Id: I5325e08d60016741139251813a5df9b42f2efc82
Merged-In: I5325e08d60016741139251813a5df9b42f2efc82
2020-02-26 15:58:33 -08:00
Dmitri Plotnikov
23132a29eb Merge "Add async version of "canonicalize"" 2020-02-20 17:42:52 +00:00
Andrii Kulian
5877c7d6c0 Exempt-From-Owner-Approval: Report non-visual Context misuse
Make obtaining a visual service from non-visual Context instance
report a strict mode violation and print the stacktrace.

Make calling getDisplay() throw an exception if called on an instance
that is not associated with a display. For existing usages introduce
a new internal method that does not perform the verification until
the usages are properly fixed.

Bug: 128338354
Test: StrictModeTest#testIncorrectContextUse_GetSystemService
Test: StrictModeTest#testIncorrectContextUse_GetDisplay
Change-Id: Id25d590eca6e10066e55d7ed6436d3bc9e433beb
2020-02-20 01:29:25 +00:00
Dmitri Plotnikov
7a223fbcf1 Add async version of "canonicalize"
Fixes: b/147699082
Test: atest FrameworksCoreTests:android.content.ContentResolverTest
Change-Id: I2e851839a454ad5eabc981c76774d03b57a1aa09
2020-02-19 11:58:26 -08:00
Tony Mak
c5a7432ebf Make TCS.getDefaultTextClassifierImplementation returns a ...
SystemTextClassifier that is backed by ExtServices

1. The default textclassifier is always provided by
   config_servicesExtensionPackage (i.e. ExtServices)
2. OEM can specify a system text classifier by specifying
   config_defaultTextClassifierPackage.
3. System text classifiers can get an instance of the default textclassifier
   by calling TCS.getDefaultTextClassifierImplementation(), so that
   they can add their customization on top of the default TCS.
4. If config_systemTextClassifierPackage is set, the specified package
    is used to process requests from apps and the platform. Otherwise,
   the default textclassifier is used.
5. For testing and droidfooding purpose, text classifier service package
   can be overridden. If the overridden package is neither
   the default one nor the system one, the package is considered as a
   untrusted text classifier, which can only see requests from itself.

Test: m mts && mts-tradefed run mts-extservices
Test: Not setting config_defaultTextClassifierPackage. Select some text and
      make sure smart selection works. Run dumpsys textclassification
      to make sure the default TCS is bound.
Test: Setting config_defaultTextClassifierPackage and repeat the above.
      Make sure the specified OEM text classifier is used.
Test: Set the service override config to be ExtServices.
      Run dumpsys textclassification to make sure everything is unbound.
      Select some text and make sure ExtServices is bound.
Test: Set the service override to be AiAi and repeat the above.
Test: Set the service to be something invalid and repeat the above.
      Observe that no TC is bound and fallback to NO_OP.

BUG: 148049185

Change-Id: Ia2fb549fda49363e0d0ebc4b7e0d31cb76e11ee0
Make TCS.getDefaultTextClassifierImplementation returns a ...
SystemTextClassifier that is backed by ExtServices

1. The default textclassifier is always provided by
   config_servicesExtensionPackage (i.e. ExtServices)
2. OEM can specify a system text classifier by specifying
   config_defaultTextClassifierPackage.
3. System text classifiers can get an instance of the default textclassifier
   by calling TCS.getDefaultTextClassifierImplementation(), so that
   they can add their customization on top of the default TCS.
4. If config_systemTextClassifierPackage is set, the specified package
    is used to process requests from apps and the platform. Otherwise,
   the default textclassifier is used.
5. For testing and droidfooding purpose, text classifier service package
   can be overridden. If the overridden package is neither
   the default one nor the system one, the package is considered as a
   untrusted text classifier, which can only see requests from itself.

Test: m mts && mts-tradefed run mts-extservices
Test: Not setting config_defaultTextClassifierPackage. Select some text and
      make sure smart selection works. Run dumpsys textclassification
      to make sure the default TCS is bound.
Test: Setting config_defaultTextClassifierPackage and repeat the above.
      Make sure the specified OEM text classifier is used.
Test: Set the service override config to be ExtServices.
      Run dumpsys textclassification to make sure everything is unbound.
      Select some text and make sure ExtServices is bound.
Test: Set the service override to be AiAi and repeat the above.
Test: Set the service to be something invalid and repeat the above.
      Observe that no TC is bound and fallback to NO_OP.

BUG: 148049185

Change-Id: Ia2fb549fda49363e0d0ebc4b7e0d31cb76e11ee0
2020-02-04 20:36:52 +00:00
Andrii Kulian
e11e951f66 Merge changes from topic "add_bundle_to_window_context"
* changes:
  Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b
  Add bundle options to Context#createWindowContext API
2020-01-31 01:16:34 +00:00
Andrii Kulian
ea325634d3 Add bundle options to Context#createWindowContext API
Add Bundle parameter to createWindowContext method to allow
passing window-related options.

Bug: 128338354
Test: Build, auto test
Change-Id: I19cf9335068ecf94c9d94a99be0e8f1021f78e34
2020-01-28 17:52:57 -08:00
Dmitri Plotnikov
d55a387f78 Add async version of getProviderMimeType
Fixes: b/147646960
Test: atest FrameworksCoreTests:android.content.ContentResolverTest

Change-Id: I04c15ac008fe14b215f954af150226dc94f22232
2020-01-28 17:35:45 -08:00
Andrii Kulian
4a31697319 Introduce WindowContext API
Test: atest WmTests CtsWindowManagerDeviceTestCases
Bug: 128338354
Change-Id: I9c9dfc5e7f4edd4c968e60d2ffcbb19b5c72a853
2020-01-22 18:30:29 -08:00
Anton Hansson
a46c453773 Merge "Cleanup framework-all usage" 2019-12-18 10:21:23 +00:00
Anton Hansson
6fb18bbfdb Cleanup framework-all usage
It generally shouldn't be depended on. Only by droidstubs for
modules.

Bug: 137191822
Test: m
Change-Id: I16e672aaae80d8bcce25e46c34984797740aae1b
2019-12-18 07:03:15 +00:00
Felka Chang
0d824d4161 Add the root of crates by Context.getCrateDir
Context.getCrateDir() creates and returns the File for the
root of the crates for the application context. Any child directories
under the crates root in Context.getDataFile() is called
the crate directory.

For example:
  /data/user/0/com.exmaple.app/crates/IAmCratedFolder/decentFiles
  /data/user/0/com.exmaple.app/crates/IAmCratedFolder/decentDirs

Context.getCrateDir return the crate dir
  --> /data/user/0/com.exmaple.app/crates/IAmCratedFolder

The crate dir
  --> IAmCratedFolder
The decent directories or files are not crated folders
  --> decentFiles, decentDirs

Test: atest CtsOsTestCases:android.os.storage.cts.StorageCrateTest
Bug: 141660526
Change-Id: If3ec1e121fb8f72bab5571d6190378e3ae208832
2019-12-16 09:52:12 +08:00
Artur Satayev
6aa25ec97d Add new UnsupportedAppUsage annotation as lib dependency.
Bug: 145132366
Test: m
Change-Id: Ibb7f8424186149365354a96249c06c9fccde66bd
2019-12-11 18:18:18 +00:00
Peter Wang
7701f57250 [Telephony Mainline] Exposed sendOrderedBroadcast
with appOp as String and options as Bundle

Bug: 139077993
Test: Build, GsmInboundSmsHandlerTest, CdmaInboundSmsHandlerTest and WapPushOverSmsTest
Change-Id: I60e21c7202d1bc7c5d28dfad2e2edde902f28a15
2019-11-27 15:20:42 -08:00
Jeff Sharkey
e9fe152f31 Extend insert/update/delete to provide extras.
A few releases ago we added ContentResolver.QUERY_ARG_* constants
to query() as a new best-practice that will help wean us off raw
SQL arguments.  (For example, a provider could add their own
custom arguments like QUERY_ARG_INCLUDE_PENDING to cause the query
to reveal pending items that would otherwise be hidden.)  This
change expands update() and delete() to accept those arguments.

This change also expand insert() to accept extras too, as part of
preparing to support an upcoming MediaProvider feature that will let
apps place new media "adjacent" to an existing media item.  (Sending
that adjacent item through extras is cleaner than trying to send it
through escaped query parameters.)

Bug: 131643582
Test: atest CtsContentTestCases
Change-Id: I436296155b9b5f371b4cbe661feaf42070285fcc
2019-11-15 13:46:31 -07:00
Jeff Sharkey
03263747d8 Merge "Allow sending of bulk Uri change notifications." 2019-11-14 03:48:02 +00:00
Jeff Sharkey
1307f428af Allow sending of bulk Uri change notifications.
MediaProvider makes heavy use of Uri change notifications, which
currently need to be delivered one at a time through the Binder
interface.  To optimize this, allow callers to provide a collection
of multiple Uris to notify with a single Binder call.

Bug: 134170767
Test: atest cts/tests/tests/content/src/android/content/cts/ContentResolverTest.java
Change-Id: Ifef778e88bb772b5580f70929c6f2e9c166d1c0e
2019-11-13 18:17:02 -07:00
atrost
56dea3a7cc resolve merge conflicts of 8e8c40b5c262cc8fb88c44953547fecf58e495b0 to master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ia3ee4dce9639f9b66a44828f28c1fa7cd645dfe5
2019-11-13 17:21:20 +00:00
atrost
1a9455046c Move android.compat.annotation package out of libcore
Test: m + flash
Bug: 142650523
Change-Id: I1321195c8724485a90b162b32c3c8549dbd11c42
2019-11-11 15:10:57 +00:00
Meng Wang
3f9e036f11 System API: Context#registerReceiverForAllUsers
Bug: 141193711
Test: make
Change-Id: Ie692d2ac27474b9fe11f5548bc504aa00c5ad53c
2019-11-07 15:03:13 -08:00
Jordan Liu
08a94a2236 Merge "Expose Context.sendOrderedBroadcast with appop" 2019-11-04 19:59:28 +00:00
Jiyong Park
d60c0eaebc Merge "android.test.mock is built with much less number of sources" am: f0b9dfc0b1 am: a321a944ea
am: dcfd8ddce7

Change-Id: I67d7d2e9e490fd71c472e38e105c8fcfcb17df60
2019-11-02 01:27:25 -07:00
Jordan Liu
a32e6fcb03 Expose Context.sendOrderedBroadcast with appop
Bug: 143100231
Test: atest ContextTest#testSendOrderedBroadcastWithAppOp
      atest ContextTest#testSendOrderedBroadcastWithAppOp_NotGranted

Change-Id: Ia75d0db11f337769eaf3cf5436e09a7d38b0564c
Merged-In: Ia75d0db11f337769eaf3cf5436e09a7d38b0564c
2019-11-01 16:25:15 -07:00
Jordan Liu
54735539fb Expose Context.sendOrderedBroadcast with appop
Bug: 143100231
Test: atest ContextTest#testSendOrderedBroadcastWithAppOp
      atest ContextTest#testSendOrderedBroadcastWithAppOp_NotGranted

Change-Id: Ia75d0db11f337769eaf3cf5436e09a7d38b0564c
2019-11-01 14:01:09 -07:00
Jiyong Park
00ea0b1f91 android.test.mock is built with much less number of sources
android.test.mock is built with its own sources plus a small number of
framework sources that provides private APIs that the library's APIs
have references to. Previously, it was built with the entire framework
sources which is too many and should have slowed the build performance.

Bug: 141149570
Test: m
Change-Id: I165ffdfc053a71b323ef7058651d5908df06870f
2019-10-31 20:38:47 +09:00
Philip P. Moltmann
128b70364e Note with featureId from ContentProvider
This takes the Context#getFeatureId from the calling context and pipes
it all way through to the noteOp calls done by the content provider.

Bug: 136595429
Test: atest CtsAppOpsTestCases (new test added to capture this case)
            TelecomUnitTests:CallLogManagerTest
	    ContentProviderClientTest
	    TelecomUnitTests:MissedCallNotifierImplTest
	    TelecomUnitTests:BasicCallTests
	    MediaInserterTest
	    PreferencesHelperTest
	    RankingHelperTest
	    PinnedSliceStateTest
	    FrameworksCoreTests:ContentResolverTest
Change-Id: I53b1035626229c920b353509a5bece157b52fb51
2019-10-29 15:41:28 -07:00
Makoto Onuki
e5449f0b34 Explicitly take flags in createContextAsUser()
Bug: 142472686
Test: atest android.content.cts.ContextTest#testCreateContextAsUser
Change-Id: Id2e3d5ffe5887a4916e0872a7e85d62cbb439744
2019-10-14 11:09:00 -07:00
Makoto Onuki
b844001d6a Add Context.createContextAsUser()
Without it, apps (mainline modules) will need to use createPackageContext...,
which is a bit painful.

Bug: 142472686
Test: atest android.content.cts.ContextTest#testCreateContextAsUser
Change-Id: Id640e03862462724df1a4a3101f0b08faafba22f
2019-10-10 15:58:20 +00:00
Jiyong Park
acac2c9174 Merge changes Iea1d2ae2,I1d3c8e48 am: d708ea7b4a am: ebde74e7b1 am: fd4c08b689
am: 4de7f5eaac

Change-Id: Icf780d431f0dd596eee4d07ed26f33f5e0819ed9
2019-09-23 15:45:09 -07:00
Jiyong Park
0d94fae8ac Merge "Use filter_packages to unbunden metalava" am: 385291c36d am: 14698c6e71 am: 382aaf00de
am: a02ab098db

Change-Id: I2d43dcd8190966610e874775024a5b83e262f751
2019-09-19 07:10:14 -07:00
Jiyong Park
b1d2701f76 Build java_sdk_libraries with much less sources
This change fixes a regression that java_sdk_libraries under
frameworks/base were built with all framework sources.

Bug: 141149570
Test: m
Change-Id: Iea1d2ae20ca1c5b514a52d8b2a22e8a1d7543efd
2019-09-17 23:17:47 +09:00
Jiyong Park
ae9972bda4 Use filter_packages to unbunden metalava
This change fixes a problem that entire framework source files are given
to metalava even when many of the source files are not for public. Using
the new property filter_packages, only source files that belongs to the
public packages are given to metalava.

This CL also changes the name of the filegroup 'framework-srcs' to
'framework-non-updatable-sources' to better describe its contents. In
addition, a build-time only library 'framework-all' is introduced. This
library produces a header jar for all framework sources for both
non-updatable and updatable parts. It is put to the classpath when
invoking metalava to give information on the hidden classes that were
filtered-out.

Bug: 140764681
Test: m
Change-Id: I6e16679109ac07820e35037754d4327442c014f2
2019-09-16 13:12:59 +09:00
Jiyong Park
5366ea2089 Cut the dependency to framework from droiddoc modules
droiddoc modules for the SDK API documentation and stubs library
generations have depended on the 'framework' (which was recently changed
to framework-minus-apex' module to get the list of Java source files to
be processed.

This however caused a circular dependency when we tried to modularize
some classes in the framework library as a separate library. The
separate java library depended on the stubs library (because it should
only use SDK APIs) and the stubs library depended on the framework
library. The framework library itself depended on the separated library
(or its stub) to use APIs from the separated library, thus forming a
circular dependency.

This change fixes the problem by directly giving the framework source
files via a filegroup `framework-sources-to-document` where all Java
and AIDL files that are to be documented are included in.

This change also put the generated R.java and Manifest.java files from
framework-res into the filegroup for framework sources.

Bug: 70046217
Bug: 135922046
Test: m

Exempt-From-Owner-Approval: Approved internally
Merged-In: I09ad88da47540d31ad089aad5e1151a4b6877ec2
(cherry picked from commit 20426538f85098552f52dffb40d0f7ffff7946d4)
Change-Id: I09ad88da47540d31ad089aad5e1151a4b6877ec2
2019-08-30 05:14:08 +00:00
Jiyong Park
20426538f8 Cut the dependency to framework from droiddoc modules
droiddoc modules for the SDK API documentation and stubs library
generations have depended on the 'framework' (which was recently changed
to framework-minus-apex' module to get the list of Java source files to
be processed.

This however caused a circular dependency when we tried to modularize
some classes in the framework library as a separate library. The
separate java library depended on the stubs library (because it should
only use SDK APIs) and the stubs library depended on the framework
library. The framework library itself depended on the separated library
(or its stub) to use APIs from the separated library, thus forming a
circular dependency.

This change fixes the problem by directly giving the framework source
files via a filegroup `framework-sources-to-document` where all Java
and AIDL files that are to be documented are included in.

This change also put the generated R.java and Manifest.java files from
framework-res into the filegroup for framework sources.

Bug: 70046217
Bug: 135922046
Test: m

Change-Id: I09ad88da47540d31ad089aad5e1151a4b6877ec2
2019-08-29 07:44:38 +09:00
Jiyong Park
7e1339e055 Use filegroup to simplify Android.bp for frameworks and its friends
Java and AIDL source files under frameworks/base are now modularized
using filegroup. Each filegroup has 'path' property set to the base
directory of the ssource files. This allows us to not rely on
aidl.[local_]include_dirs and srcs_lib_whitelist_dirs to get the base
directories.

Bug: 70046217
Test: m
Exempt-From-Owner-Approval: Approved internally
Merged-In: I0705ddf76b3c628127f65d75e0a8b06c6c250fe2
(cherry picked from commit b360931bf0f2d011dada18762829c0d0e47c54b6)
Change-Id: I0705ddf76b3c628127f65d75e0a8b06c6c250fe2
2019-08-24 00:04:18 +00:00
Jiyong Park
b360931bf0 Use filegroup to simplify Android.bp for frameworks and its friends
Java and AIDL source files under frameworks/base are now modularized
using filegroup. Each filegroup has 'path' property set to the base
directory of the ssource files. This allows us to not rely on
aidl.[local_]include_dirs and srcs_lib_whitelist_dirs to get the base
directories.

Bug: 70046217
Test: m
Change-Id: I0705ddf76b3c628127f65d75e0a8b06c6c250fe2
2019-08-22 20:07:38 +09:00
Makoto Onuki
62242c48e0 Introduce framework-minus-apex and create jobscheduler-framework.jar
Bug: 137763703
Test: Clean local build + "flash -w" and boot
Test: Presubmit
Test: atest CtsJobSchedulerTestCases
Test: ./cts/tests/signature/runSignatureTests.sh
Change-Id: Ie2a5a7a17f903ac18de0bcdde5be25311a62fa01
2019-08-12 18:11:57 +00:00
Jeff Sharkey
9edef25ede Detailed ContentProvider permissions checks.
The new MediaProvider design has an internal dynamic security model
based on the value stored in OWNER_PACKAGE_NAME, so the OS always
needs to consult the provider when resolving Uri permission grants.

Blocking calls from the system process like this are typically
discouraged, but this is the best we can do with the limited time
left, and there is existing precident with getType().

For now, use "forceUriPermissions" as a proxy for determining when
we need to consult the provider directly.

Bug: 115619667
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Change-Id: I1d54feeec93fbb4cf5ff55240ef4eae3a35ed068
2019-07-12 09:27:41 -06:00
Nate Myren
d3a6385686 Permission flag updates now notify listeners
Added a version of the onPermissionUpdated and
onInstallPermissionUpdated methods which will notify
OnPermissionChangedListeners, and added this to the
PermissionManagerService "updatePermissionFlags" and
"updatePermissionFlagsForAllApps" methods. Also adds
OnPermissionsChangedListener to @TestApi

Fixes: 135937566
Test: atest PermissionUpdateListenerTest
Change-Id: I906598c366234c3daaa202261678bca04837cb13
2019-06-28 16:56:26 +00:00
Paul Duffin
48cce27632 Merge "Export some api files for use by cts/tests/signature tests" am: 0a45ac2928
am: b5d6cc540c

Change-Id: If5179d1403e99ac2008cfeb89046eb486263817c
2019-06-03 08:15:50 -07:00
Paul Duffin
cd35de3507 Export some api files for use by cts/tests/signature tests
Creates a filegroup for each of these files:
* api/current.txt
* api/system-current.txt
* api/system-removed.txt
* test-base/api/current.txt
* test-mock/api/current.txt
* test-runner/api/current.txt

Bug: 122332514
Test: atest -p cts/tests/signature
Change-Id: Ib031dcc39d3c1cca6dcdf977c0277d5e4875591e
2019-06-03 11:56:35 +01:00
Svet Ganov
d8eb8b2690 Restricted permission mechanism - framework
This change adds a mechanism for restricting permissions (only runtime
for now), so that an app cannot hold the permission if it is not white
listed. The whitelisting can happen at install or at any later point.

There are three whitelists: system: OS managed with default grants
and role holders being on it; upgrade: only OS puts on this list
apps when upgrading from a pre to post restriction permission database
version and OS and installer on record can remove; installer: only
the installer on record can add and remove (and the system of course).

Added a permission policy service that sits on top of permissions
and app ops and is responsible to sync between permissions and app
ops when there is an interdependecy in any direction.

Added versioning to the runtime permissions database to allow operations
that need to be done once on upgrade such as adding all permissions held
by apps pre upgrade to the upgrade whitelist if the new permisison version
inctroduces a new restricted permission. The upgrade logic is in the
permission controller and we will eventually put the default grants there.

NOTE: This change is reacting to a VP feedback for how we would handle
SMS/CallLog restriction as we pivoted from role based approach to roles
for things the user would understand plus whitelist for everything else.
This would also help us roll out softly the storage permisison as there
is too much churm coming from developer feedback.

Exempt-From-Owner-Approval: trivial change due to APi adjustment

Test: atest CtsAppSecurityHostTestCases:android.appsecurity.cts.PermissionsHostTest
Test: atest CtsPermissionTestCases
Test: atest CtsPermission2TestCases
Test: atest RoleManagerTestCases

bug:124769181

Change-Id: Ic48e3c728387ecf02f89d517ba1fe785ab9c75fd
2019-04-07 22:39:54 -07:00
wilsonshih
5db7b39dd8 Add Shell permission for CTS test.
Add Shell permission for new CTS tests to test the multi-display
functionality in WallpaperService/WallpaperManagerService.

Bug: 123707989
Test: atest WallpaperManagerMultiDisplayTests
Test: atest ActivityManagerMultiDisplayTests

Change-Id: Id97db050a0b9d1940c2dfaa793fbe526df578105
2019-03-22 09:13:10 +08:00
Bo Liu
58a57667e4 Add Context.bindService with executor parameter
Allow app to control the thread where ServiceConnection methods are
called on.

Bug: 111434506
Test: Used new bindContext method in chrome and checked callbacks
are on the correct thread.

Change-Id: I480e5bd6773a530fb9e8e73e3a2a2a88b76569ec
2019-03-06 20:21:45 +00:00
Paul Duffin
eec4726e3c Merge "Revert "Revert "Remove legacy-test and legacy-android-test targets""" am: e051b0c95e am: 643318f4d2
am: a8025a851d

Change-Id: Ibe9fce04c43c435764c313f64bf49e03fa826012
2019-02-26 04:16:34 -08:00
Paul Duffin
e051b0c95e Merge "Revert "Revert "Remove legacy-test and legacy-android-test targets""" 2019-02-26 10:59:54 +00:00
Paul Duffin
79d7ba2773 Revert "Revert "Remove legacy-test and legacy-android-test targets""
Fixes up the android.test.legacy target to stop using sources directly
now that the issue with android.test.runner-minus-junit not being able
to be built against the SDK has been resolved.

Also, fixes a couple of comments.

This reverts commit 7d7af10dc9057a49c617c7c97c174e8b4ec5008c.

Reason for revert: When this was originally applied it broke the
pi-dev-plus-aosp branch as it contained references to these targets.
Those references have now been removed.

Bug: 63127064
Change-Id: I619e92faf4cc38f8fd4f053bde832e9a76a2a2bf
Test: make checkbuild
2019-02-25 19:20:10 +00:00
Wale Ogunwale
691af68a3c Added some TestApi that are already used by CTS
Allows us to remove the use of private platform API from CTS.

Bug: 124134247
Test: builds
Change-Id: Iceb81ff7c9385e877d2612fbb7b506245d116928
2019-02-21 20:15:56 -08:00
Svet Ganov
c2841ec7fe Allow UiAutomation to adopt the shell permission indentity
For testing we often need to run shell commands. This can be done
today via running a shell command from an instrumentation test
started from the shell. However, this requires adding shell commands
which are not in the API contract, involve boilerplate code, require
string parsing, etc.

This change allows an instrumentation started from the shell to
adopt the shell UID permission state. As a result one can call APIs
protected by permissions normal apps cannot get by are granted to
the shell. This enables adding dedicated test APIs protected by
signatures permissions  granted to the shell.

Test: cts-tradefed run cts-dev -m CtsUiAutomationTestCases
          -t android.app.uiautomation.cts.UiAutomationTest#testAdoptShellPermissions

bug:80415658

Merged-In: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
Change-Id: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
2019-02-21 19:59:14 +00:00