Commit Graph

4530 Commits

Author SHA1 Message Date
Yueming Wang
3dc2f1ef59 Merge "Add API to view calendar events cross profile." 2018-12-12 19:07:05 +00:00
TreeHugger Robot
02e7db9b6a Merge "Updates to Settings.Config and SettingsProvider for the DeviceConfig API surface." 2018-12-12 07:39:54 +00:00
Jeff Sharkey
5d952bf4b1 Merge "People still need the old method signatures." 2018-12-12 00:01:09 +00:00
yuemingw
369f96dd98 Add API to view calendar events cross profile.
Bug: 118456236
Test: .manual by TestDPC
cts test will be added later
Change-Id: I0d36586ea6017dea446abd8e609c2712ba88e93c
2018-12-11 22:20:33 +00:00
Jeff Sharkey
f9eeca1364 Merge "Surface tree statistics through metadata." 2018-12-11 21:13:25 +00:00
Jeff Sharkey
14101c709c People still need the old method signatures.
Keep the old methods around for code that expects to find them with
the ContentResolver type.

Bug: 120846329
Test: manual
Change-Id: Id9c10525e63ecc8fbf9a249bfe7a5de755a0ceb4
2018-12-11 13:55:48 -07:00
Matt Pape
c1323dc7db Updates to Settings.Config and SettingsProvider for the DeviceConfig API surface.
Remove tags from Settings.Config, as we don't need them for anything yet. Add resetMode and prefix args to the reset call. Remove references to user IDs for config table methods. Force settings state to stop treating all values set by system packages as the new default value, for the config table only.

Test: atest SettingsProviderTest:DeviceConfigServiceTest
      atest FrameworksCoreTests:SettingsProviderTest
Bug:109919982
Change-Id: Ia80c65ac6c0a91ab2b36742e6d446918acbb2f45
2018-12-11 12:32:42 -08:00
Jeff Sharkey
b867b4c49e Merge "Iteration on contributed media APIs." 2018-12-11 18:49:20 +00:00
Jeff Sharkey
b95bd4429c Surface tree statistics through metadata.
As part of storage privacy work in Q, we're trying to help users
understand the impact of OPEN_DOCUMENT_TREE choices, and the best way
is to show statistics about what's actually contained inside a tree.

Define "count" and "size" statistics, and populate them for all
FileSystemProvider instances.

Bug: 117975747
Test: atest android.provider.cts.DocumentsContractTest
Change-Id: Ib3f8f208c619141c26abaee0137641f12b009c8f
2018-12-11 11:02:34 -07:00
Jeff Sharkey
dc50d4ca38 Iteration on contributed media APIs.
Offer an explicit DELETE_CONTRIBUTED_MEDIA flag that can be used when
uninstalling an app to indicate that any contributed media should be
deleted.

Adjust APIs to accept a specific UserHandle so we can pre-flight
check for valid UserManager state.

Bug: 116344240
Test: atest android.provider.cts.MediaStoreTest
Change-Id: Ief0ba27c913791d60f86a5d7252525c9c4539fc6
2018-12-11 09:43:13 -07:00
Jeff Sharkey
630c30830e Merge "Add MediaStore.Downloads.CONTENT_TYPE." 2018-12-11 16:37:20 +00:00
TreeHugger Robot
49b86ef6f0 Merge "Apply signed config on package upgrade/install." 2018-12-11 11:46:02 +00:00
Mathew Inwood
1b1639dbc7 Apply signed config on package upgrade/install.
Signature check is not implemented yet, so no configuration can be
applied yet.

Tested with CTS test & follow up changes in later CLs.

For future reference:
Test: atest CtsSignedConfigHostTestCases

