113 Commits

Author SHA1 Message Date
Sundong Ahn
e933cedf83 Build android.test.* with java_sdk_library
android.test.* are built with java_sdk_library and api files are added
by running "make update-api".

android.test.base_static is created for allowing to use
android.test.base as a static library.

Bug:77577799
Test: make -j
Test: make checkapi
Test: make checkapi fails with a random change in the txt file
Test: adb shell cmd package list libraries |\
      grep android.test.*
      And check the android.test.* libraries

Merged-In: Ia27612657532e50b077a9c55dbef59ee3ec04b8a
Change-Id: Ia27612657532e50b077a9c55dbef59ee3ec04b8a
2018-08-29 12:22:59 +09:00
Aurimas Liutikas
f0764b5c46 Deprecate Resources#getMovie()
Movie class has been deprecated, deprecate the getMovie as well.

Bug: 113054577
Test: None
Change-Id: Ic217adc002c7cfbe795e855689af1a58447b7d39
2018-08-22 13:13:07 -07:00
Sundong Ahn
f24779c8c7 Build android.test.* with java_sdk_library
android.test.* are built with java_sdk_library and api files are added
by running "make update-api".

android.test.base_static is created for allowing to use
android.test.base as a static library.

Bug:77577799
Test: make -j
Test: make checkapi
Test: make checkapi fails with a random change in the txt file
Test: adb shell cmd package list libraries |\
      grep android.test.*
      And check the android.test.* libraries

Change-Id: Ia27612657532e50b077a9c55dbef59ee3ec04b8a
2018-08-16 12:16:28 +09:00
Philip P. Moltmann
6c644e620d Always review permissions before <M app is started the first time
This splits the
- review permissions
- individually control permissions
- consent to manage wireleess (wifi + bluetooth)
properties.

Almost all code cares only for the first and it is now always true.
Hence a lot of code can be simplified.

Bug: 110431654
Test: atest PermissionsHostTest
      started pre-M app
Change-Id: I733cd476ccd0bf5eaa59e9a9506db34f57c6baee
2018-07-24 11:45:34 -07:00
David Brazdil
f8d22dec87 resolve merge conflicts of 6e3c86c8ed7a1bcfcbc63bbded0043d4b4efbe10 to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ide3c4e229b47e4242cacafc04b70d8b392712cc8
2018-07-11 11:56:34 +01:00
David Brazdil
6e3c86c8ed Merge "Compile android.test.*.stubs into dex" 2018-07-11 09:18:15 +00:00
Colin Cross
a977a37c85 Merge "Mark installable jars with installable: true" am: 1035f48f61 am: 19609a7993
am: c7f9e053ec

Change-Id: I5934f14ced4a89fa234d75fde733aae1f102cc7a
2018-07-10 09:45:03 -07:00
Colin Cross
19609a7993 Merge "Mark installable jars with installable: true"
am: 1035f48f61

Change-Id: Ia3176e68ddd7cfdb8351b2a0ea95efc9dd94d922
2018-07-10 09:12:46 -07:00
David Brazdil
89c6432dbf Compile android.test.*.stubs into dex
Adjust the build rules of android.test.*.stubs packages to also
produce a jar with dex files. This will be used by the `hiddenapi`
tool to categorize the boot class path equivalents as public API.

Bug: 79409988
Test: m android.test.base.stubs ; check javalib.jar contains dex
Merged-In: I1d0850b18044c559ea4b9893d929dc45884b32c3
Change-Id: Ief28cd5e6d0cdd58f22fab751e0173ccf8c69a0c
2018-07-10 13:37:05 +00:00
David Brazdil
a2c457fd2a Compile android.test.*.stubs into dex
Adjust the build rules of android.test.*.stubs packages to also
produce a jar with dex files. This will be used by the `hiddenapi`
tool to categorize the boot class path equivalents as public API.

Bug: 79409988
Test: m android.test.base.stubs ; check javalib.jar contains dex
Change-Id: I1d0850b18044c559ea4b9893d929dc45884b32c3
2018-07-10 14:34:52 +01:00
Colin Cross
a12c0f506c Mark installable jars with installable: true
Most jars don't need to be installed on the device.  Instead of
using java_library and java_library_static to distinguish between
them make java_library and java_library_static identical and use
installable: true to identify the few jars that need to be dexed
and installed on the device.

