Commit Graph

6962 Commits

Author SHA1 Message Date
Jeff Sharkey
960165c0d7 Merge "Recover shady content:// paths." 2018-09-25 23:56:56 +00:00
TreeHugger Robot
e224120377 Merge "Add PermissionManager exposing SPLIT_PERMISSIONS" 2018-09-25 22:53:51 +00:00
Nicole Borrelli
2bfca321cc Merge "Fix malformed Javadoc." into pi-dev am: 3ae3f252b4
am: 3d54533e52

Change-Id: I8940755ed359d4fcf6683c59c0e501c11faa4559
2018-09-25 14:24:28 -07:00
Nicole Borrelli
3d54533e52 Merge "Fix malformed Javadoc." into pi-dev
am: 3ae3f252b4

Change-Id: Iea60c213e70a8878baeb59b9247ae4bf0eaf5a8d
2018-09-25 14:06:49 -07:00
Philip P. Moltmann
039678e13f Add PermissionManager exposing SPLIT_PERMISSIONS
The Permission Controller app (a mainline module) needs to be able to
read the SPLIT_PERMISSIONS. Hence this array needs to be exposed at
least as system-api. We need to make sure that the PackageParser,
PackageManager and Permission Controller app agree on which permissions
are split, hence it is best to define them at a single location.

I think exposing the split permissions to developers is useless and
potentially confusing. The app should never request a permission that
was split. The app should just behave as if split permissions do not
exist. The Permission Controller / Package Manager deal with the
split permissions and add them when needed. Hence I don't think we
should expose this data to 3rd parties.

Bug: 110953302
Test: requested permissions
Change-Id: I6951c52979c89ee5c13a4a14da125e1a01f2e234
2018-09-25 13:48:11 -07:00
Jeff Sharkey
c4156e0ec4 Recover shady content:// paths.
The path-permission element offers prefix or regex style matching of
paths, but most providers internally use UriMatcher to decide what
to do with an incoming Uri.

This causes trouble because UriMatcher uses Uri.getPathSegments(),
which quietly ignores "empty" paths.  Consider this example:

    <path-permission android:pathPrefix="/private" ... />

    uriMatcher.addURI("com.example", "/private", CODE_PRIVATE);

    content://com.example//private

The Uri above will pass the security check, since it's not
technically a prefix match.  But the UriMatcher will then match it
as CODE_PRIVATE, since it ignores the "//" zero-length path.

Since we can't safely change the behavior of either path-permission
or UriMatcher, we're left with recovering these shady paths by
trimming away zero-length paths.

Bug: 112555574
Test: atest android.appsecurity.cts.AppSecurityTests
Test: atest FrameworksCoreTests:android.content.ContentProviderTest
Change-Id: Ibadbfa4fc904ec54780c8102958735b03293fb9a
2018-09-25 14:10:15 -06:00
Kevin Chyn
05c21508fd 3/n: Add BiometricManager, hasEnrolledBiometrics()
Fixes: 112570477

Test: BiometricPromptDemo works
Test: Able to get/use BiometricManager
Test: Tested with enrolled and non-enrolled biometrics

Change-Id: I26231894eccc87c42b5b3007aa0b7c6f09830452
2018-09-21 17:08:49 -07:00
Kevin Chyn
352adfec61 2/n: Rename BiometricPromptService to BiometricService
This is in preparation for BiometricManager. Each Manager should have its
own Service.

Bug: 112570477

Test: BiometricPromptDemo works
Change-Id: Ibbbd499a0fd5a2050b329ee038776c6c9f49cdb2
2018-09-20 23:51:40 -07:00
kopriva
b7b399ed76 Merge "docs: fixing several minor documentation bugs" into pi-dev am: 82b0d17b39
am: f6b27fbff0

Change-Id: I14f98e023001c75719ab8b891db6abf3f0fd4564
2018-09-20 17:12:29 -07:00
kopriva
f6b27fbff0 Merge "docs: fixing several minor documentation bugs" into pi-dev
am: 82b0d17b39

