Commit Graph

6572 Commits

Author SHA1 Message Date
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
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
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
TreeHugger Robot
265b11ffb2 Merge "Also apply prefix when dumping isAllowedToUseHiddenApi" into pi-dev 2018-03-15 00:37:37 +00:00
Yohei Yukawa
f3ca7a73dc Also apply prefix when dumping isAllowedToUseHiddenApi
This is a follow up CL to a CL [1] that added one more state dump from
ApplicationInfo regarding whether the app is exampted from the API
restriction but forgot to take care of prefix handling.

 [1]: I01e837253d00c6ffa841a9e5c226204a3e11b827
      974290b032

Bug: 64382372
Test: Ran the following command to see "isAllowedToUseHiddenApi"
      is aligned with other outputs from ApplicationInfo.
         adb shell ime list -a
Change-Id: I9c77d9b557245b7f3b51631140bd564feef601ce
2018-03-14 13:43:47 -07:00
Todd Kennedy
662504f941 Enable local search for instant apps
When getting the set of searchable activities, fetch instant
applications. But, this means that the set needs a final
filter to prevent leaking application existence.

Change-Id: I6b9daf031ce54061c4500d9edae1d738848158c4
Fixes: 68211791
Test: atest -it CtsAppSecurityHostTestCases:EphemeralTest#testGetSearchableInfo
(cherry picked from commit 8b9d664cae)
2018-03-14 20:31:11 +00:00
TreeHugger Robot
9794ed6844 Merge "Enable local search for instant apps" 2018-03-14 20:25:51 +00:00
Felipe Leme
0dc5ea2bf9 Merge "Removed redundant method ContentResolver.releasePersistableUriPermission()" into pi-dev am: 5741823729
am: 89ad93f457

Change-Id: Icc739e5befce0d3c51f397532f49cee0af5d3c7e
2018-03-14 19:14:12 +00:00
TreeHugger Robot
5741823729 Merge "Removed redundant method ContentResolver.releasePersistableUriPermission()" into pi-dev 2018-03-14 18:42:38 +00:00
Chad Brubaker
0d285d5117 Fix cleartext default for the manifest value
If no network security config is set the default value of
cleartextTrafficPermitted comes from the legacy
android:cleartextTrafficPermitted, default this to false for apps
targeting P to track the network security config behavior as was
intended.

Bug: 74587672
Test: atest CtsNetSecPolicyUsesCleartextTrafficUnspecifiedTestCases
Change-Id: I6367723befa1b947063554c9c061bdfc5be3d116
2018-03-14 09:45:52 -07:00
Michal Karpinski
528c3e572a Allow restoring of apps that rotated key
Restoring of apps that rotated key wouldn't be possible due to
explicit signature matching.
Amend signature matching strategies to take into account
apps that have rotated key.

Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/backup/utils/AppBackupUtilsTest.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/backup/BackupUtilsTest.java
Test: m -j RunFrameworksServicesRoboTests
Test: runtest -p com.android.server.backup frameworks-services
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest1.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest2.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest3.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest4.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest5.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest6.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest7.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest8.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest9.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest10.java
Test: atest CtsShortcutManagerTestCases
Bug: 64686581
Bug: 34345052
Bug: 74208476
Bug: 74159113

Change-Id: Ica23bbfec89648d9348c65db4597188e8c18e1d8
2018-03-14 16:11:18 +00:00
Todd Kennedy
8b9d664cae Enable local search for instant apps
When getting the set of searchable activities, fetch instant
applications. But, this means that the set needs a final
filter to prevent leaking application existence.

Change-Id: I6b9daf031ce54061c4500d9edae1d738848158c4
Fixes: 68211791
Test: atest -it CtsAppSecurityHostTestCases:EphemeralTest#testGetSearchableInfo
2018-03-14 08:25:20 -07:00
Fyodor Kupolov
0bb2a9da05 Merge "Added ACTION_BATTERY_LEVEL_CHANGED" into pi-dev am: 04782e277c
am: 8ac8356b51

Change-Id: Ie4ecb38345003c3d450361044a6a31120d600352
2018-03-10 07:09:14 +00:00
Todd Kennedy
5fdbabb5dc Fix doc bugs
* Add more words around the install reason in the SessionParams. Document
  the fact that the value is somewhat arbitrary, but, clients should try
  to use one of the defined values

* Clarify that the "name" parameter for resolveContentProvider() is really
  the URI authority. Add a small code snippet.

Change-Id: I60f152439f04ce85a9f0ed67504424190b9ef3bd
Fixes: 66448772
Fixes: 66471537
Test: None. This only changed javadoc
2018-03-08 10:55:19 -08:00
Fyodor Kupolov
70e7543066 Added ACTION_BATTERY_LEVEL_CHANGED
Sent when the current battery level changes.

It has EXTRA_EVENTS that carries a list of Bundle instances representing
individual battery level changes with associated extras from
ACTION_BATTERY_CHANGED

Each event has EXTRA_EVENT_TIMESTAMP representing time when it occured.

Test: manual
Bug: 74020080
Change-Id: I993005950299c5298c9111ca51cc7717e1f029de
2018-03-08 10:09:01 -08:00
Jeff Vander Stoep
cab3639dcb Revert "Revert "pm: SharedUserId: Assign seinfo using actual targetSdkVersion""
Commit 042f4bb6 'pm: Modify getPackage() to only return non-null
packages' prevents the NullPointerException. b/
This reverts commit 00b4fa8b13.

Bug: 74214574
Bug: 72290969
Test: Same tests run on original commit.
Test: successfully flash and boot from bild 4504078 to ToT master.
Change-Id: Ia1e900ebe0eb8f9d10fd0eddbf658f52e1ea79b4
(cherry picked from commit 32ef1c2eb0)
2018-03-07 18:49:12 +00:00
TreeHugger Robot
761862a256 Merge "Revert "Revert "pm: SharedUserId: Assign seinfo using actual targetSdkVersion""" 2018-03-07 18:43:24 +00:00
TreeHugger Robot
99d753b4a1 Merge "Fix comment typos in ApplicationInfo." 2018-03-07 15:07:55 +00:00
Jeff Vander Stoep
32ef1c2eb0 Revert "Revert "pm: SharedUserId: Assign seinfo using actual targetSdkVersion""
Commit 042f4bb6 'pm: Modify getPackage() to only return non-null
packages' prevents the NullPointerException. b/
This reverts commit 00b4fa8b13.

Bug: 74214574
Bug: 72290969
Test: Same tests run on original commit.
Test: successfully flash and boot from bild 4504078 to ToT master.
Change-Id: Ia1e900ebe0eb8f9d10fd0eddbf658f52e1ea79b4
2018-03-06 16:51:26 -08:00
Jeffrey Vander Stoep
85d1b5c414 Revert "pm: SharedUserId: Assign seinfo using actual targetSdkVersion"
This reverts commit 8196fd9380.

Reason for revert: b/74214574

Bug: 74214574
Change-Id: I9602872238ccc8a49d8b200e5389995d597f1c3a
(cherry picked from commit 00b4fa8b13)
2018-03-06 15:12:15 +00:00
TreeHugger Robot
e4936647e9 Merge "Revert "pm: SharedUserId: Assign seinfo using actual targetSdkVersion"" 2018-03-06 14:43:35 +00:00