Loading packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +17 −14 Original line number Diff line number Diff line Loading @@ -492,24 +492,27 @@ public class ExternalStorageProvider extends DocumentsProvider { throw new IllegalStateException("Failed to delete " + file); } final File visibleFile = getFileForDocId(docId, true); if (visibleFile != null) { final ContentResolver resolver = getContext().getContentResolver(); final Uri externalUri = MediaStore.Files.getContentUri("external"); // Remove media store entries for any files inside this directory, using // path prefix match. Logic borrowed from MtpDatabase. if (isDirectory) { final String path = file.getAbsolutePath() + "/"; final String path = visibleFile.getAbsolutePath() + "/"; resolver.delete(externalUri, "_data LIKE ?1 AND lower(substr(_data,1,?2))=lower(?3)", new String[] { path + "%", Integer.toString(path.length()), path }); } // Remove media store entry for this exact file. final String path = file.getAbsolutePath(); final String path = visibleFile.getAbsolutePath(); resolver.delete(externalUri, "_data LIKE ?1 AND lower(_data)=lower(?2)", new String[] { path, path }); } } @Override public String moveDocument(String sourceDocumentId, String sourceParentDocumentId, Loading Loading
packages/ExternalStorageProvider/src/com/android/externalstorage/ExternalStorageProvider.java +17 −14 Original line number Diff line number Diff line Loading @@ -492,24 +492,27 @@ public class ExternalStorageProvider extends DocumentsProvider { throw new IllegalStateException("Failed to delete " + file); } final File visibleFile = getFileForDocId(docId, true); if (visibleFile != null) { final ContentResolver resolver = getContext().getContentResolver(); final Uri externalUri = MediaStore.Files.getContentUri("external"); // Remove media store entries for any files inside this directory, using // path prefix match. Logic borrowed from MtpDatabase. if (isDirectory) { final String path = file.getAbsolutePath() + "/"; final String path = visibleFile.getAbsolutePath() + "/"; resolver.delete(externalUri, "_data LIKE ?1 AND lower(substr(_data,1,?2))=lower(?3)", new String[] { path + "%", Integer.toString(path.length()), path }); } // Remove media store entry for this exact file. final String path = file.getAbsolutePath(); final String path = visibleFile.getAbsolutePath(); resolver.delete(externalUri, "_data LIKE ?1 AND lower(_data)=lower(?2)", new String[] { path, path }); } } @Override public String moveDocument(String sourceDocumentId, String sourceParentDocumentId, Loading