246 Commits

Author SHA1 Message Date
Michael Wright
b6ffb2293e Remove replaced BubbleMetadata methods from SDK.
Prior to finalization, we need to remove all methods which were
replaced but kept around for short-term compatibility purposes.
BubbleMetadata had a few methods that fell into this category that had
yet to be removed.

Bug: 152761169
Test: build
Change-Id: Ic9f8d600721e15119fc28d308ff1bc444d61e399
2020-03-30 19:02:37 +01:00
Philip P. Moltmann
12ac3f406f Rename featureId -> attributionTag
In the core functionality this changes everything including aidl's and
field names:
- Context
- ContentProvider
- AppOps*
- Package parsing

For the rest, this is a shallow change to only change to the changed
APIs. This keeps the change small-ish

Exempt-From-Owner-Approval: Rename
Fixes: 148792795
Test: TH
Change-Id: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
Merged-In: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
2020-03-12 19:26:10 +00:00
Jeff Sharkey
8b0cff7108 Give hidden API behavior to legacy apps.
Starting in R, there is a new public API overload that delivers a
flags argument.  Some apps may be relying on a previous hidden API
that delivered a userId argument, and this change is used to control
delivery of the new flags argument in its place.

There are dozens of these hidden API users are in the system UID,
either in the system process or the Settings app, so we hard-code
giving them the legacy behavior, since refactoring would be messy
between internal and AOSP branches.

Also adjust incoming and outgoing method signatures to use slightly
more flexible Collection<Uri>, which has handy methods like
contains() and isEmpty().

Bug: 150939131
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If6a77449e19215cf1c60d4217e62fc04b0959bfc
2020-03-10 16:36:21 -06:00
Jeff Sharkey
1fec28066f Adjustments after moving MediaStore inside APEX.
The "core_platform" SDK technically includes non-stable APIs, so we
need to shift to "core_current" instead.

While we're here, tidy up some older @removed APIs that never shipped
and replace HexEncoding with a local implementation.

Since MediaProvider itself is free to use @hide APIs from its own
framework code in MediaStore.java, we can include all sources
from "framework-mediaprovider-sources" directly.

Also since the "framework-annotations" filegroup in Android.bp is
a very limited subset of leaf source code, it can't directly
reference Intent, so adjust the javadoc so we can drop the "import."

Bug: 144247087
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I198d84a755b5e270a19b41328f6a6e152112c40a
2019-12-20 13:52:40 -07:00
Jeff Sharkey
04b4ba1e15 Shuffling to prepare for MediaProvider APEX.
An upcoming change will move MediaStore to be within the recently
created MediaProvider APEX.  This means that MediaStore will need to
be fully built against @SystemApi, and so this CL adjusts APIs to
support a clean transition:

-- Listing of "recent" storage volumes and scan paths for "internal"
storage is now handled by StorageManager directly, so that partners
retain control over what is deemed recent.
-- StorageVolume now returns the MediaStore volume name and the
filesystem directory where its contents are presented to apps.
-- Conversion of legacy thumbnail "kind" values to dimensions now
happens directly inside MediaStore.
-- PendingParams and PendingSession are completely removed.
-- Contributed media APIs are completely removed.
-- Media for demo users is now surfaced as a unique StorageVolume.
-- Migrate most MediaStore APIs to accept ContentResolver, which
supports easy usage of ContentResolver.wrap().

Bug: 144247087, 137890034
Test: atest --test-mapping packages/providers/MediaProvider
Exempt-From-Owner-Approval: in-place refactoring
Change-Id: I445528b2779bb37b9f2558e67a3cfc9f60412092
2019-12-18 01:35:46 +00:00
Jeff Sharkey
dd81924202 Methods to streamline bulk media operations.
The new storage model being built in Android Q and R means that most
apps will now be limited to read access to most media items on the
device.  This change adds a way for developers to request a user to
grant narrow access to specific media items.

This supports operations like requesting write access, trash/untrash,
favorite/unfavorite, and outright delete.  Once the user confirms the
action in the dialog, the action is carried out with no further
action needed by the caller.

We transport the set of Uris through a ClipData to pave the way for
shifting to ParceledListSlice in a future release.