Change-Id: Ieb1447c0d7cda629338de8d6e03f46670d8ed0b0
2018-09-20 16:55:47 -07:00
Nicole Borrelli
8a5f04a6a7 Fix malformed Javadoc.
Bug: 114244716
Change-Id: I316e5fcbe742a57bbf997617f3afe01484f7d8a0
Test: manual testing
2018-09-20 23:33:20 +00:00
kopriva
f07a46058c docs: fixing several minor documentation bugs
Test: make ds-docs

Bug: 36949243
Bug: 116169695
Bug: 37001248
Bug: 37044885
Bug: 37053166

Change-Id: I844a8978518cd7214bf9d068d602902dfa7e8246
Exempt-From-Owner-Approval: Docs-only change
2018-09-20 11:20:27 -07:00
TreeHugger Robot
87a97a47eb Merge "Update Context documentation to indicate that KEYGUARD_SERVICE is unavailable for Instant Apps." 2018-09-19 23:06:33 +00:00
Donald Chai
ee4c91c6a6 Update Context documentation to indicate that KEYGUARD_SERVICE is
unavailable for Instant Apps.

Bug: 116021320
Bug: 67614964
Test: N/A
Change-Id: I94275ad51aec13acfe15ede3a5fb9a80aa57d977
2018-09-19 14:47:09 -07:00
TreeHugger Robot
f9d779d51d Merge "Allow apps to write to the clipboard without input focus" 2018-09-19 21:35:17 +00:00
Philip P. Moltmann
e854a65a78 Merge changes I74745f89,Ia70f966c
* changes:
  Grant permissions to updated system packages
  Revert "Revert "Reduce coupling between DefaultPermissionGrantPolicy and PM""
2018-09-19 20:16:40 +00:00
Philip P. Moltmann
1a771ca6ce Merge "Add documentation to recently added system API" 2018-09-19 19:56:59 +00:00
Philip P. Moltmann
6af221c01b Add documentation to recently added system API
Test: Built
Change-Id: I014cc1e1088e409abb33d61c8d69d51e6a1e7045
2018-09-19 15:42:59 +00:00
Philip P. Moltmann
b0be05c5cb Revert "Revert "Reduce coupling between DefaultPermissionGrantPolicy and PM""
This reverts commit fa894222e6.

Reason for revert: Resubmitting in a topic with the fix for the bug that required the revert

Change-Id: Ia70f966c8757f340ceb14f187e9726c12457403a
2018-09-18 19:48:53 -07:00
Philip P. Moltmann
fa894222e6 Revert "Reduce coupling between DefaultPermissionGrantPolicy and PM"
This reverts commit 47e8820816.

Reason for revert: 115854330

Bug: 115854330
Change-Id: I44edb7863daa12352935ffdbed701d4772e93132
2018-09-19 02:30:28 +00:00
Philip P. Moltmann
192e1c6476 Merge changes from topic "SettingsLibRestrictedLockUtils"
* changes:
  Make methods used by PermissionController @SystemApi
  Make restricted lock icon system-api
2018-09-18 15:27:36 +00:00
Josh Gao
7b9617dcf2 Merge "Fix typo in IntentFilter documentation." am: ada39fe63d am: 5c775ffdc8
am: 39510ef3d2

Change-Id: I32f695532dbf0549f418e61345818635e9508e5a
2018-09-17 20:20:23 -07:00
Josh Gao
39510ef3d2 Merge "Fix typo in IntentFilter documentation." am: ada39fe63d
am: 5c775ffdc8

Change-Id: Iae760087190441702f01e91115da0c9e52061ff7
2018-09-17 20:11:58 -07:00
Josh Gao
5c775ffdc8 Merge "Fix typo in IntentFilter documentation."
am: ada39fe63d

