1. 31 Mar, 2016 1 commit
  2. 10 Mar, 2016 1 commit
  3. 20 Jan, 2016 1 commit
    • Dianne Hackborn's avatar
      Fix MediaProvider to report details of paths that change. · f90c695f
      Dianne Hackborn authored
      If you want to observe media changes with the job scheduler, we'd
      like to give you details of the files that changed when possible.
      However, MediaProvider was only reporting the containing path of
      a change, not the actual URI that changed.
      
      Fix this by now reporting the newUri when doing an insert.
      
      There is a comment in there about whether we should continue also
      reporting the parent URI.  I am not sure what to do about that.
      
      Change-Id: I03667c4466bde933cf2e04f8aca85eac913609f7
      f90c695f
  4. 06 Jan, 2016 2 commits
  5. 10 Nov, 2015 1 commit
    • Johan Redestig's avatar
      Delete rows for ejected filesystem in a transaction · 10b42d01
      Johan Redestig authored
      Wrap the update/delete commands in an sql transaction so
      they both either succeeds or fails. The problem adressed
      here is that the MediaProvider may be interrupted while
      handling the ACTION_MEDIA_EJECT intent and only the
      update may have happened. This leads to numerous weird
      problems later when _data contains unexpected null posts
      causing crashes with stacks like:
      
        java.lang.NullPointerException: Attempt to invo\
        ke virtual method 'char[] java.lang.String.toCh\
        arArray()' 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:4836)
       	at com.android.providers.media.MediaProvider.\
          makeThumbInternal(MediaProvider.java:5005)
       	at com.android.providers.media.MediaProvider.\
          getThumb(MediaProvider.java:5001)
       	at com.android.providers.media.MediaProvider.\
          openFile(MediaProvider.java:4591)
       	at android.content.ContentProvider.openAssetF\
          ile(ContentProvider.java:1322)
      
      The problem can be reproduced on a device with external
      SDCard by inserting a Thread.sleep(10000) between update
      and delete and then just power of the device normally.
      
      Change-Id: I2c104958dbe4e300aa80abedc4d44e0d77495180
      10b42d01
  6. 13 Oct, 2015 1 commit
    • Jeff Sharkey's avatar
      Allow deletion of media through SAF. · 2e1abd83
      Jeff Sharkey authored
      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
      2e1abd83
  7. 19 Aug, 2015 1 commit
    • Jeff Sharkey's avatar
      Create default directories on all storage devices. · 72613f7b
      Jeff Sharkey authored
      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
      72613f7b
  8. 14 Aug, 2015 1 commit
    • Jeff Sharkey's avatar
      Update primary storage paths when volumes change. · cba15caa
      Jeff Sharkey authored
      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
      cba15caa
  9. 05 Aug, 2015 1 commit
    • Svetoslav's avatar
      Media provider clears binder id calling in other providers · f94b8b8a
      Svetoslav authored
      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
      f94b8b8a
  10. 27 Jul, 2015 2 commits
  11. 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
  12. 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
  13. 09 Jul, 2015 1 commit
    • Jeff Sharkey's avatar
      MtpService always expects a start intent. · bc640a08
      Jeff Sharkey authored
      Return START_REDELIVER_INTENT to make sure we always get the intent
      if we're ever killed and restarted.
      
      Bug: 22349167
      Change-Id: I696284b8d55a8c8d1fb2362cd769981ae0d45366
      bc640a08
  14. 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
  15. 17 Jun, 2015 1 commit
  16. 12 Jun, 2015 1 commit
  17. 10 Jun, 2015 1 commit
    • Nick Kralevich's avatar
      Fix USB access control when adb is disabled. · 1469c78b
      Nick Kralevich authored
      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
      1469c78b
  18. 21 May, 2015 1 commit
  19. 06 May, 2015 1 commit
  20. 24 Apr, 2015 1 commit
  21. 30 Mar, 2015 1 commit
  22. 06 Feb, 2015 1 commit
  23. 30 Jan, 2015 1 commit
  24. 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
  25. 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
  26. 27 Oct, 2014 1 commit
  27. 14 Oct, 2014 1 commit
  28. 11 Sep, 2014 1 commit
  29. 12 Aug, 2014 1 commit
  30. 20 Jul, 2014 1 commit
  31. 28 May, 2014 1 commit
  32. 14 May, 2014 1 commit
  33. 28 Apr, 2014 1 commit
  34. 17 Apr, 2014 1 commit
    • hanpengx's avatar
      Deactivate the MiniThumbFile when it is not needed. · cb30035f
      hanpengx authored
      
      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: default avatarhanpengx <pengfeix.han@intel.com>
      cb30035f
  35. 27 Mar, 2014 1 commit
  36. 19 Mar, 2014 1 commit
  37. 07 Mar, 2014 1 commit
  38. 04 Feb, 2014 1 commit