Bug: 110885583
Test: m checkbuild
Change-Id: I579da7c1a712ec4fb49e288e7f3ab369cb75baf4
2018-06-27 11:49:44 -07:00
Tyler Gunn
84dad9565f Require READ_CALL_LOG permission to see phone numbers in phone state.
Incoming and outgoing call phone numbers are visible in the phone state
broadcast and via the PhoneStateListener.  To enhance user privacy, change
to require the READ_CALL_LOG permission in order to receive the call
phone numbers.

This means to see phone numbers:
1. android.intent.action.PHONE_STATE - requires READ_PHONE_STATE and
READ_CALL_LOG permission.
2. PhoneStateListener#onCallStateChanged - now required READ_CALL_LOG
permission.

To support this new behavior, added sendBroadcastAsUserMultiplePermissions
method to context to allow sending the broadcast to all users while
requiring the two permissions.

Bug: 78650469
Test: Created PHONE_STATE broadcast receiver in test app and verified that
when no permissions are granted, the phone number is empty for incoming
and outgoing calls.
Test: Granted Phone state permission to test app and verified that phone
number is not populated.
Test: Granted test app read call log permission and verified that phone
number is populated.
Test: Created PhoneStateListener in test app and verified that when no
permissions are granted, phone number is empty for incoming and outgoing.
calls.
Test: Granted read call log permission to test app and verified that both
the incoming and outgoing numbers are populated.

Change-Id: I857ea00cc58a0abbb77960643f361dd6dd9c8b56
2018-05-18 14:37:43 -07:00
Tyler Gunn
b02996cb14 Merge "Require READ_CALL_LOG permission to see phone numbers in phone state." into pi-dev am: 7f556daa41
am: d6aef2176f

Change-Id: Id4b1f204061f6c7f6c12c2faa392015ade4c4b7f
2018-05-01 13:52:35 -07:00
Tyler Gunn
d6aef2176f Merge "Require READ_CALL_LOG permission to see phone numbers in phone state." into pi-dev
am: 7f556daa41

Change-Id: Icd641707eef832fd5f3d393c64ce9b3483770e9d
2018-05-01 13:41:49 -07:00
Tyler Gunn
f955e56d51 Require READ_CALL_LOG permission to see phone numbers in phone state.
Incoming and outgoing call phone numbers are visible in the phone state
broadcast and via the PhoneStateListener.  To enhance user privacy, change
to require the READ_CALL_LOG permission in order to receive the call
phone numbers.

This means to see phone numbers:
1. android.intent.action.PHONE_STATE - requires READ_PHONE_STATE and
READ_CALL_LOG permission.
2. PhoneStateListener#onCallStateChanged - now required READ_CALL_LOG
permission.

To support this new behavior, added sendBroadcastAsUserMultiplePermissions
method to context to allow sending the broadcast to all users while
requiring the two permissions.

Bug: 78650469
Test: Created PHONE_STATE broadcast receiver in test app and verified that
when no permissions are granted, the phone number is empty for incoming
and outgoing calls.
Test: Granted Phone state permission to test app and verified that phone
number is not populated.
Test: Granted test app read call log permission and verified that phone
number is populated.
Test: Created PhoneStateListener in test app and verified that when no
permissions are granted, phone number is empty for incoming and outgoing.
calls.
Test: Granted read call log permission to test app and verified that both
the incoming and outgoing numbers are populated.

Change-Id: I857ea00cc58a0abbb77960643f361dd6dd9c8b56
2018-04-27 08:44:07 -07:00
Jiyong Park
3fb224521a Make android.test.mock.stubs in Android.bp
Stubs libraries android.test.mock.stubs and
android.test.mock.stubs-system are now built in Android.bp.
(Note that API check and update are still done in Android.mk)

As a good side effect, this allows android.test.runner[-minus-junit]
libraries (that are defined in Android.bp) to be built with the
android.test.mock.stubs instead of the runtime library
android.test.mock. This in turn allows us to prevent java:sdk ->
java:platform dependency also in Soong, because the runner libraries
were the only violators.

Bug: 73829976
Test: m -j android.test.mock.stubs android.test.mock.stubs-system
Test: m -j checkapi
Test: m -j update-api
Merged-In: I830a8eb13aa43b9aa4c8394f3c2fd91ee18b1f85
Change-Id: I830a8eb13aa43b9aa4c8394f3c2fd91ee18b1f85
(cherry picked from commit e649b8066c3385ba0b667a79d378402b15ef3127)
2018-04-13 11:21:54 +09:00
Jiyong Park
8f2df8a94f Don't build android.test.mock.stubs for unbundled builds
Unbundled builds use the prebuilt libs in /prebuilts/sdk/current and
system_current.

