1. 27 Jul, 2015 1 commit
  2. 24 Jul, 2015 1 commit
    • Jeff Sharkey's avatar
      Check app-ops when enforcing permissions. · 55f76906
      Jeff Sharkey authored
      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
      55f76906
  3. 21 Jul, 2015 1 commit
    • Jeff Sharkey's avatar
      Move permission checking from "other" to "group." · 182ee96c
      Jeff Sharkey authored
      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
      182ee96c
  4. 08 Jul, 2015 1 commit
    • Jeff Sharkey's avatar
      Generate stable MTP storage IDs. · 40fef25a
      Jeff Sharkey authored
      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
      40fef25a
  5. 24 Apr, 2015 1 commit
  6. 30 Mar, 2015 1 commit
  7. 06 Feb, 2015 1 commit
  8. 02 Dec, 2014 1 commit
    • xiaochao's avatar
      MediaProvider: When insert files to "internal.db", · 07ac056d
      xiaochao authored
      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: default avatarxiaochao <xiaochao.huang@intel.com>
      Signed-off-by: default avatarBo Huang <bo.b.huang@intel.com>
      07ac056d
  9. 21 Nov, 2014 1 commit
    • Benson Huang's avatar
      Fix SQLiteDiskIOException in stability test · d1b7c58a
      Benson Huang authored
          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: default avatarBenson Huang <benson.huang@mediatek.com>
      
      Change-Id: I484bd535ddebee09824a10f12241f6b2ce086b94
      d1b7c58a
  10. 27 Oct, 2014 1 commit
  11. 14 Oct, 2014 1 commit
  12. 28 May, 2014 1 commit
  13. 14 May, 2014 1 commit
  14. 28 Apr, 2014 1 commit
  15. 04 Feb, 2014 1 commit
  16. 28 Jan, 2014 1 commit
  17. 13 Dec, 2013 1 commit
  18. 14 Nov, 2013 1 commit
    • Marco Nelissen's avatar
      Fix argument references · 3fa4c1f0
      Marco Nelissen authored
      The bucket id and display names references were off by one, resulting
      in brokenness when renaming a directory via MTP
      b/10835798
      b/11655617
      
      Change-Id: I9e6c510027a37deed55887393e388805f06b86b0
      3fa4c1f0
  19. 30 Oct, 2013 1 commit
  20. 23 Oct, 2013 2 commits
  21. 16 Oct, 2013 1 commit
    • Jeff Sharkey's avatar
      Get FAT volume ID through vold. · 5d36def3
      Jeff Sharkey authored
      Now that storage volumes are FUSE-wrapped, userspace apps no longer
      have access to perform the direct ioctl().
      
      Bug: 11175082
      Change-Id: I08b8367a89e4f325dd28c29789165e95c70e9944
      5d36def3
  22. 07 Oct, 2013 1 commit
  23. 26 Sep, 2013 1 commit
    • Jeff Sharkey's avatar
      Revoke grants when media is deleted. · b39b32d9
      Jeff Sharkey authored
      When deleting images, videos, or audio, revoke any Uri permission
      grants, which removes from getPersistedUriPermissions().
      
      Bug: 10928851
      Change-Id: Id2fedd5258f9674df1a786b06028b458dda1af17
      b39b32d9
  24. 24 Sep, 2013 2 commits
    • yoohyun.choi's avatar
      avoid SQLiteConstraintException in MediaProvider when external storage ejected · 8693255a
      yoohyun.choi authored
      When external storage is ejected, the _data column is updated with empty string.
      Then, SQLiteConstraintException occurs because the _data column is modified to be unique.
      So, to avoid SQLiteConstraintException, the _data column should be updated with NULL.
      
      Change-Id: I2b00b5327c37f584970261789c5462626a5a4ea7
      8693255a
    • Jeff Sharkey's avatar
      Notify when media roots go non-empty. · ca709d4f
      Jeff Sharkey authored
      If we reported that Images, Videos, or Audio were empty, notify
      when they become non-empty so RootsCache is updated and they appear
      in UI.
      
      Bug: 10745490
      Change-Id: I0b10ca1b8a08ef7f5bd8bbee1eca62ca871aa4e6
      ca709d4f
  25. 20 Sep, 2013 1 commit
  26. 17 Sep, 2013 1 commit
  27. 16 Sep, 2013 1 commit
  28. 11 Sep, 2013 1 commit
  29. 05 Sep, 2013 1 commit
    • Sangkyu Lee's avatar
      Fix possible deadlock in media provider · 6f520752
      Sangkyu Lee authored
      
      Because of the execution sequences below,
      receiving ACTION_MEDIA_EJECT intent during bulk inserting
      can lead to media provider deadlock.
      
      bulkInsert()
      -> db.beginTransaction()
      -> insertInternal()
      -> getDatabaseForUri()
      -> synchronized(mDatabases)
      
      mUnmountReceiver.onReceive()
      -> synchronized(mDatabases)
      -> db.update()
      
      beginTransaction() blocks any other operations on the database
      until endTransaction() is called.
      Therefore, db.update() method can be blocked in the synchronized block
      and bulk inserting also can be blocked simultaneously to enter
      the synchronized block.
      
      This patch resolves the problem above by restricting the scope
      of the synchronized block in mUnmountReceiver.
      
      Change-Id: Ibb65ac82ea389145a6a3e44942928b7548c53b22
      Signed-off-by: default avatarSangkyu Lee <sk82.lee@lge.com>
      6f520752
  30. 28 Aug, 2013 1 commit
    • Marco Nelissen's avatar
      Check permissions when deleting files. · b2c3695f
      Marco Nelissen authored
      When images or videos are deleted from the media provider, only delete
      the underlying files if the caller is allowed to.
      
      b/9818756
      
      Change-Id: Iddf50b1fcf56220886ed9b6d953d97960cda0ec6
      b2c3695f
  31. 27 Aug, 2013 1 commit
    • Marco Nelissen's avatar
      Check for path-permissions when opening a file. · 3e6a4288
      Marco Nelissen authored
      When an app is trying to open a Uri, check whether it has been granted
      read or write permission by another app via the Intent.FLAG_GRANT_... flags,
      instead of only checking whether the app itself has external storage read
      or write permissions.
      
      b/10345049
      
      Change-Id: Idbc87fe34a05be9d8220ee7a0223d039480c3ffe
      3e6a4288
  32. 26 Aug, 2013 1 commit
    • Marco Nelissen's avatar
      Fix existing image entries timestamps · 2a83ace1
      Marco Nelissen authored
      Screenshots were being inserted into the database with the wrong
      "date taken" timestamp. Fix existing entries so they are correct
      again and appear in the right order in gallery.
      
      b/10424911
      
      Change-Id: I6ff7283ac10be94b0e159b72da7e072084ef5a2b
      2a83ace1
  33. 02 Aug, 2013 1 commit
    • Birdson Chen's avatar
      Skip albumart when the size of image file bigger than maximal heap size. · 2c3a3d48
      Birdson Chen authored
      When the audio doesn't contain embedded art, MediaProvider
      will help to look for a suitable image file in the same
      directory as the media file, excpet if that directory is
      the root directory of the sd card or download directory.
      
      MediaProvider looks for, in order of preference:
       1 AlbumArt.jpg
       2 AlbumArt*Large.jpg
       3 Any other jpg image with 'albumart' anywhere in the name
       4 Any other jpg image
       5 any other png image
      
      If we put a image file and a audio file in same directory of
      sdcard, and the size of a image should large than maximal heap size.
      It will cause hte process android.process.media stop because OOM.
      As a result, we need catch OutOfMemoryError exception to avoid this issue.
      
      Change-Id: I4131188b4b75454f5bdb20c50b930ff8b7a370fa
      
      Change-Id: I4131188b4b75454f5bdb20c50b930ff8b7a370fa
      2c3a3d48
  34. 01 Aug, 2013 1 commit
  35. 30 Jul, 2013 1 commit
    • Marco Nelissen's avatar
      Add permissions check · 70eadbf4
      Marco Nelissen authored
      For paths that do not point to the sdcard or cache partitions (for which
      READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE and ACCESS_CACHE_FILESYSTEM
      permissions are checked as needed), check that they are world-readable.
      
      b/9604671
      
      Change-Id: Ib3b8c745139f356e9cb070c0862e0ce63c7bb1ba
      70eadbf4
  36. 16 Jul, 2013 1 commit
    • Marco Nelissen's avatar
      Generate new picture path in Pictures, not DCIM/Camera · 4d214a39
      Marco Nelissen authored
      When an app uses the MediaStore.Images.Media.insertImage() convenience
      API, put the image in the Pictures folder, not in DCIM/Camera.
      This seems like a more appropriate location, and avoids problems with
      the Camera folder not existing (the Pictures folder is created during
      initial setup).
      b/9370759
      
      Change-Id: I231aeae5ee24780ea0337f0ef3fd1a6030f2c372
      4d214a39
  37. 11 Jul, 2013 1 commit
  38. 04 Jun, 2013 1 commit
    • Jia Su's avatar
      Make sure date taken time is set · 20368a55
      Jia Su authored
      computeTakenTime() depends on the value DATE_MODIFED,
      so call it after DATE_MODIFIED are set to ensure it
      works correctly.
      
      Change-Id: Ib4f3b03c487b45dd081dab5bd4ddfa72221b434f
      20368a55