summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers
Commit message (Collapse)AuthorAgeFilesLines
* Rework thumbnail cleanupreplicant-6.0-0004-rc1Marco Nelissen2018-06-081-5/+178
| | | | | | | | Bug: 63766886 Test: ran CTS tests Change-Id: I1173f67d6fb41494d6d069cc7cfc0c2b0dcc1725 (cherry picked from commit 8a1db2e3fa16bce83856a3a8920f8820fe942fce) CVE-2018-9379
* [DO NOT MERGE] Enforce user separation on external storagereplicant-6.0-0002Fyodor Kupolov2017-07-061-1/+42
| | | | | | | | | | | | | | | | | With WRITE_MEDIA_STORAGE permission, MediaProvider can access external storage across users. Access should be rejected for content in other user's external storage if the caller has no WRITE_MEDIA_STORAGE/INTERACT_ACROSS_USERS Test: manual + android.provider.cts.MediaStore_FilesTest Bug: 34114752 AOSP-Change-Id: I577cc33574185657592246c1103df4174ff3acf6 (cherry picked from commit cc1cecc9be51f9655d9acdf1729345d16f078c21) CVE-2017-0669 Change-Id: Id986720c8265eaba91c809277b97d0ff4a2fc6ba
* MediaProvider: catch data exception to avoid crashjunjiez2016-08-131-1/+9
| | | | | | | | catch StaleDataException and IllegalStateException when use ringtonManger to get rington to avoid crash. Change-Id: I6db82fd61de5dcb799efdd51c39b0433dcdb60a0 CRs-Fixed: 1042275
* MediaProvider: Fix failure in android.provider.cts.MediaStore_FilesTesthuiyan2016-08-132-9/+2
| | | | | | | | | | | | | openFileDescriptor or openOutputStream will call openFile in MediaProvider. And the parent dir of the caller's url is created by openFile. But MediaStore_FilesTest expect that the dir does not exists. So the test case fail. Remove the function of creating the dir to make MediaStore_FilesTest successfully in openFile. And create the dir in the request function. Change-Id: Id497e3ed70f41ca0a3a83a496ff82a5b3d33ca77 CRs-Fixed: 1020200
* Gallery2: Fix thumbnails of new edit photos display wrongly in Documents.huiyan2016-08-131-0/+8
| | | | | | | | | | | | | The photo is edited and save to new file in gallery, the thumbnail of the new photo is generated and saved at the same time. But the directory of thumbnails is not created, and the thumbnail can't save. So the thumbnail displays incorrectly in Documents's Recent list. Check the directory of thumbnails whether create, if not create it at first to make the thumbnails save successfully. Change-Id: I110a7bf568750cc9a0350d99f0a68f6b18c14fbd CRs-Fixed: 994316
* Music: Fix force closed when plug out the SD card while music is playing.xiaoch2016-08-131-0/+4
| | | | | | | | method getCompressedAlbumArt() return null if file path is null, because it will occur NullPointerException. Change-Id: I051636bd844764cc64aa663f2a1e1ecc621b672c CRs-Fixed: 994948
* MediaProvider: Fix SQLiteDiskIOException.huiyan2016-08-131-1/+7
| | | | | | | | | The SQLiteDiskIOExcept occur from monkey test. Catch the expcetion. Change-Id: I9d8f95449ac1d635e4b7c5267ba92ec7e6f76a39 CRs-Fixed: 961398
* Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-071-17/+35
|\ | | | | | | | | | | https://android.googlesource.com/platform/packages/providers/MediaProvider into HEAD Android 6.0.1 release 3
| * Allow deletion of media through SAF.Jeff Sharkey2015-10-131-17/+35
| | | | | | | | | | | | | | | | | | Now that we're putting the media roots up front and center through the Settings > Storage UI, users have an expectation of deleting media to free up disk space. Bug: 24450605 Change-Id: I38e1b021db2bf1f42a43f81f609818df905a0c0b
* | Fix mounting of non-FAT formatted SD cards (2/2)Michael Bestas2015-11-271-6/+6
| | | | | | | | Change-Id: I77fe9e09b523bcba68dd2409def68acb715ca33c
* | Screenshots info is not updated when device is plugged in MTP modeMaunik Shah2015-10-313-0/+51
| | | | | | | | | | | | | | | | | | | | When device is connected as MTP mode and user opens folder /sdcard/Pictures/Screenshots/ in windows system and captures new screenshot, image information is always shown as 0 KB Issue: https://code.google.com/p/android/issues/detail?id=56204 Change-Id: I0e633efc7a5b213e519d4de6b137992c5bfe8738
* | MediaProvider: Avoid null pointer exceptions inside getCompressedAlbumArtCristoforo Cataldo2015-10-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check if path is not null to avoid a java.lang.NullPointerException. If path is null, the following exception stack trace will be thrown: java.lang.NullPointerException: Attempt to invoke virtual method 'char[] java.lang.String.toCharArray()' on a null object reference at java.io.File.fixSlashes(File.java:185) at java.io.File.<init>(File.java:134) at com.android.providers.media.MediaProvider.getCompressedAlbumArt(MediaProvider.java:4846) at com.android.providers.media.MediaProvider.makeThumbInternal(MediaProvider.java:5015) at com.android.providers.media.MediaProvider.getThumb(MediaProvider.java:5011) at com.android.providers.media.MediaProvider.openFile(MediaProvider.java:4601) at android.content.ContentProvider.openAssetFile(ContentProvider.java:1334) at android.content.ContentProvider.openTypedAssetFile(ContentProvider.java:1514) at android.content.ContentProvider.openTypedAssetFile(ContentProvider.java:1580) at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:391) at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:312) at android.os.Binder.execTransact(Binder.java:446) Change-Id: Ie27605590db20e0e4e12095d32864a246cc25573
* | mediaprovider: Add theme support to Ringtone activityJorge Ruesga2015-10-311-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage: Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_ALARM); intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DIALOG_THEME, R.style.CustomDialogTheme); <<< Add your custom dialog theme here startActivityForResult(intent, 0); Style Usage: Define an style that inherits from an android base theme <style name="CustomDialogThemeDark" parent="@*android:style/Theme.Holo.Dialog.Alert"> or <style name="CustomDialogThemeLight" parent="@*android:style/Theme.Holo.Light.Dialog.Alert"> or define your own dialog style Depends on http://review.cyanogenmod.org/#/c/61392 Change-Id: I409eba2674f68386cdd20b74fc3ea42b8e81d111 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
* | MediaProvider: Avoid issue of android.process.media stopwjiang2015-10-311-0/+16
|/ | | | | | | | | "OK" and "Cancel" button's click event response at the same time lead to FATAL EXCEPTION. Make the click events do not happen at the same time. CRs-Fixed: 513752 Change-Id: I92fc1dc15be42d0bd9fe54f41fdbb26b3ca4b85c
* Create default directories on all storage devices.Jeff Sharkey2015-08-191-20/+32
| | | | | | | | | | Previously, MediaProvider would only create default directories once during the lifetime of a device. However, we're now regularly wiping storage devices when formatted as internal or portable, so we should create these directories the first time we encounter each device. Bug: 23329611 Change-Id: I71f8e9b47ad28c9883925c61f31ae61a070cc9b4
* Update primary storage paths when volumes change.Jeff Sharkey2015-08-141-12/+14
| | | | | | | | | | | | Devices that use physical media as their primary storage may not have that storage mounted by the time that MediaProvider is started, which means we'd snapshot a stale primary storage path. To fix this, refresh those paths as volumes are mounted or unmounted over time. Also fix logic that detects secondary storage devices. Bug: 22629557 Change-Id: I3c6b057ce082318e1b28e261c953a436da42e36f
* Media provider clears binder id calling in other providersSvetoslav2015-08-052-2/+15
| | | | | | | | | | | | The media provider can call into the downloads provider which runs in the same process from an IPC. In this case the permission and ap ops checks in the downloads provider will be verified against the caller of the media provider instead of against the media provider itself. bug:22629557 Change-Id: I444a2db96353f50c60cd1d7bb20538ab7d463a1e
* Merge "Throw correct exception for null paths" into mnc-devMarco Nelissen2015-07-291-1/+5
|\
| * Throw correct exception for null pathsMarco Nelissen2015-07-271-1/+5
| | | | | | | | | | Bug: 22519119 Change-Id: I8aff294201dfd8ec46ff3d30e4ceecea1346f29b
* | Use own package name when not processing IPC.Jeff Sharkey2015-07-271-1/+9
|/ | | | | Bug: 22753582 Change-Id: I73f3e8b7bc3fabab92909a183fcc71be7bb667b4
* Check app-ops when enforcing permissions.Jeff Sharkey2015-07-241-24/+55
| | | | | | | | | | | | | | | | When enforcing various storage permissions, check associated app-ops to see if they've been revoked. We're okay throwing outright, since Environment already told the app that volumes are unmounted, so they have no business poking around. Read/write sanity checking should only be relaxed to group-level for files living on storage devices; continue using globally readable flags for all other files. Refresh storage paths whenever volumes change. Bug: 22718722 Change-Id: I8640998f490550b4cd3a9b27bb6cb1a658bd102a
* Move permission checking from "other" to "group."Jeff Sharkey2015-07-211-2/+2
| | | | | | | | | The new storage layout used for runtime permissions uses the "group" ACL for enforcing access, and the "other" ACL is usually masked off completely. Bug: 22525550 Change-Id: I29b48cc3425ccfc8d3ff5ec323c8dc50be104878
* MtpService always expects a start intent.Jeff Sharkey2015-07-091-1/+1
| | | | | | | | Return START_REDELIVER_INTENT to make sure we always get the intent if we're ever killed and restarted. Bug: 22349167 Change-Id: I696284b8d55a8c8d1fb2362cd769981ae0d45366
* Generate stable MTP storage IDs.Jeff Sharkey2015-07-082-17/+22
| | | | | | | | | It ends up that MediaProvider is persisting MTP storage IDs in its database, so we need to make sure we generate stable IDs over time, otherwise we can end up looking into a black hole. Bug: 22256092 Change-Id: Ia419c37f87c7c0aa59ef0de530fd219c82988f6c
* Localize <unknown> from MediaProvider.Makoto Onuki2015-06-121-2/+12
| | | | | | Bug 21581123 Change-Id: I765e047ea65b3b6e19b3814502246a31be1b41b3
* Fix USB access control when adb is disabled.Nick Kralevich2015-06-102-40/+13
| | | | | | | | | | | | | | | | | | | When adb is disabled, the default usb mode would be "none", which would turn off the driver and prevent UsbDeviceManager from receiving any new USB connect / disconnect messages. This prevents the user from ever enabling MTP and sharing data when adb is turned off. As discussed in bug 21429947, we work around this problem by keeping the USB driver in MTP mode most of the time, so that we continue to receive USB connect / disconnect messages. To avoid leaking confidential user photos, this change honors the unlock state sent to us by the UsbDeviceManager code. We only expose user data if explicitly authorized by the user. MTP being enabled is decoupled from data being exposed on the USB connection. Bug: 21429947 Change-Id: I495011aa4e3e18c5e5e6fe7b9d0e1a3efe747ee7
* Add support for AudioAttributes flags in RingtonePickerActivityJean-Michel Trivi2015-05-211-0/+13
| | | | | | | | | | Read EXTRA_RINGTONE_AUDIO_ATTRIBUTES_FLAGS from intent to change the AudioAttributes flags on the Ringtone instance used to play the selected ringtone. Bug 19407114 Change-Id: I2d923ef27e8db19b2560a129ba2462c90a07a997
* Only extract FAT UUID for primary physical.Jeff Sharkey2015-04-241-1/+4
| | | | | | | | We can now have primary emulated removeable storage, which causes this code to be upset. Bug: 19993667 Change-Id: Id806c5d41ede6e040af9a48496b9e103a9c75962
* Follow MtpStorage refactoring.Jeff Sharkey2015-03-301-3/+3
| | | | | Bug: 19993667 Change-Id: I6380ac08f2eb91af81277d0ace42943e20112b2d
* am fe619b53: am 1baeeea4: am d1f37448: Check mCurrentThumbRequest.mPath to ↵leozwang2015-02-091-16/+18
|\ | | | | | | | | | | | | prevent crash. * commit 'fe619b536938e7c2835c4858b96983ff7d297932': Check mCurrentThumbRequest.mPath to prevent crash.
| * am 1baeeea4: am d1f37448: Check mCurrentThumbRequest.mPath to prevent crash.leozwang2015-02-071-16/+18
| |\ | | | | | | | | | | | | * commit '1baeeea4c716b650346030e6da7bee38609028cf': Check mCurrentThumbRequest.mPath to prevent crash.
| | * Check mCurrentThumbRequest.mPath to prevent crash.leozwang2015-02-061-16/+18
| | | | | | | | | | | | | | | | | | Bug: 19246412 Change-Id: I25c2f09ded0527ac062d9c8a57adf3aa7639ea76
* | | No longer need to take care of pre boot msg.Dianne Hackborn2015-01-291-6/+0
|/ / | | | | | | Change-Id: Ib91d67a952582090d1fccf1dc8e7902edad2dfa5
* | am 9200927d: Merge "MediaProvider: When insert files to "internal.db", ↵Marco Nelissen2014-12-041-2/+10
|\ \ | |/ |/| | | | | | | | | Don\'t notify MTP." * commit '9200927da3277128cfb517d54cea8be52d6ae602': MediaProvider: When insert files to "internal.db", Don't notify MTP.
| * MediaProvider: When insert files to "internal.db",xiaochao2014-12-021-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't notify MTP. Steps to Reproduce: 1. Connect DUT to Win7 PC via USB cable. 2. Do Factory reset, don't unplug the USB cable during the reset. ->DUT will reboot automatically after factory reset. 3. After DUT enters the system, transfer some files to the DUT by MTP or take some photos by Camera. Expected Results: Read DUT files normally on Win7 PC. Actual Results: The files transferred by MTP are named as "Local Disk" on the PC. And the photos token by Camera can not be showed. After file is inserted into "internal.db", don't notify MTP. If notify, PC will get no data from DUT because MtpServer will only query file's info from "external.db" and after PC gets no data so many times, it won't send "GetObjectPropList" request to DUT, that will cause "Local Disk" showed on the PC side. Change-Id: I6cb364158dbda8b267bdfbf6663d0682f7d4d6cb Signed-off-by: xiaochao <xiaochao.huang@intel.com> Signed-off-by: Bo Huang <bo.b.huang@intel.com>
* | Fix SQLiteDiskIOException in stability testBenson Huang2014-11-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because Sprout has removable storage, the framework needs to maintain external database for keeping multiple databases between SD cards. When cleaning up databases for old external storage volumes, we can't delete .db-shm and .db-wal because these two files always have the latest data and .db doesn't have. Using camera or Google+ will access .db-shm and .db-wal to get the latest data and will cause SQLite Disk I/O exception if they are deleted. The fix is to modify the logic of cleaning up databases (only delete .db file, not to delete .db-shm and .db-wal file). Bug 18412563 Review: https://partner-android-review.git.corp.google.com/#/c/187072 Signed-off-by: Benson Huang <benson.huang@mediatek.com> Change-Id: I484bd535ddebee09824a10f12241f6b2ce086b94
* | Reset album and artist tables due to change in how collation keys are ↵Mike Lockwood2014-10-271-0/+10
|/ | | | | | | calculated. Bug: 18118488 Change-Id: If1d12def4598be9cbf86b8550061f4d075be9717
* Check access before creating thumbnailMarco Nelissen2014-10-141-3/+9
| | | | | Bug: 17943556 Change-Id: I1ee026fc0f6248dab2e678e478ba76e8d464dba6
* Revert "RingtonePicker: use a non-intercepted stream for playback."Hyejin Kim2014-09-111-3/+0
| | | | | | | | | | This reverts commit c50b2befee37f28f9b482b0a31a62329142e4a6a. When user set alarm ringtone in DeskClock, It can't play with AudioManager.STREAM_SYSTEM stream type Bug: 16906307 Change-Id: Ia0d8df9b5c31441d34dc82678bceccd8ce31423d
* Use material alert dialog item view layoutAdam Powell2014-08-111-1/+1
| | | | | | Bug 16552638 Change-Id: If32429d6c124970b22075930a60fa23cafed8395
* RingtonePicker: use a non-intercepted stream for playback.John Spurlock2014-07-201-0/+3
| | | | | | | | | | When choosing a ringtone, avoid the ringer stream during playback to avoid interception. As before, no playback is performed if muted. Bug:15344396 Change-Id: I7301c7e60682c57187708dfc8fa933a150c5147a
* fix npe in MediaProviderNick Kralevich2014-05-271-1/+1
| | | | | | vaguely related to bug 10733373 Change-Id: Icda99a66d893374de7a1ed84d24f2c97a72b90b2
* am 4c546b54: am 501b93fb: am 17750fdd: Merge "Clean up cursors in try/finally"Marco Nelissen2014-05-161-188/+196
|\ | | | | | | | | * commit '4c546b546801fc63a7b439ae2350ae4239a664df': Clean up cursors in try/finally
| * Clean up cursors in try/finallyMattias Nilsson2014-05-141-188/+196
| | | | | | | | | | | | Make sure we release cursor resources. Change-Id: Ia122100b1350ae5db4804f8f0e95c49785ab645b
* | am 98109a4b: am 9adb079c: Merge "Track API package change."Elliott Hughes2014-04-281-6/+6
|\| | | | | | | | | * commit '98109a4bea074d49106545a349c1b8a401e6635b': Track API package change.
| * Merge "Track API package change."Elliott Hughes2014-04-281-6/+6
| |\
| | * Track API package change.Elliott Hughes2014-04-281-6/+6
| | | | | | | | | | | | Change-Id: Ie2ee436d9d5aa8f189bcb5a64116d09fccc5233b
* | | am 26fdc564: am 7d0d2486: Merge "Deactivate the MiniThumbFile when it is not ↵Marco Nelissen2014-04-251-0/+1
|\| | | | | | | | | | | | | | | | | | | | needed." * commit '26fdc564d60a1e2ad73c9a0d63418dc13097e750': Deactivate the MiniThumbFile when it is not needed.
| * | Deactivate the MiniThumbFile when it is not needed.hanpengx2014-04-171-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue description: Unable to use camera after deleting all files in internal storage from PC with MTP. The toast message "Connect USB storage before using the camera" is poped up when we launch camera after deleting all files in internal storage from PC with MTP. Steps to reproduce the issue: 1. Launch Camera and take a picture. 2. Connect device to PC with MTP mode. 3. Delete all files on Internal stoage from PC. 4. Launch Camera after step 3 finished. Then we find that we are unable to use camera and the toast message is poped up. Root cause: The .thumbdata3--xxxxx in /sdcard/DCIM/.thumbnails/ is opened in android.process.media process when we take picture in step 1. But the file is never closed. So camera cannot create the directories(/sdcard/DCIM/Camera) it needs to store captured pictures because "Device busy" error. Solution: Deactivate the MiniThumbFile when it is not needed. Change-Id: I0faab5ffd95c5626f7f9ef1bc02b2ae56e2eb19b Signed-off-by: hanpengx <pengfeix.han@intel.com>
* | Unset server before database is discarded.Marco Nelissen2014-03-271-0/+6
| | | | | | | | | | | | | | This fixes a broadcastreceiver leak. b/13622801 Change-Id: If9da147163c8f819eae66f97424a37e6f6f6d3aa