Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e855d98 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

MtpDatabase: Fix sqlite3 pattern matching for MTP directory deletes



Bug: 6684451

Change-Id: I90204550ccfcd1b7a5b1973bed2a88e934aae053
Signed-off-by: default avatarMike Lockwood <lockwood@google.com>
parent dbbfa702
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -935,8 +935,8 @@ public class MtpDatabase {
                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 + "/"});
                    "_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);