Commit Graph

6590 Commits

Author SHA1 Message Date
Suprabh Shukla
bd6826dc4c Merge "Sending MY_PACKAGE_SUSPENDED to suspended apps" into pi-dev am: 1c73370df4
am: 33333ae877

Change-Id: I5ebfd6c2eca1a164a4875ec221792bae9803605e
2018-03-28 03:14:54 +00:00
TreeHugger Robot
1c73370df4 Merge "Sending MY_PACKAGE_SUSPENDED to suspended apps" into pi-dev 2018-03-28 00:45:23 +00:00
Calin Juravle
c7a44be7b3 Convert compilation reason and filter to int-enum before logging
Test: adb logcat -b events | grep sysui_multi_action
Bug: 73102540
Change-Id: I052df3d4e65ef16b43190c14a236421945c86e21
2018-03-27 11:51:51 -07:00
TreeHugger Robot
c6d9f7ce1d Merge "More flexible API enforcement policy." into pi-dev 2018-03-27 10:34:38 +00:00
Mathew Inwood
e3299533b5 More flexible API enforcement policy.
This CL adds the basics to set black, dark gray or light gray list
enforcement, rather than just black as before. It's not possible to
actually set the policy per-package yet.

PackageDexOptimizer still uses a single bit, for API checks on/off, rather
than the new enum. It assumes blacklist enforcement internally. This can
be improved in a follow up CL.

(cherry-picked from commit e52130ae4c)

Test: m
Test: Boot device

BUG: 73337509
Change-Id: Ieb4bd9cc439c6a5b8fb9424d8902d8b46aec309f
Merged-In: Idd73c9938592c5c4d67cfb9efefdffed0dd5f262
2018-03-27 09:28:33 +01:00
Suprabh Shukla
2fd43ba63e Sending MY_PACKAGE_SUSPENDED to suspended apps
Added new broadcast actions MY_PACKAGE_SUSPENDED and
MY_PACKAGE_UNSUSPENDED, which are sent to the package that is affected
by the suspend state change. A suspended package also receives a bundle
of app extras to pass more information. This makes it easier for
packages to deal with being suspended/unsuspended.

Also updated some existing documentation to make it clearer.

Test: atest com.android.server.pm.SuspendPackagesTest

Bug: 75036698
Change-Id: I772cf0c023669bc946e07ced4ebccfa74f6835b2
2018-03-26 18:01:13 -07:00
Philip P. Moltmann
4d5c36a19c Merge "Make PackageManager#getNamesForUids testable." into pi-dev am: 9360a31f5f
am: 895b6a19a6

Change-Id: I91c97b4755173c0c870f692b0026886b0e03faf5
2018-03-26 23:08:15 +00:00
Philip P. Moltmann
895b6a19a6 Merge "Make PackageManager#getNamesForUids testable." into pi-dev
am: 9360a31f5f

Change-Id: Ie4c8cb0ffa78bd1a008aad2eae9caae6c2c0afb5
2018-03-26 22:56:01 +00:00
TreeHugger Robot
9360a31f5f Merge "Make PackageManager#getNamesForUids testable." into pi-dev 2018-03-26 22:36:45 +00:00
Chris Craik
c38e97fcaa Merge "Merge "Remove incorrect @NonNull annotations on getDrawable() and variants." into pi-dev am: d52c532df7" into pi-dev-plus-aosp
am: 51b58b2479

Change-Id: I61aae2f93b0aa0991b33ea376e4809ebce23df31
2018-03-26 21:17:36 +00:00
Chris Craik
407488584c Merge "Remove incorrect @NonNull annotations on getDrawable() and variants." into pi-dev
am: d52c532df7

Change-Id: Ib503211113d175ed633a6e2045cd01938ba0d4c0
2018-03-26 20:42:10 +00:00
Chris Craik
d52c532df7 Merge "Remove incorrect @NonNull annotations on getDrawable() and variants." into pi-dev 2018-03-26 20:21:04 +00:00
Philip P. Moltmann
abeb04ed55 Make PackageManager#getNamesForUids testable.
Fixes: 76161011
Test: atest android.content.pm.cts.PackageManagerTest
Change-Id: I857d489ec9981839d63a5b934b4aaa0d2709be85
2018-03-26 10:22:10 -07:00
Benjamin Franz
cc8892f821 Merge "Expose hidden API to check whether a given package is state protected" into pi-dev am: 3ff20e2257
am: ea32bc4e38

Change-Id: I1b2cdac459c7c099783fa078eb2f009a645ba715
2018-03-26 09:42:05 +00:00
Benjamin Franz
ea32bc4e38 Merge "Expose hidden API to check whether a given package is state protected" into pi-dev
am: 3ff20e2257

Change-Id: I797fd24aff1afa3e37e6b5f4dbd93042b19ac369
2018-03-26 09:29:29 +00:00
Benjamin Franz
3ff20e2257 Merge "Expose hidden API to check whether a given package is state protected" into pi-dev 2018-03-26 09:15:41 +00:00
Nathan Harold
004892751a Merge changes from topic "data-service-grant-policy" into pi-dev am: 775e291c2e
am: 177b9bc016