Since there's many permutations of strings needed, generate them
with a simple Python script to ensure they stay consistent.

Bug: 141911164
Test: atest --test-mapping packages/apps/MediaProvider
Test: atest CtsAppSecurityHostTestCases:android.appsecurity.cts.ExternalStorageHostTest#testMediaEscalation
Change-Id: I2eb3775550ed27c2863af1edc362471e4cb48643
2019-12-16 12:21:41 -07:00
Jeff Sharkey
0fa31f6950 Introduce QUERY_ARG_MATCH_* values for filtering.
The existing strategy of methods like setIncludePending() doesn't
scale well for callers to use multiple matching strategies.  For
example, callers are interested in these matching strategies:

MATCH_EXCLUDE: Ensure that any matches are excluded.
MATCH_INCLUDE: Ensure that any matches are included.
MATCH_ONLY: Return only exact matches.

The reason why we have this menu of options is because the underlying
fields have different default behavior.  For example, "trashed" items
are naturally excluded by default, but "favorite" items are naturally
included by default.

Callers only interesting in listing "trashed" items or "favorite"
items shouldn't need to perform their own inefficient Cursor diffing
logic, so we give them these flexible arguments.

Adjust MediaProvider internals to apply these matcher values to
all update() and delete() calls, in addition to query().

Bug: 143432502
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I0d4bc063b8ea5ac2a602fab43a62c2de7724ba34
2019-11-23 10:54:10 -07:00
Soonil Nagarkar
4af3b8d14e Re-add incorrectly removed API
addNmeaListener was incorrectly removed in Q, breaking backwards
compatibility. Re-adding in R so that apps can continue to compile
against R while working on older platforms.

Bug: 141019880
Test: na
Change-Id: I527e73dcdb30fa4af8ca91bcfe113b2aa7bc87a5
2019-11-12 12:09:52 -08:00
Chen Xu
9c1260c818 SystemAPI for ACTION_SMS_EMERGENCY_CB_RECEIVED intent
Bug: 135956699
Test: Build
Change-Id: Ic7124f30fae6faa482467fd9235ef6155854f589
2019-11-07 13:41:07 -08:00
Jeff Sharkey
7b75fe5257 Reconcile MediaStore with MediaMetadataRetriever.
Over the last year we've been converging on saying that MediaProvider
is an indexed view of values that developers can obtain directly from
MediaMetadataRetriever.  This change starts indexing several fields
of interest to bring these two surfaces into sync.

Since we're going to be asking MediaMetadataRetriever about audio,
video, and image files, it could return any metadata values for any
of those file types, so we're adding and promoting fields up to the
MediaColumns level.

Bring back APIs related to "trashing" media items; they had been in
place for the last release, but were hidden until we had firm
requests to add them, and partners have now requested them.  Also
add APIs for marking media items as "favorite", as requested by
partners.

Bug: 135343128, 142478744, 122025511, 142498573
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: Ie839ec1b2eed621786d0d10f35a061cbc52f192b
2019-10-29 16:03:20 -06:00
TreeHugger Robot
0ac25af13a Merge "Removing @Deprecated && @removed method from KeyguardManager." 2019-08-29 20:32:46 +00:00
Jeff Sharkey
ec19e9b107 Public APIs for ID-specific Uris, misc items.
We have getContentUri() for entire collections of items, but we
only have ID-specific overloads for some of the MediaStore classes;
let's get them all added for consistency.

Remove primary/secondary directory logic, which was replaced by
new RELATIVE_PATH column before Q launched.

Bug: 137890034
Test: atest --test-mapping packages/providers/MediaProvider
Exempt-From-Owner-Approval: trivial API refactoring
Change-Id: Iae4e7fe57adff071c35af459e31223a1fd05fef2
2019-08-22 14:43:24 -06:00
vichang
68dd1b1995 Merge "API updated for ICU4J 64.2" am: 0473b08b6b am: 7adad11ea2 am: 10bba25eb0 am: e5582d92d6
am: e2575b08bf

Change-Id: Ib9f9141aea6773f7979bb87d72921a54f371d3ff
2019-08-07 05:12:54 -07:00
vichang
7adad11ea2 Merge "API updated for ICU4J 64.2"
am: 0473b08b6b