Bug: 110509075
Change-Id: I2d2f15d38ec0f1755e21e6e5ab5c82d94aa592a4
2018-12-11 10:59:44 +00:00
Sudheer Shanka
a50f1a35dd Add MediaStore.Downloads.CONTENT_TYPE.
Bug: 120493417
Test: manual - add files using mtp
Test: atest MediaProviderTests
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I99e280b3df4a16c2b4dbe762fbdedb2770c545dc
2018-12-10 19:14:59 -08:00
Annie Meng
a6d828755e [Multi-user] Create setting for multi-user backup service support
Whether the backup service supports multi-user is now configured in a
Global setting: backup_multi_user_enabled

This allows us to develop multi-user support hidden behind a flag. In a
future CL, we'll also gate the types of users we support.

Also create basic infrastructure for starting the service for a newly
unlocked user (currently a no-op).

Bug: 120212806
Test: 1) atest TrampolineTest
2) adb shell settings put global backup_multi_user_enabled 0;
   unlock system user -> verify service started;
   unlock user 10 -> verify service not started;
3) adb shell settings put global backup_multi_user_enabled 1;
   unlock system user -> verify service started;
   unlock user 10 -> verify service started;

Change-Id: I048e017cfa6148097cebe2eb2916d1b53c53d3b0
2018-12-10 12:33:28 +00:00
Tor Norbye
3332cd5b26 Attempt to fix docs build
Change-Id: Iad19b8913d1e789755c1c6c1786f5ad204a67ee7
2018-12-09 09:28:46 -08:00
Jeff Sharkey
d746ce3a5a Merge "APIs to measure and delete contributed files." 2018-12-09 00:55:17 +00:00
Tim Van Patten
636beebaf0 Merge "Update ANGLE Developer Options" 2018-12-08 22:57:34 +00:00
Jeff Sharkey
9efa7b8020 APIs to measure and delete contributed files.
In the new isolated storage world, apps can "contribute" media that
belongs to the user, which normally means it won't be deleted when
that app is uninstalled.  However, we're anticipating that some apps
might abuse this API to preserve data the user actually wants to
delete during uninstall.

This set of changes introduces new APIs to measure and delete these
contributed media items, along with tests to verify.

Bug: 116344240
Test: atest android.provider.cts.MediaStoreTest
Change-Id: Ib740e0ea74378569572cb17640ef607aaa6baf1f
2018-12-08 14:04:34 -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
yuemingw
b714ba0ccc Add cross profile uri for Events and Calendars table in CalendarContract.
Bug: 118455064
Test: runtest -x packages/providers/CalendarProvider/tests/src/com/android/providers/calendar/CalendarProvider2Test.
Change-Id: Ic1f4dda7633ed8739e100c54c6413acf236c6808
2018-12-07 22:06:33 +00:00
Tim Van Patten
3c61284416 Update ANGLE Developer Options
Update ANGLE developer options to allow selecting the OpenGL driver
(default, ANGLE, native) for each app as well as forcing ANGLE for all
apps.

Bug: 118384925
Test: Verify the default/ANGLE/native values are saved and applied and
used by the loader.

Change-Id: I189889b9b780eabe812298c0dd02838f70f97a03
2018-12-07 21:06:58 +00:00
Matt Pape
f31d03c9cf Merge "Add reset and list for device config flags to SettingsProvider to support command line debug tool." 2018-12-07 16:27:59 +00:00
Milo Sredkov
0b243df366 Merge "Create SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS" 2018-12-07 14:13:47 +00:00
Ivan Chiang
919cad6ce4 Merge "Expose @SystemApi and @Public for unbundling DocumentsUI" 2018-12-07 07:26:47 +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
Matt Pape
6bfc62e496 Add reset and list for device config flags to SettingsProvider to
support command line debug tool.

Test: atest FrameworksCoreTests:SettingsProviderTest
      Further tested manually via command line (see ag/5613024)
Bug:109919982
Bug:113101834
Change-Id: Ib0d9e4c6d806ec3521ac49b8c05fbdad8b5b13d7
2018-12-06 14:06:37 -08:00
Milo Sredkov
d8cacd5bec Create SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS
Create Global.SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS. This will
contain flags that control the automatic generation of suggestions in
notifications (smart actions and smart replies).

