summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2025-09-18[SP 2025-09-01] Fix misuse of MediaProvider#INCLUDED_DEFAULT_DIRECTORIESbanksia-dev Dipankar Bhardwaj
MediaProvider#INCLUDED_DEFAULT_DIRECTORIES is internally used to grant access for file rename based on relative path. It can be misused by setting it in the bundle. Updated the code to stop using this extra and stope respecting it in AccessChecker class. Test: atest MediaProviderTests Bug: 415783046 Flag: EXEMPT bug fix Change-Id: I91c44428dc730be4cf42b3cb9c02e8eca4440f81 (cherry picked from commit a631dca1a8c02d39d9a578ce331a7b23bf7ef962) Merged-In: I91c44428dc730be4cf42b3cb9c02e8eca4440f81
2025-09-18[SP 2025-09-01] Move markMediaAsFavorite's logic from MediaStore to ↵ darshilshah
MediaProvider The content values retrieved from extras in the MediaProvider can have values preset by the calling app and can affect other fields set. Instead of retrieving the content values, we only retrieve a boolean field that says whether the is_favorite is to be set to true or false. All processing logic is shifted to MediaProvider. Bug: 417194323 Test: EXEMPT Bugfix Flag: EXEMPT Bugfix (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:17ebbe43efe36a7c00d3941513d5caf2db91f628) Merged-In: I0227139b0a04efcb7456557fbf2d47996c017bad Change-Id: I0227139b0a04efcb7456557fbf2d47996c017bad
2025-03-20Merge "Fix for legacy storage app op" into main Dipankar Bhardwaj
2025-03-20Fix for legacy storage app op Dipankar Bhardwaj
There is a bug in AppOpsManager that keeps legacy storage granted even when an app updates its targetSdkVersion from value <30 to >=30. If an app upgrades from targetSdk 29 to targetSdk 33, legacy storage remains granted and in targetSdk 33, app are required to replace R_E_S with R_M_*. If an app updates its manifest with R_M_*, permission check in MediaProvider will look for R_E_S and will not grant read access as the app would be still treated as legacy. Test: atest PermissionUtilsTest Bug: 315914683 Flag: EXEMPT bug fix Change-Id: I22d0a329fbea5afe9dea2bc5179596db7a2ef402
2025-03-17Merge "[MediaProvider] Exclude unreliable storage from ↵ Riya Ghai
MediaStore.getExternalVolumeNames()." into main
2025-03-13Merge changes Iabc4de0d,I147d67b2 into main Tyler Saunders
* changes: Handle x-profile delegation for java picker. Properly handle delegation in x-profile checks.
2025-03-13Merge "Add API to bulk update oem_metadata" into main Dipankar Bhardwaj
2025-03-13Handle x-profile delegation for java picker. Tyler Saunders
Bug: b/402367358 Test: atest MediaProviderTests:UserManagerStateTest Flag: EXEMPT bug_fix Change-Id: Iabc4de0d39720dcb355cf98c99724feacf6899e0
2025-03-13Add API to bulk update oem_metadata Dipankar Bhardwaj
Created new API to bulk update oem_metadata. This can be done only with UPDATE_OEM_METADATA_PERMISSION which is signature and privileged. Triggering bulk update of oem_metadata column will mark it as null for rows with oem supported mime type till the next idle maintenance run re-fetches the values from OEMMetadataService. Also added support for OEM_METADATA update for a URI using update API. Test: atest OemMetadataServiceTest Bug: 352528913 Change-Id: If2ee9050304ab1f60ca402bf4205a34b58277e76 Flag: com.android.providers.media.flags.enable_oem_metadata_update
2025-03-12[MediaProvider] Exclude unreliable storage from “riyaghai”
MediaStore.getExternalVolumeNames(). Test: MediaProviderChangeIdTest Bug: 391360514 Flag: com.android.providers.media.flags.exclude_unreliable_volumes Change-Id: I137bd91ce8452754a32c6f048e6e24f191643ebe
2025-03-10Check for null mime type Dipankar Bhardwaj
The mime type could be null when looking up extension in getExtFromMimeType. Check it first to avoid an NPE. Test: com.android.providers.media.util.MimeUtilsTest Bug: 401468886 Flag: EXEMPT test fix Change-Id: Ie4b5424da6d38a11e300995fd407d8429a67cd39
2025-03-10Merge "Don't call notifyChange on main thread" into main Omar Eissa
2025-03-09Merge "Replace unnecessary noteOp calls with checkOps" into main Garvita Jain
2025-03-09Replace unnecessary noteOp calls with checkOps Garvita Jain
Use checkOp calls instead of noteOp in scenarios where - * No data is delivered after checking permissions for the given uid * The record of permission check is not required This is done to improve permission checks performance and decrease the load on AppOpsManager since noteOp calls take significantly more time than checkOps. BUG: 323574186 Test: build MP Flag: EXEMPT bugfix Change-Id: Ie954e71e98dec28e4b7cb2dcacb6af7540b397aa
2025-03-06Refactor PickerDbFacade#queryMediaIdForApps implementation Shubhi
Bug: 389681152 Test: atest PickerDbFacadeTest Flag: EXEMPT bug fix Change-Id: Ibe8a80d65c4dff6368352944e004c5c934430953
2025-03-06Merge "Ensure profile strings and icons are resolved for all sdks." into main Treehugger Robot
2025-03-06Ensure profile strings and icons are resolved for all sdks. Tyler Saunders
Bug: b/394231676 Test: atest MediaProviderTests Flag: EXEMPT bug_fix Change-Id: Id739048e66ae64ffebec97eedf5740743d974e38
2025-03-06Merge "Fix MIME type to extension issue in Android 15" into main Himanshu Arora
2025-03-06Fix MIME type to extension issue in Android 15 Himanshu Arora
In Android 15, some unsupported MIME types were introduced, causing incorrect extension selection for unsupported MIME types. This fix ensures that the correct extensions are assigned to these MIME types. Test: atest MimeTypeFixHandlerTest Test: atest PhotoPickerTest Flag: com.android.providers.media.flags.enable_mime_type_fix_for_android_15 Bug: 376910932 Bug: 397897311 Change-Id: Ib6c969b8a0b9c719b628c71309afc5bd0a498af0
2025-03-05Merge "Use EnableAfter to check targetSdkVersion instead of EnabledSince" ↵ Garvita Jain
into main
2025-03-05Fix isBlockedByAdmin implementation to resolve cross profile access. Tyler Saunders
* Ensure that CrossProfileIntentForwarderActivity resolution is accurate. This relies on the @hide property `targetUserId` by accessing it via reflection as there is no API that can surface this information for `module_current` targets. * Add test cases for devices that may be configured to have more than one managed profile, and may not be compatible with AOSP source code assumption to ensure CrossProfile detection fails closed. Bug: b/394231676 Test: atest MediaProviderTests:UserManagerStateTest Flag: EXEMPT bugfix Change-Id: I0770a5723b67fe963bdaa9c5b8e6f7ca12eff6b4
2025-03-05Use EnableAfter to check targetSdkVersion instead of EnabledSince Garvita Jain
Build.VERSION_CODES.BAKLAVA is flagged right now. MTS is unable to recognize the flag. BUG: 400347834 Test: banchan com.google.android.mediaprovider mainline_modules_arm64 -> atest CtsScopedStorageDeviceOnlyTest Flag: EXEMPT bugfix Change-Id: Ic931d3c43629227bd5b5d6cd6068e8580cf525ae
2025-03-03Merge "Clear media sets cache and media sets content cache for a given ↵ Ishneet Ahuja
categoryId and its authority" into main
2025-03-03Clear media sets cache and media sets content cache for a given Ishneet Ahuja
categoryId and its authority The current implementation erases the complete cache for both media sets and media set content. It is fine for the MVP since we only have one category at the moment but in case we add more in the future, this should not be the behaviour. Test: verified manually, fixed corresponding tests Bug: 394050877 Flag: com.android.providers.media.flags.enable_photopicker_search Change-Id: Idd8980c0e573376df8100b44102dcc01b5e8e992
2025-03-03Refactor common methods used across search worker into a single helper Ishneet Ahuja
class -SearchWorkerUtil holds all the common methods Test: verified manually Bug: 380815166 Flag: com.android.providers.media.flags.enable_photopicker_search Change-Id: Ie00dc844baf0e644d23cc2fb97caf4e7d3073e6f
2025-03-03Merge "Hide cloud collections when a full sync is in progress" into main Shubhi Saxena
2025-03-02Merge "Defer opening picker DB to the first use" into main Omar Eissa
2025-02-28Merge "Propagate cancellation signal for both media sets and media sets ↵ Ishneet Ahuja
content." into main
2025-02-27Hide cloud collections when a full sync is in progress Shubhi
* Media set contents are only visible in Photopicker UI if they have also been synced in the main media table. * For large cloud libraries, in case a full sync is triggered, it can take a while before media sets contents can be displayed to the user. In order to mitigate this, hide the categories that contain media set contents while a full sync pending or in progress. Bug: 393046585 Test: atest PickerSyncControllerTest Flag: EXEMPT mitigation Change-Id: Ie50daa7e9e8d84ee3e565f4299ba53310ea3a1ed
2025-02-27Propagate cancellation signal for both media sets and media sets Ishneet Ahuja
content. Also update corresponding tests Test: verified manually, all corresponding tests updated Bug: 384475145 Flag: com.android.providers.media.flags.enable_photopicker_search Change-Id: I1056ee98587cf736742dba654e8a450cdb64ab6c
2025-02-27Don't call notifyChange on main thread Omar Eissa
Call notifyChange for attaching volume on Foreground instead of main thread. When MediaProvider starts up it attaches existing volumes (most probably only internal volume), attachVolume operation involves notifying content observers about the volume attachment. Currently, this happens on main thread during MediaProvider initialization, which would take time if SyncManager is busy with other requests. Running notifyChange on foreground thread saves us about 20% of MP initialization time. Test: manual & atest MediaProviderTests Bug: 399347278 Flag: EXEMPT bug fix Change-Id: If6f50169df2985d7eee8140b91b6ee83ef723851
2025-02-27Defer opening picker DB to the first use Omar Eissa
Currently, picker DB is being opened in the initialization path of MediaProvider which is discouraged operation. DB open could take time to happen, especially if DB upgrade is to occure, which could significantly increase MediaProvider initialization. Instead, we deferred opening the DB to the first use of the DB. getWritableDatabase is making sure that the DB is opened once, by caching the DB opened on the first call and returning the same DB on any subsequent get. Test: atest PickerDbFacadeTest Bug: 399347278 Flag: EXEMPT bug fix Change-Id: Ib57a0f1716349ad5a8c71977035835b69247f2ce
2025-02-26Merge "[Expressive Design] Migrate Photopicker Cloud Settings activity" into ↵ Garvita Jain
main
2025-02-26[Expressive Design] Migrate Photopicker Cloud Settings activity Garvita Jain
This change : * Uses CollapsibleToolbarBaseActivity for PhotopickerSettingsActivity * Uses SettingsBasePreferenceFragment BUG: 349670985 Test: manual Flag: EXEMPT ui changes Change-Id: I1148356700473fe52294ecfbc3bf5199c4c894c2
2025-02-25Merge "Offload determining SDR transcode availability" into main am: ↵ Wonsik Kim
6da5c24dad am: b7afcb2d59 Original change: https://android-review.googlesource.com/c/platform/packages/providers/MediaProvider/+/3481292 Change-Id: I65c449199a158b77b7ee48b1dd65d3e5607b648a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-25Merge "Don't resume search syncs to mitigate partial sync issue" into main Shubhi Saxena
2025-02-24Offload determining SDR transcode availability Wonsik Kim
Checking for HDR plugin at creation could happen before mediaserver is ready to respond, which could lead to ANRs at boot especially for slower devices. Bug: 361082713 Bug: 392798901 Test: presubmit Change-Id: Ia8f8ca20cc1c36b6d92b26e726e9000e8e37e9e3
2025-02-24Don't resume search syncs to mitigate partial sync issue Shubhi
* There is an issue in CMP where resuming of syncs causes their pagination logic to break. This change makes sure that we never resume search results sync with the CMP. Bug: 397368798 Test: atest PickerSyncManagerTest Test: atest SearchResultsSyncWorkerTest Flag: EXEMPT bug fix Change-Id: I527cb6579acca8b39e81a5a83c8bb5ec884f933c
2025-02-21Merge "Revert "[MediaProvider] Exclude unreliable storage from"" into main Riya Ghai
2025-02-20Revert "[MediaProvider] Exclude unreliable storage from" Riya Ghai
This reverts commit 804ffda5c53b853ef6b1d7297f8d4a0bf5354458. Reason for revert: gantry rollout caused breakages Change-Id: I8e118197c0dd8d3280d0af6500607d481979d7f5
2025-02-18Merge "Use fixed thread pool for calls to OemMetadataService" into main Dipankar Bhardwaj
2025-02-18Use fixed thread pool for calls to OemMetadataService Dipankar Bhardwaj
Instead of creating a new thread everytime we want to fetch OEM metadata, updating code to use a fixed thread pool of 3 threads. We do not expect lot of concurrent requests to this as scanner code is currently serialised, hence keeping thread pool size low. Also guarded oem metadata connection code with try-catch to avoid onCreate() crash. Test: atest OemMetadataServiceTest Bug: 377432406 Change-Id: I70a0b6ca6ae43f7ba7ab086103365cc16b3497fa Flag: EXEMPT minor fix
2025-02-18Merge "Fix handling of unsupported MIME types in Android 15" into main Himanshu Arora
2025-02-18Merge "[MediaProvider] Exclude unreliable storage from ↵ Riya Ghai
MediaStore.getExternalVolumeNames()." into main
2025-02-17Fix handling of unsupported MIME types in Android 15 Himanshu Arora
In Android 15, certain unsupported MIME types were introduced. This ensures new files with these MIME types are handled with the correct MIME type also fixed the exsiting incorrect mime type and media type Test: atest MimeTypeFixHandlerTest Flag: com.android.providers.media.flags.enable_mime_type_fix_for_android_15 Bug: 376910932 Change-Id: I642ab9a03cf8cd059d28fe258b80fe05ab31c8ce
2025-02-17[MediaProvider] Exclude unreliable storage from “riyaghai”
MediaStore.getExternalVolumeNames(). Test: MediaProviderChangeIdTest Bug: 391360514 Flag: com.android.providers.media.flags.exclude_unreliable_volumes Change-Id: I3fc6c71b6466ca195f77daf63764a3b3c9a3fc9c
2025-02-14Merge "Fix the uri for local copies of cloud album cover" into main Shubhi Saxena
2025-02-12Merge "Add configurations to support for backup and restore of ↵ Darshil Shah
MediaProvider" into main
2025-02-12Add configurations to support for backup and restore of MediaProvider darshilshah
Bug: 195138692 Test: com.android.providers.media.backupandrestore.MediaBackupAgentTest Flag: com.android.providers.media.flags.enable_backup_and_restore Change-Id: I9be5c57b9e6d19ef7b187153d4b2fb84727fda27
2025-02-12Fix the uri for local copies of cloud album cover Shubhi
Bug: 395887352 Test: atest MediaGroupCursorUtilsTest Flag: EXEMPT bug fix Change-Id: Id96115ad30e6213634e1e53dac79ee30249c6363