Change-Id: I774a5f44ab4e633da983165bfdf0eb9b9c21062a
2018-03-24 07:18:03 +00:00
Nathan Harold
177b9bc016 Merge changes from topic "data-service-grant-policy" into pi-dev
am: 775e291c2e

Change-Id: I9e247071614faa673057335844a6d51bcbc43b8d
2018-03-24 05:13:23 +00:00
Nathan Harold
775e291c2e Merge changes from topic "data-service-grant-policy" into pi-dev
* changes:
  Add Permissions Grant for TelephonyDataService
  Add a Method to Revoke DefaultGrant Permissions
2018-03-24 05:00:42 +00:00
Chris Craik
1194b0bdfe Remove incorrect @NonNull annotations on getDrawable() and variants.
For compatibility, had to continue returning null when drawables could
not be decoded. Fix annotation to match pre-P behavior (the behavior
was reverted separately).

Fixes: 69543526
Test: make

Partial revert of Ib01eca970c5c9969998ce5b265b120aa7048b41a

Change-Id: I5f612f47793c3f04cf9874e13efdc13397ddd4e8
2018-03-23 13:38:01 -07:00
Mathew Inwood
6914312812 resolve merge conflicts of daef557352 to pi-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Merged-In: Idd73c9938592c5c4d67cfb9efefdffed0dd5f262
Change-Id: I3d1aeb30b755ca05f32dcd3c46335d1611e0bb50
2018-03-23 16:35:44 +00:00
Mathew Inwood
16073b8a7c More flexible API enforcement policy.
This CL adds the basics to set black, dark gray or light gray list
enforcement, rather than just black as before. It's not possible to
actually set the policy per-package yet.

PackageDexOptimizer still uses a single bit, for API checks on/off, rather
than the new enum. It assumes blacklist enforcement internally. This can
be improved in a follow up CL.

(cherry-picked from commit e52130ae4c)

Test: m
Test: Boot device

BUG: 73337509
Change-Id: Ic0d5b8fa631c2bd583b6fc52b2ee3708c8113f59
Merged-In: Idd73c9938592c5c4d67cfb9efefdffed0dd5f262
2018-03-23 11:44:42 +00:00
TreeHugger Robot
ec795a609d Merge "Revert "Revert "More flexible API enforcement policy.""" 2018-03-23 08:58:53 +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
Nathan Harold
76ad1a3c21 Add Permissions Grant for TelephonyDataService
The Telephony Data Service is a privileged service
that provides Data capabilities *to* Telephony. A
data service that provides IWLAN may also use WiFi
as an underlying connection that tunnels Telephony
data services over WiFi using IPsec. The carrier-
config-driven permissions model causes the
framework to bind to an appropriate Telephony Data
Service, for a given carrier, and that Data Service
is responsible for providing Cellular data. Thus,
The TelephonyDataService needs sufficient
permissions to access cellular info necessary for
performing signalling for IWLAN. This includes
Phone state information and location information
such as the current Wifi access points and the
current cell towers. In addition, a Telephony
Data Service may require access to IPsec if the
data service uses the Android API to establish
IPsec, which is optional today.

Bug: 66955045
Test: wip
Merged-In: Ibe4f7806a47e2a50999376ff0a5a07dc5b332953
Change-Id: Ibe4f7806a47e2a50999376ff0a5a07dc5b332953
2018-03-22 15:25:31 -07: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
Benjamin Franz
7cc9a817d4 Expose hidden API to check whether a given package is state protected
Bug: 75997475
Test: manual
Change-Id: I5e0da781af6d148aed2247175e8ee5d9f244ebe1
2018-03-22 18:10:06 +00:00
Mathew Inwood
e52130ae4c Revert "Revert "More flexible API enforcement policy.""
This reverts commit 1bc41d4c7d.

Reason for revert: Re-submitting after fixing tests.

Test: See original change
Change-Id: Idd73c9938592c5c4d67cfb9efefdffed0dd5f262
2018-03-22 11:46:57 +00:00
Makoto Onuki
d62fd06751 Merge "Updated the javadoc of ContentResolver.addPeriodicSync to correct the minimum interval of periodic sync." into pi-dev am: b630550ed1
am: 5e8a50f135

Change-Id: Ia555e6a2b5c387a86966cd3e10c2e2af15d95589
2018-03-22 01:53:47 +00:00
Liefu Liu
5c0d7b3a7f Updated the javadoc of ContentResolver.addPeriodicSync to correct the minimum interval of periodic sync.
Bug: 76033438
Change-Id: I1ccb7ae174f8f13dae24296a3fb7e9dfcd77c7fa
Fixes: 76033438
Test: javadoc only. presubmit only.
2018-03-21 21:28:43 +00:00
Philip P. Moltmann
6951f56be0 Add SoundTriggerDetectionService am: 18e3eb8168
am: 9dd3e7d300

