History log of /frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6affc07065083468c5580b04d3572ef6acbb138c 22-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "APIs to suspend packages with SUSPEND_APPS permission" into pi-dev
021b57ab8df0927aa1f78a2f3bb01d5e70594b1a 09-Mar-2018 Suprabh Shukla <suprabh@google.com> 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
/frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java
18e3eb816887156f40def1c14db434ddde9ec245 10-Mar-2018 Philip P. Moltmann <moltmann@google.com> 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
/frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java
700feef8a60e06784d28d1db9502e650df854cad 15-Feb-2018 Makoto Onuki <omakoto@google.com> 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
/frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java
064f16638be7304e589177386aa09f542a07ff88 24-Jan-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add API to expose signing certificate proof-of-rotation."
5cdda3425ccf3c62e400a1646615f4479a8266af 19-Jan-2018 Daniel Cashman <dcashman@google.com> 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
/frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java
7ee1a7acc4d3ff8d05aaa76ba7665fdef9f315ec 05-Dec-2017 Roberto Perez <robertoalexis@google.com> Adding a new category to mark car-optimized launcher activity

Test: TBD
Bug: 70681347

Change-Id: I81ea7f9f3021e8a9d25fa980a8687d66765469c5
/frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java
1ab3d6e56b56fe0cfe31e437326b5cbc66bdb361 07-Dec-2017 Ben Gruver <bgruv@google.com> Implement harmful app warning at activity launch

Bug: 63909431
Test: manual

Change-Id: I8a5497421cb8130af8cdd5129b0f6e1707a01e36
/frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java
79c238ada6e7072f62f807781d58d314ed2f17a9 14-Dec-2017 Philip P. Moltmann <moltmann@google.com> Use modern install method in backup service

Test: adb backup -apk myApp -f backup ; adb restore backup
Change-Id: I2bbcb0487ecc525a6dc8a2693b15ce624db275b0
/frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java
45f8b29ce0ca9f80c586850c4be3a1e552bc6c2f 08-Nov-2017 Calin Juravle <calin@google.com> 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)

Bug: 30934496
Test: gts-tradefed -m GtsAndroidRuntimeManagerHostTestCases

Change-Id: Iaa6be4715840f24508acba3162ea9c1ab725bd38
/frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java
b13f15332e5279d53afa9af2c6835e2476daa655 14-Nov-2017 Philip P. Moltmann <moltmann@google.com> Remove one legacy install path

Also removed everything needed only for this path

Test: Installed app via package installer, adb, google play store
Bug: 65261282
Change-Id: Ia8a03fa5900687cd2adf844ba7e6c07e0537382e
/frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java
e254526f0fe5d22681555bd4a00b7ee96fee1dc1 15-Nov-2017 Paul Duffin <paulduffin@google.com> Separate android.test.mock from test-runner source

Extracts the source for the android.test.mock library from the
frameworks/base/test-runner directory into its own
frameworks/base/test-mock directory. They are already treated separately
at runtime and compile time so this just makes the separation complete.

Bug: 30188076
Test: make checkbuild
Change-Id: I20e5b06ba79677e76117c82e9f9e2ecd15e5fed6
/frameworks/base/test-mock/src/android/test/mock/MockPackageManager.java