File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1444,7 +1444,9 @@ FileEntry makeEntryFor(String path) {
14441444 String where ;
14451445 String [] selectionArgs ;
14461446 if (mCaseInsensitivePaths ) {
1447- where = Files .FileColumns .DATA + " LIKE ?" ;
1447+ // the 'like' makes it use the index, the 'lower()' makes it correct
1448+ // when the path contains sqlite wildcard characters
1449+ where = "_data LIKE ?1 AND lower(_data)=lower(?1)" ;
14481450 selectionArgs = new String [] { path };
14491451 } else {
14501452 where = Files .FileColumns .DATA + "=?" ;
Original file line number Diff line number Diff line change @@ -932,8 +932,11 @@ private int deleteFile(int handle) {
932932 if (format == MtpConstants .FORMAT_ASSOCIATION ) {
933933 // recursive case - delete all children first
934934 Uri uri = Files .getMtpObjectsUri (mVolumeName );
935- int count = mMediaProvider .delete (uri , "_data LIKE ?" ,
936- new String [] { path + "/%" });
935+ 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 + "/" });
937940 }
938941
939942 Uri uri = Files .getMtpObjectsUri (mVolumeName , handle );
You can’t perform that action at this time.
0 commit comments