Commit Graph

7170 Commits

Author SHA1 Message Date
Jeff Sharkey
4ba6923975 Offer API to detect ContentProvider ANRs.
If a system component calls to a remote provider, and that provider
hangs, we end up burning that Binder thread until the remote process
is killed for some unrelated reason.

This change adds an API to detect these hangs, and kill the remote
process after a specific timeout, but only when the caller holds a
permission that lets them kill other apps.

Bug: 117635768
Test: atest android.content.cts.ContentResolverTest
Change-Id: I81b0d993d9d585cdeb5e2559c68052ba6cbbced9
2018-12-08 14:56:48 -07:00
Jeff Sharkey
e770d22dc9 Make DocumentsContract methods more general.
Accepting only ContentResolver arguments was quite limiting, so use
the newly created super-interface ContentInterface, which lets
callers use a ContentResolver, and ContentProviderClient, or even a
specific ContentProvider.

This is a safe API change, since we're accepting a more-general
argument, and existing API users can continue passing ContentResolver
to these methods.

Bug: 117635768
Test: atest DocumentsUITests
Test: atest android.appsecurity.cts.DocumentsTest
Change-Id: I8f0cd1335c9b763dd81eeb237fb0517e9073b625
2018-12-08 11:48:31 -07:00
Jeff Sharkey
633a13e2fa Extract common methods into ContentInterface.
Existing APIs that accept a ContentResolver are too restrictive when
the caller has their own ContentProviderClient already bound and
configured, so we're in the market for a solution to open those
existing APIs to accept a wider range of inputs.

The solution we've come up with is to introduce a super-interface
which contains the common ContentProvider APIs, and then make
ContentProvider, ContentResolver, and ContentProviderClient all
implement that interface for consistency.

After this change lands, we can then safely relax existing APIs to
accept this new ContentInterface, offering a clean path to solving
the problem outlined above.

Bug: 117635768
Test: atest android.content.cts
Test: atest android.provider.cts
Change-Id: Ic5ae08107f7dd3dd23dcaec2df40c16543e0d86e
Exempted-From-Owner-Approval: keep tests working
2018-12-08 11:25:13 -07:00
Benedict Wong
c02acadd9b Merge "Add IPsec tunnel mode feature flag" 2018-12-07 19:42:21 +00:00
Felipe Leme
749b889889 Yet another (major) refactoring on Content Capture and Augmented Autofill.
Bunch of changes:

- Split public SmartSuggestionsService info ContentCaptureService and
  AugmentedAutofillService
- Renamed 'intelligence' packages to either 'contentcapture' or
  'autofil.augmented'
- Renamed internal packages and classes.
- Changed permissions, resource names, etc...
- Moved Augmented Autofill logic from IntelligeceManagerService (R.I.P.) to
  Autofill.
- Optimized IPCs by passing a String instead of the InteractionSessionId
  (that also solves the view -> service dependency).

Test: atest CtsContentCaptureServiceTestCases \
            CtsAutoFillServiceTestCases \
            FrameworksCoreTests:SettingsBackupTest
Test: manual verification with Augmented Autofill Service

Bug: 119638877
Bug: 117944706

Change-Id: I787fc2a0dbd9ad53e4d5edb0d2a9242346e4652d
2018-12-06 16:56:39 -08:00
TreeHugger Robot
151357cde2 Merge "Replace Slog with Log in ContentProvider" 2018-12-06 23:05:40 +00:00
Amin Shaikh
5fdc89c006 Document the format of EXTRA_CONTENT_QUERY.
Change-Id: Ifb8e76bf9c7e3a24a91efe7423153aef3d91eb86
Fixes: 120488579
Test: N/A
2018-12-06 15:50:21 -05:00
Eugene Susla
aaa542712b Replace Slog with Log in ContentProvider
Test: ensure noe errors on boot
Change-Id: I44efbf1a52c9c602ce6c9f8ea23b7a4566df27f3
2018-12-06 11:04:21 -08:00
TreeHugger Robot
8730cc4e6b Merge "Add documentation for passing EXTRA_PERMISSION_NAME to REVIEW_PERMISSION_USAGE." 2018-12-06 15:55:45 +00:00
Benedict Wong
dc92c69b08 Add IPsec tunnel mode feature flag
This patch adds a feature flag for IPsec Tunnel Mode. This implies VTI
(with output-mark updating), or XFRM-I in the kernels.

