- Added Context.getUser() to system API, to allow module framework
classes to also implement multi-user support in manager classes.
- Added PackageManager.getPermissionControllerPackageName() to system
API for RoleControllerManager to know which package to bind to.
Bug: 158736025
Test: build
Change-Id: If69a97573eb1e676145e0accdfa73fef320aabe7
In preparation for enabling API lint checking on java_sdk_library
adds lint-baseline.txt containing all the existing issues for these
APIs.
The test-base and test-runner APIs are old and have been deprecated
so there is little benefit in fixing those issues.
The test-mock API while old has not been deprecated and so should be
cleaned up. Bug 156175891 tracks that cleanup work.
Bug: 156126315
Bug: 156175891
Test: m checkapi
Merged-In: Ifb4669fcf7f2a36e5cb4d593bfc5d03330901ee9
Change-Id: Ifb4669fcf7f2a36e5cb4d593bfc5d03330901ee9
(cherry picked from commit ee5a4af4c5a7f8f9b3b33ded7f1fd9da9497d9ff)
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
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
tests need to make sure the flags are set correctly.
Bug: 116738135
Test: atest CtsBackupTestCases:android.backup.cts.PermissionTest#testRestorePermReviewed
Change-Id: Ia1000de3594e910c3345e205679bee37be898d17
Changes to the various api directories will run the
tests which make use of the API specification in those directories.
Could not include CtsSystemApiSignatureTestCases as it is broken on
git_master because of bug 116632058.
Bug: 123254057
Test: atest
Change-Id: I1fe4ca498cbd0393aba7cf4c1386a6325ace7937
The new format is described in tools/metalava/FORMAT.md.
Fixes: 116589402 Switch signature files over to the v2 format
Fixes: 112626813 Drop "synchronized" modifier from the signature format
Fixes: 122358225 Omit overriding methods that only differ in final [...]
Fixes: 73088715 API Review: Need doclava to output nullability
Fixes: 79739773 API Review: Metalava enforcing constants are constant
Exempt-From-Owner-Approval: Large-scale tooling change
Test: make sdk, make update-api, make checkapi
Change-Id: Ia248aece5250e84e47c815c601133b698bf644c2
The new format is described in tools/metalava/FORMAT.md.
Fixes: 116589402 Switch signature files over to the v2 format
Fixes: 112626813 Drop "synchronized" modifier from the signature format
Fixes: 122358225 Omit overriding methods that only differ in final [...]
Fixes: 73088715 API Review: Need doclava to output nullability
Fixes: 79739773 API Review: Metalava enforcing constants are constant
Exempt-From-Owner-Approval: Large-scale tooling change
Test: make sdk, make update-api, make checkapi
Change-Id: I8314f4e7099fa92e4f8ed7d283ccf836cc9a84a0
Merged-In: Ia248aece5250e84e47c815c601133b698bf644c2
This will allow apps to better manage many isolated processes,
telling the system how they are grouped together (so should be
managed as one related entity within the LRU cache) and fine-tune
the ordering within that group.
The API is not yet tested... though in theory it is implemented.
But the implementation done for that also fixes a *lot* of problems
with activity LRU management that, even without groups, should
make the ordering of processes in the LRU list much more consistently
match how recently the user has interacted with it.
Also clean up some of the new dumpsys output in the activity manager:
move the new sections to before the process output (so it is still
easy to see the process state at the end of the output), and add and
document the command line options for controlling them. And add a
new "lru" section that gives a clear view of what is going on with
the raw LRU list.
An upcoming change will add tests for the new grouping functionality,
and probably some fixes resulting from that.
Test: atest CtsAppTestCases:ServiceTest
Bug: 111434506
Change-Id: I1f6b6b9de66ccde1573e1a0e9615e8c5f8e6c0d7
This allows clients to run multiple instances of the same
manifest service declaration. It only works for isolated
services, to avoid too much abuse temptation. This is part
of the "Chrome site isolation" work, to allow chrome to have
many more render processes running and help it manage them.
Bug: 111434506
Test: atest CtsAppTestCases:ServiceTest
Change-Id: I22e65758678a07075ed32ed6463082ddf846d3a4
The suspending app has more context about why a particular app was
suspended by the user, but we do not want to delegate the interception
of the suspended activity out of the system.
Hence allowing it further customizations to the dialog to make
it clearer.
Test: atest com.android.server.pm.SuspendDialogInfoTest \
com.android.server.pm.SuspendPackagesTest \
com.android.server.pm.PackageUserStateTest \
com.android.server.pm.PackageManagerSettingsTests \
com.android.server.am.ActivityStartInterceptorTest
atest GtsSuspendAppsPermissionTestCases GtsSuspendAppsTestCases
Bug: 112486945
Bug: 113150060
Change-Id: If9f4d14587a2b75bb572e7984a90e300a2c72d16
The PermissonController is going to become a mainline module, hence it
has to compile against @SystemApi.
PackageManager#arePermissionsIndividuallyControlled controls how certain
permissions are presented in the UI, hence Permission controller needs
to read it. The value of this API comes from a config option.
Bug: 110953302
Test: Built
Change-Id: If78b1bb594af0c85e92abf70ae8315e7ba3f31fa
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
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
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
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
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
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
Change-Id: Id325b8cf2f189117ac4cfe7634095ab710eee004
Also removed everything needed only for this path
Test: Installed app via package installer, adb, google play store
Bug: 65261282
Change-Id: Ia8a03fa5900687cd2adf844ba7e6c07e0537382e
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