Change-Id: I9da782211b8a6766ceb6b17fdec3b31e2e884676
2018-09-17 19:59:26 -07:00
Treehugger Robot
ada39fe63d Merge "Fix typo in IntentFilter documentation." 2018-09-18 01:44:46 +00:00
Yiwei Zhang
d5cd5e1621 Merge "Revert "pm: Exposing Vulkan 1.1 does not guarantee AHB extension support"" 2018-09-17 23:04:43 +00:00
TreeHugger Robot
2105ec5fe8 Merge "Keep app in high memory adjust if moving from TOP to FGS" 2018-09-15 04:38:29 +00:00
Amith Yamasani
e5bfeee745 Keep app in high memory adjust if moving from TOP to FGS
If an app was in the TOP state and immediately moved
to a foreground service state, then try harder to keep it
in memory for another 20 seconds before releasing the
memory to bound foreground services. Using an oom_adj value
of 50 which is between "fore" and "vis". So BFGS apps might
get killed ("vis") before this recently FGS'ed app. That
way any app that has a lot of state in memory that it needs
to persist before getting killed has a chance to do so.

Also bind NotificationListeners with a special bind flag
to rank them below FGS (perceptible adj) so that they
can be killed before any other foreground services or
bound services get killed.

Bug: 110969183
Test: Manual for now. Take a bunch of portrait
      pictures and hit home, while being under memory
      pressure with a bunch of notification listeners.
Change-Id: Ie8934c2331afe6450c582b209869aeca7272f58a
2018-09-14 15:52:40 -07:00
Eugene Susla
79a85ae200 Merge "Reduce coupling between DefaultPermissionGrantPolicy and PM" 2018-09-14 20:36:51 +00:00
Philip P. Moltmann
3c44c6c925 Merge "Describe paramter to PackageInstaller.Session#commit" 2018-09-14 19:13:38 +00:00
Philip P. Moltmann
2fe7dee1cf Describe paramter to PackageInstaller.Session#commit
Test: Built
Change-Id: I4c20b54070ba5345e0c95429fbf0700fe9b2f7d2
Fixes: 115609562
2018-09-14 10:59:33 -07:00
Mathew Inwood
db0657a4f4 Merge "Move some members to the "Q blacklist"." 2018-09-14 13:54:28 +00:00
Mathew Inwood
8c854f86a4 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
2018-09-14 13:18:34 +01:00
kopriva
f0ca62a3eb Merge "docs: fixed mistaken reference to NotificationManager" into pi-dev am: 206a50673d
am: bb252836e5

Change-Id: If12876c83c191b91235e16a69d7dad66fc682b80
2018-09-13 20:06:12 -07:00
kopriva
bb252836e5 Merge "docs: fixed mistaken reference to NotificationManager" into pi-dev
am: 206a50673d

Change-Id: I03ebc3385e89c5b71888d7a4d11b0e2608d80fed
2018-09-13 19:57:19 -07:00
kopriva
5495dbbb80 docs: fixed mistaken reference to NotificationManager
Test: make ds-docs

Bug: 36952345

Change-Id: Icc74db9f8808e67c6eafacc0e40a35f47cba32ba
Exempt-From-Owner-Approval: Docs-only change
2018-09-13 14:18:34 -07:00
Jeff Sharkey
e0339a6f6e Merge "Support more createPackageContextAsUser() users." 2018-09-13 20:08:57 +00:00
TreeHugger Robot
456e4f5b59 Merge "Expose Resources.getFloat publicly" 2018-09-13 19:15:50 +00:00
Eugene Susla
47e8820816 Reduce coupling between DefaultPermissionGrantPolicy and PM
This is a refactoring that should help us eventually split
DefaultPermissionGrantPolicy away from package manager
Specifically, this CL:
  - Removes usages of PM-internal APIs from DPGP, such as
    PackageParser.Package and PackageList
  - Introduces APIs in PackageManagerInternal to replace the above
  - Removes PackageManagerService as a middleman for default
    sms and dialer app changes

This intentionally doesn't move DPGP yet, to make it easier to review what actually changed