Bug: 73829976
Test: m -j ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk

Merged-In: I61fe0d671778595f49be82d7c11caffc411f58a3
Change-Id: I61fe0d671778595f49be82d7c11caffc411f58a3
(cherry picked from commit ea93a9ebc22d2685ecc94b0a51175ec7c6eb7d05)
2018-03-30 14:57:23 +09:00
Jiyong Park
6964add112 Make android.test.mock.stubs in Android.bp
Stubs libraries android.test.mock.stubs and
android.test.mock.stubs-system are now built in Android.bp.
(Note that API check and update are still done in Android.mk)

As a good side effect, this allows android.test.runner[-minus-junit]
libraries (that are defined in Android.bp) to be built with the
android.test.mock.stubs instead of the runtime library
android.test.mock. This in turn allows us to prevent java:sdk ->
java:platform dependency also in Soong, because the runner libraries
were the only violators.

Bug: 73829976
Test: m -j android.test.mock.stubs android.test.mock.stubs-system
Test: m -j checkapi
Test: m -j update-api
Merged-In: I830a8eb13aa43b9aa4c8394f3c2fd91ee18b1f85
Change-Id: I830a8eb13aa43b9aa4c8394f3c2fd91ee18b1f85
(cherry picked from commit e649b8066c3385ba0b667a79d378402b15ef3127)
2018-03-30 14:57:11 +09:00
Jiyong Park
ea93a9ebc2 Don't build android.test.mock.stubs for unbundled builds
Unbundled builds use the prebuilt libs in /prebuilts/sdk/current and
system_current.

Bug: 73829976
Test: m -j ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk

Change-Id: I61fe0d671778595f49be82d7c11caffc411f58a3
2018-03-23 20:25:18 +09:00
TreeHugger Robot
8555e50c1f Merge "Make android.test.mock.stubs in Android.bp" 2018-03-23 07:15:30 +00:00
Suprabh Shukla
075541707a Merge "APIs to suspend packages with SUSPEND_APPS permission" into pi-dev am: 6affc07065
am: 31b5990893

Change-Id: Ib95745ca26362a9624b704b217b4d9078d0ade7c
2018-03-23 01:17:09 +00:00
Jiyong Park
e649b8066c Make android.test.mock.stubs in Android.bp
Stubs libraries android.test.mock.stubs and
android.test.mock.stubs-system are now built in Android.bp.
(Note that API check and update are still done in Android.mk)

As a good side effect, this allows android.test.runner[-minus-junit]
libraries (that are defined in Android.bp) to be built with the
android.test.mock.stubs instead of the runtime library
android.test.mock. This in turn allows us to prevent java:sdk ->
java:platform dependency also in Soong, because the runner libraries
were the only violators.

Bug: 73829976
Test: m -j android.test.mock.stubs android.test.mock.stubs-system
Test: m -j checkapi
Test: m -j update-api
Change-Id: I830a8eb13aa43b9aa4c8394f3c2fd91ee18b1f85
2018-03-23 09:47:56 +09:00
TreeHugger Robot
6affc07065 Merge "APIs to suspend packages with SUSPEND_APPS permission" into pi-dev 2018-03-22 22:15:31 +00:00
Suprabh Shukla
021b57ab8d APIs to suspend packages with SUSPEND_APPS permission
Changed the existing hidden api setPackagesSuspendedAsUser to a system
api setPackagesSuspended that can be called by apps with either
MANAGE_USERS or SUSPEND_APPS permission. Additionally, the suspending
app can now specify optional extra information meant to be used by the
suspended apps and the launcher to deal with this state.

The following other APIs are added:
 - isPackageSuspended(): Apps can query whether they are in a suspended
 state
 - @SystemApi getPackageSuspendedAppExtras(String): Apps with permission
 SUSPEND_APPS can get the appExtras passed to PM when suspending the
 app.
 - @SystemApi setPackageSuspendedAppExtras(String, PersistableBundle):
 Apps with permission SUSPEND_APPS can update app extras for a
 suspended package.
 - getPackageSuspendedAppExtras(): Apps can call to get the appExtras
 passed in to PM when they were suspended.