Change-Id: I13fd3f3d896825ddaf7cf5017eb027e5469208fb
2018-03-21 09:16:32 +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
David Brazdil
bef718ff1b Merge "Revert "More flexible API enforcement policy."" 2018-03-20 20:26:45 +00:00
David Brazdil
1bc41d4c7d Revert "More flexible API enforcement policy."
This reverts commit 8bf10c74d4.

Reason for revert: Breaks run-test 674-hiddenapi

Change-Id: I014b29bf502d98d3e4134c16302008de085f64e2
2018-03-20 20:20:44 +00:00
TreeHugger Robot
27c92a6efc Merge "More flexible API enforcement policy." 2018-03-20 18:21:43 +00:00
Mathew Inwood
8bf10c74d4 More flexible API enforcement policy.
This CL adds the basics to set black, dark gray or light gray list
enforcement, rather than just black as before. It's not possible to
actually set the policy per-package yet.

PackageDexOptimizer still uses a single bit, for API checks on/off, rather
than the new enum. It assumes blacklist enforcement internally. This can
be improved in a follow up CL.

Test: m
Test: Boot device

BUG: 73337509
Change-Id: I582bbb3ae63b4ef1c1f2af78930d153df7936075
2018-03-20 13:04:38 +00:00
Sunny Goyal
7e10028abc Merge "Updating java doc for requestPinAppWidget" into pi-dev am: dbb0a49f00
am: 1f42bf5b6d

Change-Id: I0d4ecbd0a7e164a892cfcfa6ee2734c5deac1a3e
2018-03-20 06:48:21 +00:00
Sunny Goyal
dbb0a49f00 Merge "Updating java doc for requestPinAppWidget" into pi-dev 2018-03-20 02:07:48 +00:00
Makoto Onuki
f2252f562c Merge "Fix SyncResutl.delayUntil javadoc" into pi-dev am: 6b71daa0c2
am: aeba5ea921

Change-Id: I80f7425c025cc839ed17a045495c3f6ad6e61142
2018-03-19 15:37:14 +00:00
Makoto Onuki
6b71daa0c2 Merge "Fix SyncResutl.delayUntil javadoc" into pi-dev 2018-03-19 15:12:36 +00:00
Sunny Goyal
e7712ad4dd Updating java doc for requestPinAppWidget
Bug: 74435565
Test: N/A
Change-Id: Iae290e411929c817721f481301f8fb057ebe7b2c
2018-03-17 21:24:35 +00:00
Philip P. Moltmann
a80c0da4fa Merge "onUnsyncableAccount: Better docs, main thread" into pi-dev am: ddbb9d00a2
am: 3a129ef0d5

Change-Id: I33168513cd7ea9a87b896176228734335a3a4b40
2018-03-16 16:56:52 +00:00
Philip P. Moltmann
186e3b31fc onUnsyncableAccount: Better docs, main thread
Describe that AbstractThreadedSyncAdapter.onUnsyncableAccount should return
immediately and call it on main thread.

Test: atest android.content.cts.AccountAccessSameCertTest
            android.content.cts.DeferSyncTest
            android.content.cts.ContentResolverSyncTestCase
	    com.android.cts.content.CtsSyncAccountAccessOtherCertTestCases
Fixes: 73750859
Change-Id: Ie9e1aefafe3a4a1b3f0fe8a65803554f07a94c42
2018-03-15 16:59:50 -07:00
Makoto Onuki
acfb417cdc Fix SyncResutl.delayUntil javadoc
Fix: 17912666
Bug: 66950061
Test: presubmit
Change-Id: I47b3a9fd087e7d7519eb1bc4a6182929a75d873b
2018-03-15 11:31:55 -07:00
Michal Karpinski
808d8a0163 Merge "Allow restoring of apps that rotated key" into pi-dev am: d766e212c9
am: f89a90bcca

Change-Id: I0895c47a93d7bd3b90a89bd0b0dce2cc24fcb963
2018-03-15 10:41:22 +00:00
Michal Karpinski
d766e212c9 Merge "Allow restoring of apps that rotated key" into pi-dev 2018-03-15 10:13:34 +00:00
Chad Brubaker
c1544af88a Merge "Merge "Fix cleartext default for the manifest value" into pi-dev am: 75a3173245" into pi-dev-plus-aosp
am: a957321189

Change-Id: Iae321380f76f4176370d3daec4098d85fc29b028
2018-03-15 04:47:06 +00:00
TreeHugger Robot
75a3173245 Merge "Fix cleartext default for the manifest value" into pi-dev 2018-03-15 02:50:20 +00:00
Yohei Yukawa
1772885497 Merge "Also apply prefix when dumping isAllowedToUseHiddenApi" into pi-dev am: 265b11ffb2
am: 231262c42b

Change-Id: Ife192204965b1953b603262e140027520f460131
2018-03-15 01:06:23 +00:00