Bug: 111437455
Test: atest SettingsBackupTest
Change-Id: I91252d3e0f3d51000f6115a520d7054832fda1ce
2018-12-06 15:07:39 +00:00
Jeff Sharkey
8f18e25afa Merge "Get CtsProviderTestCases targeting modern SDK." 2018-12-06 06:32:30 +00:00
Jeff Sharkey
52ba19b50b Get CtsProviderTestCases targeting modern SDK.
Grant tests the "write_settings" appop they needs to run, and test
against well-known key.

Move away from FileCopyHelper, which uses deprecated
MODE_WORLD_READABLE mode.  Define TestSRSProvider to get a valid
provider to notify against.

Bug: 120429729, 120577010
Test: atest CtsProviderTestCases
Change-Id: I5b78ee2df66562f1356aa36c3c92781c5aca5d43
2018-12-05 21:05:17 -07:00
TreeHugger Robot
797aa66e71 Merge "Add query argument QUERY_ARG_EXCLUDE_MEDIA" 2018-12-05 21:22:35 +00:00
TreeHugger Robot
0492440cd9 Merge "Changed how the Smart Suggestions service is defined." 2018-12-05 16:15:50 +00:00
Ivan Chiang
b26b09fec1 Expose @SystemApi and @Public for unbundling DocumentsUI
1. Expose @Public for query arguments and flags.
2. Expose @SystemApi for related manageMode apis and some
   related storage flag in Root.
3. Add new isChildDocument method to support ContentResolver
   parameter and expose it @Public.
4. Expose @Public for getDocumentMetadata related methods.

Bug: 117634543
Test: make, make api-stubs-docs-update-current-api,
Change-Id: Ib172d46ba9727c35277fb285d3a09380fe106697
2018-12-05 17:06:05 +08:00
TreeHugger Robot
f4764351fc Merge "Add USB_ALARM_TEMPERATURE in SettingsProvider" 2018-12-05 07:02:14 +00:00
Ivan Chiang
1edfcb2517 Add query argument QUERY_ARG_EXCLUDE_MEDIA
Use the argument to decide whether the files that have been
added to MediaStore should be excluded. If the value is true,
exclude them. Otherwise, include them.

Bug: 119390918
Test: manual
Change-Id: I245e4303a265a95b30400083841c593b66c4d960
2018-12-05 14:08:02 +08:00
Jeff Sharkey
9246fc7616 Merge "Stop indexing location metadata." 2018-12-05 05:46:18 +00:00
Edgar Wang
495b657b97 Add USB_ALARM_TEMPERATURE in SettingsProvider
In terms of the feature of USB overheat warning, SettingsProvider needs the implementation for the integration.

Bug: 118794842
Test: Build, flash and boot, verify
Change-Id: I41aacd5a7ed7ab1ce0212e7d2520e3c51d7d3bc1
2018-12-05 02:09:08 +00:00
Felipe Leme
658c8e423f Changed how the Smart Suggestions service is defined.
Initially it was defined as secure Settings, but the proper way is to let the
OEMs set it by overlaying a framework resources, which an option to temporarily
override that setting using a Shell cmd (so it can be changed on CTS tests).

This CL also changes how the service can be explicitly enabled / disabled at
the time the system starts, so it can be disabled by a server-push in case of
emergencies (and also manually enable by developers when running the CTS tests
on AOSP builds).

Bug: 119776618
Bug: 111276913
Bug: 117779333

Test: adb shell settings put global \
   smart_suggestions_service_explicitly_enabled true && \
   sleep 10s && \ adb shell stop && adb shell start \
   atest CtsContentCaptureServiceTestCases
Test: atest FrameworksCoreTests:SettingsBackupTest
Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break
Test: m -j SettingsProvider