Test: Can be run via:
atest com.android.server.pm.PackageManagerSettingsTests
atest com.android.server.pm.PackageUserStateTest
atest com.android.server.pm.SuspendPackagesTest

Bug: 74336673
Change-Id: I3b9ed2c8478b34ee2e8986f5f5fddb2839d102e3
2018-03-22 12:59:57 -07:00
TreeHugger Robot
8e8eb51f72 Merge "Remove unused jarjar rule file for the test mock library" 2018-03-21 19:04:24 +00:00
Philip P. Moltmann
18e3eb8168 Add SoundTriggerDetectionService
The service is meant to replace the PendingIntent based API. Once all
users of the PendingIntent based API switched the PendingIntent based API
will be removed.

To have as little as possible impact on the whole SoundTrigger framework
the RemoteSoundTriggerDetectionService class implements the same
interface as the PendingIntent based class. Hence the exising code has
very little change. Further once the old code can be removed the amount
of changed (and added) code is limited.

The RemoteSoundTriggerDetectionService -> SoundTriggerDetectionService
is a vanilla as possible service implementation. The special behaviors
are:
- The system holds a wakelock while service operations are in progress
and the service is bound as foreground. Hence the service can e.g.
listen to the microphone.
- Service operations have a certain amount of time they are allowed to
run. Once every operation is either finished or the the operation
exceeded the allotted time, the system calls onStopOperation for each
still pending operation. This is a similar model as for the commonly
used JobService.
  Please note that if the time allowed for an operation is 15s and
op1 was run as 0si, and op1 was run at 5s, the service is allowed to run
until 20s. Hence _both_ onStopOperations will happen at 20s. This is
done for ease of implementation but should not give the service more
power than calling onStopOperation exactly 15s after each operation is
triggered.
- If an operation is done before the allotted time is reached, the
service can declare the operation as finished manually by calling
onOperationFinished. This is a call back into the system, hence a
'client' binder is sent to the service. If the operation is finished
by calling this method onStopOperation will not be called.
- As the service instance might be killed and restored between
operations we add a opaque bundle 'params' to each operations. The users
of the API can use this to send data from the start command to the
operations. It can also just be set to null. The params are not meant to
store changing state in between operations. Such state needs to be
persisted using the regular methods (e.g. write it to disk)
- A service can be used for multiple recognition sessions. Each
recognition is uniquelity defined by its sound model UUID. Hence each
operation gets at least tree arguments: Operation ID, sound mode UUID, params
- As a small optimization the params are cached inside of the service
instance.

The time allowed for each operation is in a @SystemAPI global setting,
so the service can make sure it finishes the operations before they are
stopped. It might take some time to deliver the operations via the
binder, hence it is not recommended to try to use every last ms of
allotted time.

Test: atest SoundTriggerDetectionServiceTest (added in separate CL)
      atest android.provider.SettingsBackupTest
Change-Id: I47f813b7a5138a6f24732197813a605d29f85a93
Fixes: 73829108
2018-03-20 13:57:14 -07:00
Jiyong Park
7680a17d07 Remove unused jarjar rule file for the test mock library
bedfae98011075935cd3e49b8ff8f241b2f3ba81 removed the repackaged test
mock library but left the jarjar rule file used to build the lib.
Removing the leftover.

Test: m -j

Change-Id: I9e3d65ff2801af3fb363c1608c14734bca9d9434
2018-03-21 01:21:15 +09:00
Paul Duffin
bedfae9801 Remove repackaged.android.test.mock
The repackaged.android.test.mock uses internal APIs so cannot be built
against the SDK which means that anything that depends on it cannot
guarantee to run if those internal APIs change.

That library was built because the classes in
repackaged.android.test.runner depend on them. However, the
repackaged.android.test.runner library is only used by the
cts-api-signature-test target and it does not use any android.test.mock
classes directly, or indirectly. Therefore, this simply excludes any
classes from repackaged.android.test.runner that depend on
android.test.mock classes so that repackaged.android.test.mock can be
removed altogether.

Bug: 69899800
Bug: 30188076
Test: make checkbuild
Change-Id: If4528e6a4ec2b08faffd6d413672c5004d85e0a9
2018-02-26 11:57:26 +00:00
Makoto Onuki
2ebb021231 Merge "Shortcut permissions for default text classifier" 2018-02-21 17:22:28 +00:00
Paul Duffin
4cdec67417 Build android.test.base/legacy against SDK
android.test.legacy is now build against SDK, thus available to apps
build with SDK.