Bug: 117183273
Test: Compiles
Change-Id: I6dd0e429cc0bd100f2ef1140a6651f6ef5294c79
2018-12-05 23:41:02 -08:00
TreeHugger Robot
fce7ec9737 Merge "Log a string to logcat when ContentProvider access gets denied due to appop" 2018-12-06 02:42:50 +00:00
Dianne Hackborn
77b13fd30a Merge "Fix various issues in ordering of grouped bindings." 2018-12-06 00:44:24 +00:00
Dianne Hackborn
2f55e5a929 Fix various issues in ordering of grouped bindings.
Everything needed to get the CTS tests to work.

Also:

- Change process names to be unique per isolated instance,
  and no longer use isolated uid in proc stats, so we don't
  have a crazy number of process entries there.
- Again move activity manager dumpsys output so we aren't
  spewing less useful stuff at the end where it hides the
  core state about processes.
- Fix protos so that we can read InstrumentationInfo from the
  activity manager protos.  (There was confusion about writing
  protos for a PackageItemInfo vs. an ApplicationInfo.)

Test: atest CtsAppTestCases:ServiceTest\#testActivityServiceBindingLru
Bug: 111434506
Change-Id: I2c86bd1daa582a5c60950173ca12e8ec21b13ead
2018-12-05 11:03:58 -08:00
Christine Franks
ca1fd658ed Merge "Add IColorDisplayManager" 2018-12-05 16:29:51 +00:00
Joel Galenson
b995edac62 Add documentation for passing EXTRA_PERMISSION_NAME to REVIEW_PERMISSION_USAGE.
REVIEW_PERMISSION_USAGE now supports being passed a permission name.
Document that in the comment.

Bug: 120222495
Test: Compile
Change-Id: Iedd2d98b5150bdf21fa80489889a0672d58dd1f2
2018-12-04 17:32:28 -08:00
Eugene Susla
b22f71eafe Log a string to logcat when ContentProvider access gets denied due to appop
Make sure testers have a way to quickly determine when an app is trying to access
call logs or SMS without being the default handler, so we don't get inundated with
bugs about correct behavior

Test: proofread
Change-Id: I46b9dc86073101f8ca08ac1bc90c79338afd114f
2018-12-04 21:16:26 +00:00
Philip P. Moltmann
4468973573 Use pooledLambda in RuntimePermissionPresenterService
And check parameters at trust boundaries

Test: Looked at AppInfo in Settings (uses RuntimePermissionPresenterService)
Change-Id: Ie70f64c1bc5435e1d284c37cc6fec208468b3a0a
2018-12-04 12:50:50 -08:00
David Brazdil
0bf7ab1631 Merge "hiddenapi: Add constants for 'greylist-max-p'" am: ec62f08f8c am: 8a822605d2
am: f29f0de34c

Change-Id: I31647f9e58e86d1bb18891534fcf1e3d4226298e
2018-12-04 03:07:34 -08:00
David Brazdil
f29f0de34c Merge "hiddenapi: Add constants for 'greylist-max-p'" am: ec62f08f8c
am: 8a822605d2

Change-Id: If1b679a373cb4a29405076ee1ebe2df904b793ea
2018-12-04 02:48:00 -08:00
David Brazdil
ec62f08f8c Merge "hiddenapi: Add constants for 'greylist-max-p'" 2018-12-04 10:07:59 +00:00
Felipe Leme
ecb08be22e Split IntelligenceManager / IntelligenceService.
This name is too generic, so we split it in 2 parts:

- ContentCaptureManager: the public API used by views and apps to report their
  structure.
- SmartSuggestionsServiec: the system service use to consume these events and
  provide autofill suggestions.

This CL also:

- Optimizes ContentCaptureManager allocation so they are not created on contexts that are not
  capturing events (such as views from the system server).
- Uses a generic ContentCaptureEventsRequest (rather than a list of events) to make it easier
  to be extended.
- Fixed IntelligencePerUserService so it clears the sessions when the
  implementation changes.

Test: manual verification

Bug: 119776618
Bug: 117944706
Bug: 119638877

Change-Id: I069bcd23dda94afe18b2781fd3981b8b555afa56
2018-12-03 15:29:07 -08:00
Nicolas Geoffray
c64eef6211 Merge "Start using shared libraries class loader." am: e7753e084f
am: 4879460f35