Change-Id: Ibd1bba0c0d534b4b6344516d8ff893142785a57a
2018-12-04 17:46:49 -08:00
Jackal Guo
b03bf399ee Merge "Make A11Y_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED as SystemApi" 2018-12-05 01:07:58 +00:00
Jeff Sharkey
33e70bd6d2 Stop indexing location metadata.
The new ACCESS_MEDIA_LOCATION permission is designed to protect
the location metadata of items the caller doesn't own, but we can't
easily perform partial filtering of metadata from returned Cursor
objects based on per-row ownership, so we're forced to outright stop
indexing and returning location metadata via queries.

Apps can still easily obtain location metadata using ExifInterface.

Bug: 111892141
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I4d99e6aa7d94bb0e7a50ce86eb1ab0f1ed142d4a
2018-12-04 13:17:09 -07:00
Dan Shi
86a685147a Remove TEST_MAPPING due to AJUR filter behavior
AJUR can't support mixed filters of class and package. There are 2 other
TEST_MAPPING files containing about 6 tests using filter on package.

Once b/117880789 is fixed, we can add this TEST_MAPPING file back.

Bug: 120462824
Test: None
Change-Id: Iafa0286c18f2c6fd77c5b603a72882e710cef6ee
2018-12-04 11:46:14 -08:00
Jeff Sharkey
f660c012b0 Merge "Add support for "Audiobooks"." 2018-12-04 16:58:17 +00:00
TreeHugger Robot
d380bd78bb Merge "Select closest font's style for backward compatibility" 2018-12-04 10:10:11 +00:00
Seigo Nonaka
68d1d5ae7e Select closest font's style for backward compatibility
Bug: 119425212
Test: atest CtsGraphicsTestCases
Test: atest CtsContentTestCases:android.content.res.cts.ResourcesTest
Change-Id: I796baf342f752366040b657954b0f82d358a7790
2018-12-03 20:16:26 -08:00
Jeff Sharkey
628d2e6888 Merge "Redact location Exif tags when no permission." 2018-12-04 01:28:37 +00:00
Jeff Sharkey
cb39499354 Redact location Exif tags when no permission.
When the caller doesn't hold the ACCESS_MEDIA_LOCATION permission,
any location Exif tags should be redacted for privacy reasons.  We
still allow unredacted raw file access if the media is owned by the
calling app, since they should be able to see data they contributed.

Certain backup apps really want to see the original contents without
any redaction, so provide them a setRequireOriginal() API so they
get a strong exception whenever the original bits can't be provided.

Add the ability to open a redacted file for read/write access by
stopping redaction for any ranges that have been overwritten with
new data, along with tests to verify this behavior.

Extend "content" tool to bind null values.

Bug: 111892141
Test: atest android.os.RedactingFileDescriptorTest
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I47b220036a712d9d49547196b90e031b10760f84
2018-12-03 12:57:09 -07:00
Jackal Guo
6e0396d5b0 Make A11Y_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED as SystemApi
Change this constant to @SystemApi for SUW unbundling.

Bug: 117749852
Test: a11y CTS & unit tests, and SettingsProviderTest
Change-Id: I3b88a024d009a28fa8e7c02fe2ef292c657b44be
2018-12-03 16:10:07 +08:00
Philip P. Moltmann
c9907ce3e8 New settings for testing permission controller
The settings are used to reduce the runtime of the location access
permission controller tests.

Bug: 120303361
Test: atest CtsPermissionTestCases:android.permission.cts.LocationAccessCheckTest
      atest --test-mapping frameworks/base/core/java/android/provider/:presubmit
Change-Id: I47ed218dc0a300f73a1c0308fce60b61e6a423b0
2018-12-01 17:03:31 -08:00
Jeff Sharkey
10887d5e5a Add support for "Audiobooks".
Bug: 113356944
Test: manual
Change-Id: Ifed54c41a533ed2d556dc6561ea498ec293991a6
2018-11-30 13:53:19 -07:00