In doing so, android.test.mock.stubs had to be built with SDK (because
it is used by android.test.legacy). However, this wasn't trivial.

The problem was that some classes in test-mock implemented abstract
methods of platform classes. Even though they are marked as @hide,
doclava automatically emit them to the stub file because otherwise the
class in the stub file does not implement some abstract methods from its
parent class, which in turn makes the stub file non-compilable.

This CL solves the problem by introducing an adapter class in between
the class in test-mock and the class in the framework. The adapter class
implements abstract methods which are @hide and having reference to
types that aren't available to SDK. The abstract methods are removed
from the original class. Then doclava does not emit the abstract
methods.

Also by @hide'ing the adapter classes, they are not compiled when
building the stub library.

Bug: 30188076
Bug: 73339598
Test: m -j android.test.base
Test: m -j android.test.legacy
Test: m -j android.test.mock.stubs
are successful and do not show link-check warning
Merged-In: I8e432950e693ee3c6f0240852e62da6133d31571
Change-Id: I8e432950e693ee3c6f0240852e62da6133d31571
2018-02-21 15:59:56 +00:00
Makoto Onuki
700feef8a6 Shortcut permissions for default text classifier
- Add two shortcut related permissions as SystemAPI for the default
text classifier.

- The default text classifier package name still comes from the
system resource.

Bug: 73083596
Bug: 71555985
Test: atest CtsPermission2TestCases
Test: Manual test with a test package, with the following in config.xml
<string name="config_defaultTextClassifierPackage" translatable="false">com.example.android.pm.shortcutlauncherdemo</string>

Change-Id: I19081d9d6ba0b33eb25d19aa55b4fe2f26a75897
2018-02-20 12:14:18 -08:00
Paul Duffin
001d87c81f Build android.test.base/legacy against SDK
android.test.legacy is now build against SDK, thus available to apps
build with SDK.

In doing so, android.test.mock.stubs had to be built with SDK (because
it is used by android.test.legacy). However, this wasn't trivial.

The problem was that some classes in test-mock implemented abstract
methods of platform classes. Even though they are marked as @hide,
doclava automatically emit them to the stub file because otherwise the
class in the stub file does not implement some abstract methods from its
parent class, which in turn makes the stub file non-compilable.

This CL solves the problem by introducing an adapter class in between
the class in test-mock and the class in the framework. The adapter class
implements abstract methods which are @hide and having reference to
types that aren't available to SDK. The abstract methods are removed
from the original class. Then doclava does not emit the abstract
methods.

Also by @hide'ing the adapter classes, they are not compiled when
building the stub library.

Bug: 30188076
Bug: 73339598
Test: m -j android.test.base
Test: m -j android.test.legacy
Test: m -j android.test.mock.stubs
are successful and do not show link-check warning
Change-Id: I8e432950e693ee3c6f0240852e62da6133d31571
2018-02-18 21:47:42 +09:00
Paul Duffin
d89c7790e1 Fix visibility issues with android.test.mock.stubs
This ensures that the API definitions for the android.test.mock package
matches the definitions in the api/current.txt file.

Bug: 30188076
Test: make update-api
(cherry-picked from commit bd97e3dd4e5d395f336114016b000ef3cfb26053)

Merged-In: Id325b8cf2f189117ac4cfe7634095ab710eee004
Change-Id: Id325b8cf2f189117ac4cfe7634095ab710eee004
2018-02-18 20:36:35 +09:00
Calin Juravle
1d875ad3ae Add SystemApis to expose runtime profile information
The API allows a system apps which acquired
{@code android.permission.READ_RUNTIME_PROFILE} to snapshot the runtime
profiles of installed packages.

The API is implemented in a new service class (AndroidRuntimeManager)
accessible from the context using
context().getPackageManager().getAndroidRuntimeManager().

The main functionality is exposed as a one way call into the
AndroidRuntimeManager with the result being posted on a callback. The
profile is available to the caller as a read-only ParcelFileDescriptor.

This CL only adds the API interfaces and validation. It does not fully
implement the functionality.

oneway void snapshotRuntimeProfile(in String packageName,
  in String codePath, in ISnapshotRuntimeProfileCallback callback)