Change-Id: Ic7b3702100d989abdc387a91f19c9017f35948e9
2019-08-07 04:13:35 -07:00
Nikita Iashchenko
476db6e889 API updated for ICU4J 64.2
This CL was created by running
m api-stubs-docs-update-current-api

Test: CtsIcuTestCases
Bug: 125283072
Change-Id: If60da6b9f0eeed09397b52b4150e98175f1c62d4
2019-07-25 20:12:53 +01:00
TreeHugger Robot
89a82157ab Merge "Remove @Deprecated && @removed method in ClipData." 2019-07-17 20:18:16 +00:00
TreeHugger Robot
892aa9660e Merge "Remove @Deprecated && @removed methods from DevicePolicyManager." 2019-07-10 03:05:27 +00:00
TreeHugger Robot
f59b0456ef Merge "Re-hide ApplicationInfo.volumeUuid." 2019-07-10 01:38:30 +00:00
Kweku Adams
37f389c6ac Remove @Deprecated && @removed methods from DevicePolicyManager.
They were marked for removal in Nougat.

Bug: 135214188
Test: Android builds
Change-Id: I2c5fc0a8264bd67dbd7e583ebb687e771c873378
2019-07-09 14:30:48 -07:00
Kweku Adams
9ce47aae11 Re-hide ApplicationInfo.volumeUuid.
The @hide annotation was removed during Oreo development but then
storageUuid was created instead to be the public field. Changing
volumeUuid back to @hide since the system still uses it.

Bug: 135214188
Test: Android builds
Change-Id: I8b3c544daecfe43f5a725ea3080d90a167dcc463
2019-06-21 13:23:33 -07:00
Kweku Adams
316b14147d Remove deprecated & removed JobInfo methods.
These methods were marked deprecated and tagged with @removed
before Pie shipped but ConnectivityController wasn't updated to perform
the proper computations. This removes the deprecated methods altogether
and updates ConnectivityController accordingly.

Bug: 135214188
Test: atest com.android.server.cts.JobSchedulerIncidentTest
Test: atest com.android.server.job.controllers.ConnectivityControllerTest
Test: atest com.android.providers.downloads.DownloadProviderFunctionalTest
Change-Id: I7c364a4326c31e8aae54a4fc69703434d8c7c915
2019-06-21 11:39:28 -07:00
TreeHugger Robot
f62b91043c Merge "Remove @Deprecated && @removed hardware methods." 2019-06-21 00:51:31 +00:00
TreeHugger Robot
e493e60354 Merge "Remove SystemClock.uptimeMillisClock()." 2019-06-20 20:06:53 +00:00
TreeHugger Robot
9562bc95cb Merge "Remove @Deprecated && @removed package fields." 2019-06-19 21:42:39 +00:00
Kweku Adams
091fa30767 Remove @Deprecated && @removed package fields.
They were tagged as @removed in Nougat and Oreo.

Bug: 135214188
Test: Android builds
Change-Id: Id52c23d02e2c4b7781c9b138ac2cf29cbf70c09c
2019-06-17 16:25:51 -07:00
Kweku Adams
f069991cf4 Removing @Deprecated && @removed method from KeyguardManager.
The method was marked @removed in Oreo.

Bug: 135214188
Test: atest android.app.cts.KeyguardManagerTest
Change-Id: I4fad1b7262ff8f2c40d7e3c178699e64241a9bd6
2019-06-17 15:31:43 -07:00
Kweku Adams
bde8ba4100 Remove SystemClock.uptimeMillisClock().
It was marked @removed in Pie. Now removing it from the code.

Bug: 135214188
Test: atest FrameworksMockingServicesTests
Change-Id: Id8bdf28d8d10a767f54af1bf421185e179c0379a
2019-06-17 15:03:37 -07:00
Kweku Adams
26166043f6 Remove @Deprecated && @removed hardware methods.
The methods were marked @removed in Oreo. Finally removing it from code.
SensorDirectChannel.isValid is currently used by Roboelectric so it will
have to be removed separately.

