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
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
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
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
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
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
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
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
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
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
This CL was created by running
m api-stubs-docs-update-current-api
Test: CtsIcuTestCases
Bug: 125283072
Change-Id: If60da6b9f0eeed09397b52b4150e98175f1c62d4
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
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
The method was marked @removed in Oreo.
Bug: 135214188
Test: atest android.app.cts.KeyguardManagerTest
Change-Id: I4fad1b7262ff8f2c40d7e3c178699e64241a9bd6
It was marked @removed in Pie. Now removing it from the code.
Bug: 135214188
Test: atest FrameworksMockingServicesTests
Change-Id: Id8bdf28d8d10a767f54af1bf421185e179c0379a
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
The method was marked @removed in Oreo. Finally removing it from code.
Bug: 135214188
Test: Android builds
Change-Id: I54a709c75bb99f248f65ccb65ac92c4a8a9f9da5
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
This reverts commit 1600c5a6152d0e643d6eab1896f798ec5d9a2439.
Reason for revert: Rolling forward for Q-Finalization
Bug: 129975435
Change-Id: I1ffb8162cb5e6f386fd3c417fabfd4298ef86ffd
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
This reverts commit f6ed8afa405dfae445a16f7433e4d8a9f20115b9.
Reason for revert: QT SDK Finalization. Will be merged again on/after May 13th
Bug: 129975435
Change-Id: If94098b7cc9cf75cf9782d2b70e01881f9c40430
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
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
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