Skip to content

Commit 7017d51

Browse files
Mike LockwoodAndroid (Google) Code Review
authored andcommitted
Merge "MtpDatabase: Fix sqlite3 pattern matching for MTP directory deletes" into jb-dev
2 parents 947ce39 + 1e855d9 commit 7017d51

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

media/java/android/mtp/MtpDatabase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -933,10 +933,10 @@ private int deleteFile(int handle) {
933933
// recursive case - delete all children first
934934
Uri uri = Files.getMtpObjectsUri(mVolumeName);
935935
int count = mMediaProvider.delete(uri,
936-
// the 'like' makes it use the index, the 'lower()' makes it correct
937-
// when the path contains sqlite wildcard characters
938-
"_data LIKE ? AND lower(substr(_data,?))=lower(?)",
939-
new String[] { path + "/%", "" + path.length() + 1, path + "/"});
936+
// the 'like' makes it use the index, the 'lower()' makes it correct
937+
// when the path contains sqlite wildcard characters
938+
"_data LIKE ?1 AND lower(substr(_data,1,?2))=lower(?3)",
939+
new String[] { path + "/%",Integer.toString(path.length() + 1), path + "/"});
940940
}
941941

942942
Uri uri = Files.getMtpObjectsUri(mVolumeName, handle);

0 commit comments

Comments
 (0)