diff options
author | Mike Lockwood <lockwood@google.com> | 2012-06-26 16:57:02 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-06-26 16:57:02 -0700 |
commit | 7017d51e147a0f6ed2370fb79c656c9726304131 (patch) | |
tree | 2eb5174260dcf7e56cdb3ea00f70216325a746fe /media | |
parent | 947ce39e5648851a5a49e71e22d187402ff1337d (diff) | |
parent | 1e855d98aa979b30cee9e096cf6a1cb54df0367b (diff) | |
download | frameworks_base-7017d51e147a0f6ed2370fb79c656c9726304131.zip frameworks_base-7017d51e147a0f6ed2370fb79c656c9726304131.tar.gz frameworks_base-7017d51e147a0f6ed2370fb79c656c9726304131.tar.bz2 |
Merge "MtpDatabase: Fix sqlite3 pattern matching for MTP directory deletes" into jb-dev
Diffstat (limited to 'media')
-rwxr-xr-x | media/java/android/mtp/MtpDatabase.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/media/java/android/mtp/MtpDatabase.java b/media/java/android/mtp/MtpDatabase.java index c365e4c..7532d79 100755 --- a/media/java/android/mtp/MtpDatabase.java +++ b/media/java/android/mtp/MtpDatabase.java @@ -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); |