Change-Id: I0d3898a78d116aebb425a9a1cacb5dbac82b3e6d
2018-12-02 13:14:26 -08:00
Nicolas Geoffray
e7753e084f Merge "Start using shared libraries class loader." 2018-12-02 20:39:38 +00:00
Nicolas Geoffray
972b39e4e4 Start using shared libraries class loader.
Change 1/2. Change 2/2 will setup the class loader namespace for
shared libraries.

This change sets up shared libraries class loaders for applications
and for dexopt.

bug: 111174995
Test: DexoptUtilsTest, device boots
Exempt-From-Owner-Approval: PS1 was approved by owner, PS2 is a build fix.

(cherry picked from commit 8d144eb8bd)
Merged-In: Ie9a2b4eaa85cda59951703433f7a2d03bc12095d

Change-Id: I76383308418485ad6739f8a404d02c2771e4afe4
2018-12-02 20:39:29 +00:00
Jeff Sharkey
1bf3db90f4 Revert SQLiteQueryBuilder for now. am: 6c90f1ded2
am: d551877fe8

Change-Id: I663ee9e0f55f9c53cba3cecc9c530470377c5ec9
2018-12-02 11:42:46 -08:00
Jeff Sharkey
3e26b7db55 Extend SQLiteQueryBuilder for update and delete.
Developers often accept selection clauses from untrusted code, and
SQLiteQueryBuilder already supports a "strict" mode to help catch
SQL injection attacks.  This change extends the builder to support
update() and delete() calls, so that we can help secure those
selection clauses too.

Extend it to support selection arguments being provided when
appending appendWhere() clauses, meaning developers no longer need
to manually track their local selection arguments along with
remote arguments.

Extend it to support newer ContentProvider.query() variant that
accepts "Bundle queryArgs", and have all query() callers flow
through that common code path.  (This paves the way for a future
CL that will offer to gracefully extract non-WHERE clauses that
callers have tried smashing into their selections.)

Updates ContentValues to internally use more efficient ArrayMap.

Bug: 111268862
Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Merged-In: I60b6f69045766bb28d2f21a32c120ec8c383b917
Change-Id: I60b6f69045766bb28d2f21a32c120ec8c383b917
2018-12-01 17:23:04 -07:00
Jeff Sharkey
2ea404fd2a Merge "Method to determine isolated storage mode." 2018-12-01 22:37:35 +00:00
TreeHugger Robot
4a18273991 Merge "Deprecate getPreferredPackages() and related APIs" 2018-12-01 05:50:31 +00:00
Eugene Susla
b9df101c9e Merge "Call roles granting only when packages changed" 2018-11-30 23:13:50 +00:00
Nikita Dubrovsky
18a87693a0 Deprecate getPreferredPackages() and related APIs
The APIs for "preferred" packages and activites have been superseded
by modern activity-based preferences.

Bug: 120291723
Test: build (javadoc-only change)
Change-Id: I4242a10e1612f7e203256e4c26c5e8c518cc7656
2018-11-30 21:25:13 +00:00
TreeHugger Robot
e444d218b7 Merge "Revert "Allow location provider to deep link into permissions UI"" 2018-11-30 21:04:35 +00:00
Eugene Susla
abdefbaeeb Call roles granting only when packages changed
This computes and stores a hash of significant (for PermissionController)
packages state for the time when granting last ran.

Test: - enable DEBUG flag
- using logcat ensure roles granted on first bootloader
- adb reboot
- ensure roles granting skipped
- disable a package
- adb reboot
- ensure roles granting ran on boot

Change-Id: Idaea40c0ea34feaedfbe357627201f85e66876d5
2018-11-30 10:58:47 -08:00
Jeff Sharkey
10ec9d8a42 Method to determine isolated storage mode.
Mostly designed for use by tests, but start using it elsewhere in OS
for consistency.

Bug: 119713234
Test: manual
Change-Id: I803671fd84547b75337bebf00c2fa2bdaf0f72e7
2018-11-30 10:52:02 -07:00
Jaewan Kim
c188069fa8 Merge "AML: Make Context#getOpPackageName() public" 2018-11-30 04:49:09 +00:00
TreeHugger Robot
e59ac13c37 Merge "Revert "Honors MATCH_ALL flag"" 2018-11-29 23:38:29 +00:00
Chad Brubaker
125970d828 Fix docs
Test: m docs
Bug: N/A
Change-Id: I9dbc83779cdc6918cf22ed60dbc82bba820af06f
2018-11-29 13:50:49 -08:00
Patrick Baumann
c1050eea66 Revert "Honors MATCH_ALL flag"
This reverts commit 00e8d59af0.

