Merge "MtpDatabase: Fix sqlite3 pattern matching for MTP directory deletes" into jb-dev

This commit is contained in:
Mike Lockwood
2012-06-26 16:57:02 -07:00
committed by Android (Google) Code Review

View File

@@ -933,10 +933,10 @@ public class MtpDatabase {
// recursive case - delete all children first
Uri uri = Files.getMtpObjectsUri(mVolumeName);
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 + "/"});
// the 'like' makes it use the index, the 'lower()' makes it correct
// when the path contains sqlite wildcard characters
"_data LIKE ?1 AND lower(substr(_data,1,?2))=lower(?3)",
new String[] { path + "/%",Integer.toString(path.length() + 1), path + "/"});
}
Uri uri = Files.getMtpObjectsUri(mVolumeName, handle);