Test: gts-tradefed run gts -m GtsPermissionTestCases -t com.google.android.permission.gts.DefaultPermissionGrantPolicyTest
Change-Id: Iff5b1a6b97888c496d982cf2ce656b58ed0a31a6
2018-09-13 11:08:32 -07:00
Steven Moreland
8b4ce09de4 Merge changes from topic "remove-hidl-boot-jars" am: 82e3d2f066 am: fc8de0d9e3
am: d70998a8d9

Change-Id: Iee10a8281e023c9917fb81a2e72be1475dc10772
2018-09-13 10:35:38 -07:00
Steven Moreland
d70998a8d9 Merge changes from topic "remove-hidl-boot-jars" am: 82e3d2f066
am: fc8de0d9e3

Change-Id: If4d5c5e99bf605f31371426ab3a5def66f0a0137
2018-09-13 09:57:42 -07:00
Philip P. Moltmann
2f69263101 Make methods used by PermissionController @SystemApi
The PermissonController is going to become a mainline module, hence it
has to compile against @SystemApi. Hence all APIs needed have to be
upgraded.

Bug: 110953302
Test: Built
Change-Id: I329e062040bdb6dc20fd65baf71e025338d01c4e
2018-09-13 09:56:41 -07:00
Steven Moreland
fc8de0d9e3 Merge changes from topic "remove-hidl-boot-jars"
am: 82e3d2f066

Change-Id: I17b89f904ed17ee8f1f31c6d56cb96da705cb553
2018-09-13 09:40:50 -07:00
Jake Wharton
32365b91ce Expose Resources.getFloat publicly
This saves users from having to create a TypedValue, calling getValue, and then pulling out the float manually.

Test: none, just exposing existing functionality
Bug: 37116599
Change-Id: Ie4fcf51d64ec6113148e1fbf3c199cfff028f579
2018-09-13 12:12:27 -04:00
Jeff Sharkey
8068dfe6be Merge "Utilities for content:// Uris and file modes." 2018-09-13 15:20:59 +00:00
Ian Lake
666a965fd5 Annotate ComponentCallbacks with nullability annotations
BUG: 78245676
Test: make
Change-Id: Idd88ecbfc97672f3a234641c8892c245b4fe130a
2018-09-12 15:13:19 -07:00
Jeff Sharkey
ec5f7d1625 Support more createPackageContextAsUser() users.
We created this API to make it easy to pass a given UserHandle into
all Managers obtained from a given Context, which works great for
"normal" users, but we should also support special users like ALL
and CURRENT.

Also add an AutoCloseable marker to make try-with-resources easier.

Bug: 112153259
Test: atest android.content.cts.ContextTest
Change-Id: I261dfcc5cfdfc76bda5d70181785e11c2715a558
2018-09-12 14:02:11 -06:00
Jeff Sharkey
63280e06fc Utilities for content:// Uris and file modes.
Bug: 111268862, 111960973
Test: atest cts/tests/tests/content/src/android/content/cts/ContentUrisTest.java
Test: atest frameworks/base/core/tests/coretests/src/android/os/FileUtilsTest.java
Change-Id: I94373055468d279e6553d4a038267732b9b53745
2018-09-12 12:35:52 -06:00
Steven Moreland
f36ad62907 pm: Add hidl libraries to old class paths.
These two libraries:
android.hidl.base-V1.0-java
android.hidl.manager-V1.0-java

are being removed from BOOT_JARS. This change facilitates linking to them
for libraries or prebuilts in or before P.

Test: atest android.content.pm.AndroidHidlUpdaterTest
Bug: 77307025

Change-Id: Ic0db24cc68d66f5dbfab126ce7e304eec0bfc969
2018-09-12 09:18:40 -07:00
Mike Ma
43908f112b Merge "Avoiding potential NPE when dumping to proto." am: a52b601ef3
am: 8964390dd3

Change-Id: Ie9dc401990b4267b9bcf0469a3526db93dc438d2
2018-09-11 18:47:58 -07:00