Reason for revert: unintended consequences

Change-Id: Ia4b16a30ce587d083b80dd08007731f5c68b467d
Bug: 35176630
Fixes: 120214031
2018-11-29 21:20:26 +00:00
Chad Brubaker
1a4c431e26 Merge "Add permission usage information" 2018-11-29 20:10:41 +00:00
David Brazdil
5cd148fc7a hiddenapi: Add constants for 'greylist-max-p'
New category of hidden API has been created. Update the script
generate_hiddenapi_lists.py with the new flag name.

Test: m, phone boots
Change-Id: I79e5478678880939e20e500cb8dad9b2a56fc84f
2018-11-29 15:43:02 +00:00
TreeHugger Robot
8dac427f33 Merge "Add new intent to signal that device customization is ready" 2018-11-29 15:05:22 +00:00
Jaewan Kim
0980c7f092 AML: Make Context#getOpPackageName() public
Bug: 119748678
Test: build
Change-Id: I79f7d057df5b61fa661987d36f20d24825eb1e5b
2018-11-29 12:48:38 +09:00
Christine Franks
39b0311db8 Add IColorDisplayManager
- Add IColorDisplayManager
- Add CONTROL_DISPLAY_COLOR_TRANSFORMS permission

Bug: 111215474
Test: atest FrameworksServicesTest:ColorDisplayServiceTest
Change-Id: Ia8182ccc80c1733f00c62b136e7950e2d2092d75
2018-11-28 17:21:30 -08:00
Chad Brubaker
a58ce39e5d Add permission usage information
Applications will be able to add information to their uses-permission
elements about how the data protected by that permission is used.

Currently the system does not use this information, that will be done in
a follow up CL.

Test: atest PermissionUsageTest
Bug: 111207567
Change-Id: Ic168684cc800febc8fb3a3f807e1917f1f1585a4
2018-11-28 13:34:17 -08:00
Martijn Coenen
ce871128cd Merge "Add useAppZygote attibute to <service>." 2018-11-28 08:25:20 +00:00
TreeHugger Robot
bf8d834647 Merge "Switch to idmap2" 2018-11-28 03:42:44 +00:00
Philip P. Moltmann
c20f1b78a9 Revert "Allow location provider to deep link into permissions UI"
This reverts commit ed98828335.

Reason for revert: The exposed API is not needed anymore

Test: Built
Bug: 118437704
Change-Id: I155eb0f7241327b34ea5beaabee514ba2a018998
2018-11-27 17:03:24 -08:00
Mårten Kongstad
fd20b8387d Add new intent to signal that device customization is ready
Add a new intent to be broadcast when a new configuration has been
installed to signal that it is time to reboot the modem, refresh caches,
etc. To receive the intent, recipients must hold the new permission
"android.permission.RECEIVE_DEVICE_CUSTOMIZATION_READY".

This CL registers the intent, but does not send it: that is the
responsibility of the customization client, e.g. Phonesky. The sender is
expected to call PackageManager.sendDeviceCustomizationReadyBroadcast
and hold the new permission "android.permission.SEND_DEVICE_CUSTOMIZATION_READY".

Bug: 118462251
Test: manual (custom apps)
Change-Id: I9a723ca9ade16e8c5d316efbc7effd01e13ff2e7
2018-11-27 15:00:27 -08:00
TreeHugger Robot
dbbcf07ec5 Merge "Removes ASEC-related logic from the framework" 2018-11-27 22:32:35 +00:00
TreeHugger Robot
e3a6d9450a Merge "Add "dictionary" entity type" 2018-11-27 21:51:45 +00:00
Mårten Kongstad
b87b507248 Switch to idmap2
Switch from idmap to idmap2.

This CL is the safety pin for idmap2. If idmap2 causes issues during
dogfooding it is easy go back to idmap by reverting this CL.

Once idmap2 has proven itself during a suitable period of time, the
FEATURE_FLAG_IDMAP2 flag and the obsolete idmap code will be removed.

Also add an .rc file to tell init to launch idmap2d.

Bug: 78815803
Test: atest OverlayDeviceTests OverlayHostTests
Change-Id: I5ca1388ac2f8a9379fed0c257247d351a5c7a3c4
2018-11-27 13:37:34 -08:00