OSDN Git Service

Translate sandboxed paths correctly for MediaStore.SCAN_FILE_CALL.
authorSudheer Shanka <sudheersai@google.com>
Tue, 5 Feb 2019 02:16:15 +0000 (18:16 -0800)
committerSudheer Shanka <sudheersai@google.com>
Tue, 5 Feb 2019 02:16:15 +0000 (18:16 -0800)
Bug: 123642484
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore_DownloadsTest.java
Change-Id: Ie19beb12e546b1b78e8e0d056558444a255f394d

api/test-current.txt
core/java/android/provider/MediaStore.java

index 9023a85..d89f8ef 100644 (file)
@@ -1756,6 +1756,7 @@ package android.provider {
     method @RequiresPermission(android.Manifest.permission.CLEAR_APP_USER_DATA) public static long getContributedMediaSize(android.content.Context, String, android.os.UserHandle) throws java.io.IOException;
     method @NonNull public static java.io.File getVolumePath(@NonNull String) throws java.io.FileNotFoundException;
     method @NonNull public static java.util.Collection<java.io.File> getVolumeScanPaths(@NonNull String) throws java.io.FileNotFoundException;
+    field public static final String EXTRA_ORIGINATED_FROM_SHELL = "android.intent.extra.originated_from_shell";
     field public static final String SCAN_FILE_CALL = "scan_file";
     field public static final String SCAN_VOLUME_CALL = "scan_volume";
   }
index 0743c23..67c8400 100644 (file)
@@ -110,6 +110,16 @@ public final class MediaStore {
     public static final String SCAN_VOLUME_CALL = "scan_volume";
 
     /**
+     * Extra used with {@link #SCAN_FILE_CALL} or {@link #SCAN_VOLUME_CALL} to indicate that
+     * the file path originated from shell.
+     *
+     * {@hide}
+     */
+    @TestApi
+    public static final String EXTRA_ORIGINATED_FROM_SHELL =
+            "android.intent.extra.originated_from_shell";
+
+    /**
      * The method name used by the media scanner and mtp to tell the media provider to
      * rescan and reclassify that have become unhidden because of renaming folders or
      * removing nomedia files