(cherry picked from commit 45f8b29ce0ca9f80c586850c4be3a1e552bc6c2f)

Bug: 30934496
Test: gts-tradefed -m GtsAndroidRuntimeManagerHostTestCases

Merged-In: Iaa6be4715840f24508acba3162ea9c1ab725bd38
Change-Id: Iaa6be4715840f24508acba3162ea9c1ab725bd38
2018-02-14 08:00:56 -08:00
Tobias Thierer
12afc7fd7e Merge "Pin jarjar targets to java_version 1.8." am: 2bbf12aa78 am: 3f48e86917
am: be3a10993f

Change-Id: Ib098b09674edb62f5a27be70f4c3be911a7e0cf6
2018-02-07 03:34:16 +00:00
Tobias Thierer
2bbf12aa78 Merge "Pin jarjar targets to java_version 1.8." 2018-02-07 00:16:04 +00:00
Paul Duffin
0aa3b20a66 Add apis needed for android.test.legacy
The long term goal of removing junit and dependent android.test classes
from the android.jar is the removal of the runtime libraries that
provide those classes. A key part of the strategy for migrating APKs off
the runtime libraries is the android.test.legacy library which APKs can
statically include in place of the runtime dependencies without having
to change their source code.

The longer term goal is for all tests to migrate from these classes
altogther and to use the Android Test Support Library instead but that
will require significant changes to the test source code.

In order for it to be safe to statically include android.test.legacy in
an APK it cannot use any internal APIs. This change adds the additional
classes and methods needed to the android.test.mock API library. The
additions are all marked as deprecated to try and avoid developers
from using them in new tests.

It also marks the AccountManager constructor used by MockAccountManager
with the android.annotation.MockApi so that it is included in the mock
stubs libraries against which the android.test.mock.stubs[-system]
libraries build.

Bug: 30188076
Test: make checkbuild

(cherry picked from commit 772b6923206a34e97c45bc48e7ad4bebfd3eae29)

Merged-In: I85417cc328cab898ab93b9b726648f4232555324
Change-Id: If3b6fc630df93a44e4c07ef769737a2ac3ebf476
2018-02-06 13:38:44 +00:00
Tobias Thierer
d65595a94e Pin jarjar targets to java_version 1.8.
This CL pins the following make targets to java_version 1.8,
which is currently the default:
  framework-protos
  repackaged.android.test.base
  repackaged.android.test.mock
  repackaged.android.test.runner

For consistency, their dependencies,
  android.test.base
  android.test.mock
  android.test.runner
which contain .java source files, are also pinned to 1.8.

This is so that the two steps:
 a) update jarjar to support v53 class files
 b) support -target 1.9 in the rest of the toolchain
can be completed in any order, in future CLs. Before this CL,
they would have needed to be completed in order a), b).