Bug: 135214188
Test: Android builds
Change-Id: Ib357ad76654326d94f6873102de22451bf4f5b59
2019-06-17 14:15:40 -07:00
Kweku Adams
e70e6e5f4d Remove @Deprecated && @removed method in ClipData.
The method was marked @removed in Oreo. Finally removing it from code.

Bug: 135214188
Test: Android builds
Change-Id: I54a709c75bb99f248f65ccb65ac92c4a8a9f9da5
2019-06-17 12:16:00 -07:00
Kweku Adams
8fbd9bfab5 Remove PictureInPictureArgs.
The class was marked @Deprecated and @removed in Oreo but stuck around
despite not being used.

Bug: 135214188
Test: flash device and confirm PiP still works
Change-Id: I34c5043a1e4ee6639f7fae4d114c247bc3fe810c
2019-06-14 18:39:15 -07:00
Ian Pedowitz
dc6e6cb522 Merge "Revert "Revert "Removing deprecated APIs added to Q""" into qt-dev
am: 028b649f71

Change-Id: Iaea4b1d980a21469a74f6571b7e41c4db070594f
2019-05-15 18:04:33 -07:00
Ian Pedowitz
164aa62fb2 Merge "Revert "Revert "Removing deprecated APIs added to Q""" into qt-dev
am: 028b649f71

Change-Id: Ifa06fa782c807fe282f38b028f33dbb481c0ddcc
2019-05-15 13:42:34 -07:00
Ian Pedowitz
cece8d3bd5 Revert "Revert "Removing deprecated APIs added to Q""
This reverts commit 1600c5a6152d0e643d6eab1896f798ec5d9a2439.

Reason for revert: Rolling forward for Q-Finalization

Bug: 129975435
Change-Id: I1ffb8162cb5e6f386fd3c417fabfd4298ef86ffd
2019-05-12 19:46:31 +00:00
vichang
315612d912 Merge "Remove JapaneseCalendar.CURRENT_ERA from Android public SDK" am: 5d84cbd007
am: f699773fbd

Change-Id: I70c18d94e9a79696d2aef72e6dd37f9ca8561ab3
2019-05-03 11:37:18 -07:00
Victor Chang
8d69313c3f Remove JapaneseCalendar.CURRENT_ERA from Android public SDK
JapaneseCalendar.CURRENT_ERA is final static int, and the developer
may mis-use and could have wrong expectation on this API, since
1. New emperor in Japan could result in a new era, but old Android device
   still provides an outdated "current" era.
2. Developer may expect its value depending on system time. However,
   given it's a static final int,
   Android could intiailize the value at boot with an incorrect time,
   and thus results in incorrect era. Thus, on Android, The value is
   always hard-coded.

Bug: 131893534
Test: make
Change-Id: I16ea841975dd8e913409c884123003f842c55bb8
2019-05-03 14:28:20 +01:00
Ian Pedowitz
1600c5a615 Revert "RESTRICT AUTOMERGE Removing deprecated APIs added to Q"
This reverts commit f6ed8afa405dfae445a16f7433e4d8a9f20115b9.

Reason for revert: QT SDK Finalization. Will be merged again on/after May 13th

Bug: 129975435
Change-Id: If94098b7cc9cf75cf9782d2b70e01881f9c40430
2019-05-02 00:56:02 +00:00
Suprabh Shukla
f6ed8afa40 RESTRICT AUTOMERGE Removing deprecated APIs added to Q
Test: Builds, boots

Bug: 129975435
Change-Id: If083957effedf7987b200c366f65d6863b99bca1
2019-05-01 14:04:37 -07:00
Jeff Sharkey
5e1ca0e889 Remove GROUP_ID; not actively being used by apps.
Bug: 130744218
Test: none
Change-Id: I2917b84ffcc698d3cbffe7dfbd49c76b21c46515
2019-04-17 13:35:16 -06:00
Sudheer Shanka
3c60d28729 Deprecate MediaStore.DownloadColumns.DESCRIPTION.
Bug: 130226648
Test: manual
Change-Id: I020d681e988eaa37871994860bea5ae2ab81d10e
2019-04-12 15:29:05 -07:00
Jeff Sharkey
fc24615213 Promote generic columns up to MediaColumns.
Based on feedback from developers, they need to query these columns
on the general "Files" table, so we need to promote them to the
general "MediaColumns" common interface to make them available.

