Loading media/java/android/media/MediaScanner.java +3 −1 Original line number Diff line number Diff line Loading @@ -1444,7 +1444,9 @@ public class MediaScanner String where; String[] selectionArgs; if (mCaseInsensitivePaths) { where = Files.FileColumns.DATA + " LIKE ?"; // the 'like' makes it use the index, the 'lower()' makes it correct // when the path contains sqlite wildcard characters where = "_data LIKE ?1 AND lower(_data)=lower(?1)"; selectionArgs = new String[] { path }; } else { where = Files.FileColumns.DATA + "=?"; Loading media/java/android/mtp/MtpDatabase.java +5 −2 Original line number Diff line number Diff line Loading @@ -932,8 +932,11 @@ public class MtpDatabase { if (format == MtpConstants.FORMAT_ASSOCIATION) { // recursive case - delete all children first Uri uri = Files.getMtpObjectsUri(mVolumeName); int count = mMediaProvider.delete(uri, "_data LIKE ?", new String[] { path + "/%"}); int count = mMediaProvider.delete(uri, // the 'like' makes it use the index, the 'lower()' makes it correct // when the path contains sqlite wildcard characters "_data LIKE ? AND lower(substr(_data,?))=lower(?)", new String[] { path + "/%", "" + path.length() + 1, path + "/"}); } Uri uri = Files.getMtpObjectsUri(mVolumeName, handle); Loading Loading
media/java/android/media/MediaScanner.java +3 −1 Original line number Diff line number Diff line Loading @@ -1444,7 +1444,9 @@ public class MediaScanner String where; String[] selectionArgs; if (mCaseInsensitivePaths) { where = Files.FileColumns.DATA + " LIKE ?"; // the 'like' makes it use the index, the 'lower()' makes it correct // when the path contains sqlite wildcard characters where = "_data LIKE ?1 AND lower(_data)=lower(?1)"; selectionArgs = new String[] { path }; } else { where = Files.FileColumns.DATA + "=?"; Loading
media/java/android/mtp/MtpDatabase.java +5 −2 Original line number Diff line number Diff line Loading @@ -932,8 +932,11 @@ public class MtpDatabase { if (format == MtpConstants.FORMAT_ASSOCIATION) { // recursive case - delete all children first Uri uri = Files.getMtpObjectsUri(mVolumeName); int count = mMediaProvider.delete(uri, "_data LIKE ?", new String[] { path + "/%"}); int count = mMediaProvider.delete(uri, // the 'like' makes it use the index, the 'lower()' makes it correct // when the path contains sqlite wildcard characters "_data LIKE ? AND lower(substr(_data,?))=lower(?)", new String[] { path + "/%", "" + path.length() + 1, path + "/"}); } Uri uri = Files.getMtpObjectsUri(mVolumeName, handle); Loading