Bug: 72703434
Test: EXPERIMENTAL_USE_OPENJDK9=true USE_R8=true make checkbuild docs
      (in a client where CL http://r.android.com/596874 was reverted)

Change-Id: If78067294ae7ab78997aa109b0e08be427bdf0b8
2018-02-05 21:14:24 +00:00
Jiyong Park
97ca19f013 Add conscrypt, okhttp, bouncycastle to the classpath when building stubs
When generating the stubs for android.test.mock, the main framework
source is also included. The source in turn has references to the
conscrypt, okhttp, and bouncycastle ibraries (e.g. ActivityThread.java uses
com.android.org.conscrypt.OpenSSLSocketImpl).

Although this does not break the build because doclava does not abort on
non-existing symbols, this creates a lot of error messages to the log
output:

frameworks/base/test-mock/../core/java/android/app/ActivityThread.java:143: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.OpenSSLSocketImpl;
                                ^
frameworks/base/test-mock/../core/java/android/app/ActivityThread.java:144: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.TrustedCertificateStore;
                                ^
...

Therefore adding the missing libraries to the classpath to prevent the
scary messages.

Test: mma -j under frameworks/base/test-mock does not show the error
messages.

Change-Id: I899be8ff7466f9483e4f3ae8328bc9c72bbe22ed
2018-01-26 14:53:50 +09:00
TreeHugger Robot
064f16638b Merge "Add API to expose signing certificate proof-of-rotation." 2018-01-24 03:00:27 +00:00
Roberto Perez
c4788e1f04 Merge "Adding a new category to mark car-optimized launcher activity" 2018-01-23 18:21:59 +00:00
Daniel Cashman
5cdda3425c Add API to expose signing certificate proof-of-rotation.
With the addition of APK Signature Scheme v3, the platform now can
support key rotation by using the proof-of-rotation provided by the
new scheme.  Create a new API which allows checking of the entire
provided history of an APK's signing certificates, not just the
current signer.  This should allow for changes of APK signing
certificates without fear of losing access to resources that would
have been provided under the old signing certificate.

Change getPackageInfo(GET_SIGNATURES) to return the oldest signing
certificate in the chain so that apps which do programmatic checks,
but are not updated to use the new API, still get the same information
they would have gotten had there been no rotation.

Bug: 64686581
Test: Builds, boots.
Change-Id: I8982fd4cce60f5d85a6180d157a6e2a661b1a6d7
2018-01-23 09:10:13 -08:00
Roberto Perez
7ee1a7acc4 Adding a new category to mark car-optimized launcher activity
Test: TBD
Bug: 70681347

Change-Id: I81ea7f9f3021e8a9d25fa980a8687d66765469c5
2018-01-18 14:43:27 -08:00
Paul Duffin
924431ff1a Merge "Replace legacy-test with android.test.base in bp files" am: 2285630e4b am: caacf3e7c4
am: 2b3bf45c73

Change-Id: I0c4b7705176b0ae7eb4b06bf5a138757d6b16e9c
2018-01-16 11:52:20 +00:00
Paul Duffin
b36eb542a9 Replace legacy-test with android.test.base in bp files
The legacy-test target is deprecated and will be replaced by
android.test.base. This replaces a few usages of the legacy-test target
in Android.bp files with android.test.base.

Bug: 30188076
Test: make checkbuild
Change-Id: I3575f638114fe2a3b703e67837496346bde24472
2018-01-15 15:47:47 +00:00
Paul Duffin
2141827700 Move legacy-test to test-base
Make it consistent with the test-mock and test-runner directories.
Also renames the files in api/ subdirectory.

(cherry picked from commit f779efd62cd579f67bd3b387d59fda11ee0cbe90)

Bug: 30188076
Test: make checkbuild
Change-Id: Ied3621e6201d8717223fe1ccd4ea77d458126b25
Merged-In: If4f99a65fcca416ede5b3e63481398f0b451bcb7
2018-01-12 15:52:39 +00:00
Ben Gruver
1ab3d6e56b Implement harmful app warning at activity launch
Bug: 63909431
Test: manual

Change-Id: I8a5497421cb8130af8cdd5129b0f6e1707a01e36
2018-01-11 12:13:29 -08:00
Paul Duffin
772b692320 Add apis needed for android.test.legacy
The long term goal of removing junit and dependent android.test classes
from the android.jar is the removal of the runtime libraries that
provide those classes. A key part of the strategy for migrating APKs off
the runtime libraries is the android.test.legacy library which APKs can
statically include in place of the runtime dependencies without having
to change their source code.

The longer term goal is for all tests to migrate from these classes
altogther and to use the Android Test Support Library instead but that
will require significant changes to the test source code.

In order for it to be safe to statically include android.test.legacy in
an APK it cannot use any internal APIs. This change adds the additional
classes and methods needed to the android.test.mock API library. The
additions are all marked as deprecated to try and avoid developers
from using them in new tests.

It also marks the AccountManager constructor used by MockAccountManager
with the android.annotation.MockApi so that it is included in the mock
stubs libraries against which the android.test.mock.stubs[-system]
libraries build.

Bug: 30188076
Test: make checkbuild
Change-Id: I85417cc328cab898ab93b9b726648f4232555324
2018-01-09 14:38:38 +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
Paul Duffin
a23c84c7ca Add android.test.mock.stubs-system
The android.test.mock package contains one class with some methods that
are annotated with @SystemApi which are not present in the
android.test.mock.stubs. This adds a new android.test.mock.stubs-system
library that includes those additional methods.

Checked that the new API definition files contain the exact same
definitions for the android.test.mock packages as are found in the
api/system-current.txt and api/system-removed.txt files.

Bug: 30188076
Test: make update-api && make checkbuild
Change-Id: I4644d30716e556204caa4acb53d7af84ca520271
2017-12-19 19:56:21 +00:00