Bug: 130254706
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I66afa14799ae42deea519d121177b2c8469889ab
2019-04-12 11:52:18 -06:00
Jeff Sharkey
586d3c013a Split VOLUME_EXTERNAL and VOLUME_PRIMARY.
To let developers focus on specific concrete storage devices in Q,
we need a volume name that can be used to point at the primary
external storage device.  We had been using VOLUME_EXTERNAL for that,
but we've heard that certain apps are making deep assumptions that
media item IDs are globally unique across all volumes.

Thus these changes merge all volumes back into a single underlying
database, and VOLUME_EXTERNAL works with all of the currently
attached volumes.  The new VOLUME_PRIMARY name can be used to focus
on the primary storage device when desired.

When developers try inserting items directly into VOLUME_EXTERNAL,
we gracefully assume they meant VOLUME_PRIMARY.

Bug: 128451765
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I682ff6e9aaab4f5315a46c9825313a438548c7e6
2019-04-10 09:35:14 -06:00
Jeff Sharkey
f998670075 Respond to API feedback on DIRECTORY columns.
Internal feedback asked for more documentation, and feedback from
external teams (at least Photos and Camera) was the ability to store
files at arbitrary directory depths.

We now offer a single PATH column, which gives callers more precise
control over file placement.  The old DIRECTORY columns remain
intact for now, and are temporarily accepted to support apps
developing against the preview SDKs.

Bug: 127657692, 123967243
Test: atest MediaProviderTests
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Icd90d7c89d066d4ab68aa2f543ccc6fbc3b4f596
2019-03-21 11:52:01 -06:00
Mark Chien
58f6df7123 Merge "Remove deprecated entitlement API" am: 36459170a7 am: 6f86953a39
am: d9fbd454de

Change-Id: I6bb5611de8d45e9a5c17128ea38ba1bdd8f86ac2
2019-03-18 20:38:36 -07:00
Soonil Nagarkar
09a3ce7c44 Revert API removal
Bug: 128842115
Test: manual
Change-Id: Iff8e1a1c4c9dd6d089d0af6527bdd74ee38fa421
2019-03-18 13:53:33 -07:00
markchien
846e49943d Remove deprecated entitlement API
The deprecated entitlement APIs[1] is introduced in the Q
development cycle. It should be replaced by new APIs[2][3].

[1] https://android-review.googlesource.com/c/platform/frameworks/base/+/874220
[2] https://android-review.googlesource.com/c/platform/frameworks/base/+/920354
[3] https://android-review.googlesource.com/c/platform/frameworks/base/+/927513

Test: -build, flash, boot
bug: 126701557
bug: 126392011
Change-Id: I96487e9038c07363680a76db840994719d7ff768
2019-03-15 09:03:50 +00:00
TreeHugger Robot
9c5458edb7 Merge "Remove deprecated Settings APIs." 2019-03-14 17:06:04 +00:00
Soonil Nagarkar
a491b7abb1 Revert removal of GpsStatus APIs
Bug: 126698813
Test: manual
Change-Id: I174d3f4cd21259e59381fc79990005c644380065
2019-03-13 17:36:44 -07:00
Soonil Nagarkar
6dac9d1bf5 Remove deprecated Settings APIs.
Bug: 128348646
Test: manual
Change-Id: I40dbfc78ee983ffacc56a68d2c5ba2aefb16357f
2019-03-13 10:13:31 -07:00
Mark Chien
340107f508 Merge "Fix TetheringEntitlementValueListener related API" am: fbcc63d51f am: 16c5a5c6f4
am: 95ca226658

Change-Id: I9a1f7c9fa34b6f1e6104a8e5af4b6957e7aae3eb
2019-03-07 05:51:10 -08:00
markchien
9554abf9ed Fix TetheringEntitlementValueListener related API
Test: -build, flash, boot
      -atest FrameworksNetTests
bug: 126701557
bug: 126392011

Change-Id: I6dda10fbfe8ffaef71269617750a22563396f5ea
2019-03-07 13:33:21 +08:00