Commit Graph

6561 Commits

Author SHA1 Message Date
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
Mathew Inwood
c14f832a66 Fix comment typos in ApplicationInfo.
@linl -> @link

Test: N/A
Change-Id: I6f295101e4d3e8c4b7596e74197e4ea39bbf6e2b
2018-03-06 14:37:42 +00:00
TreeHugger Robot
3fbc54e609 Merge "Don't whitelist all system image apps." into pi-dev 2018-03-06 11:50:23 +00:00
Mathew Inwood
6827f4a2c8 Don't whitelist all system image apps.
Also include in system dump which packages are exempt from the api
restrictions.

This is a cherry-pick of 974290b032
from master.

Test: Verified that the device boots.
Bug: 64382372
Change-Id: Iaeca91478f53c8b4e9608246aab42bdb90f899bb
2018-03-06 09:54:55 +00:00
Jeffrey Vander Stoep
00b4fa8b13 Revert "pm: SharedUserId: Assign seinfo using actual targetSdkVersion"
This reverts commit 8196fd9380.

Reason for revert: b/74214574

Bug: 74214574
Change-Id: I9602872238ccc8a49d8b200e5389995d597f1c3a
2018-03-06 08:22:20 +00:00
Fyodor Kupolov
8db0bf356a Merge "Revert "Allow restoring of apps that rotated key"" into pi-dev am: d97a0f1ac5
am: d4315862cc

Change-Id: Ia73f006301d8225f7906612faa381f4307a23b51
2018-03-06 07:18:09 +00:00
Felipe Leme
bb01e5e538 Removed redundant method ContentResolver.releasePersistableUriPermission()
Bug: 72055774

Test: manual verification
Test: atest CtsAppSecurityHostTestCases:ScopedDirectoryAccessTest#testResetGranted

Change-Id: Iab6dde04b0dc43f97e1a66f665cf5f6f3e078381
2018-03-05 14:09:46 -08:00
Amith Yamasani
14c716c911 Revert "Allow restoring of apps that rotated key"
This reverts commit 313d225cd1.

Reason for revert: b/74159113

Change-Id: I483ecdd80d26fca8451cd270b4fcbe34379839cb
2018-03-05 20:40:23 +00:00
TreeHugger Robot
a597260ba2 Merge "Don't whitelist all system image apps." 2018-03-05 13:34:24 +00:00
Adam Lesinski
40a32d9ff0 Merge "Refactor AssetManager" 2018-03-02 22:05:45 +00:00
TreeHugger Robot
15881d7c0c Merge "pm: SharedUserId: Assign seinfo using actual targetSdkVersion" 2018-03-02 21:56:30 +00:00
TreeHugger Robot
fddc22678c Merge "Copy PermissionChecker from support lib and use in RcognitionService" 2018-03-02 20:01:33 +00:00