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

Unverified Commit bdb600da authored by Hall Liu's avatar Hall Liu Committed by Kevin F. Haggerty
Browse files

Allow empty tokens in strict grammar

Allow empty tokens in SQLiteQueryBuilder's strict grammar enforcement

Bug: 143230980
Test: atest SQLiteQueryBuilderTest, manual
Change-Id: Ie82dded77a3eaa75095333b0e77f10e21c9f7caf
(cherry picked from commit ea5b2c08)
Merged-In: Ie82dded77a3eaa75095333b0e77f10e21c9f7caf
parent 6a9a4ad2
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -98,6 +98,13 @@ public class CallLog {
         */
        public static final String LIMIT_PARAM_KEY = "limit";

        /**
         * Form of {@link #CONTENT_URI} which limits the query results to a single result.
         */
        private static final Uri CONTENT_URI_LIMIT_1 = CONTENT_URI.buildUpon()
                .appendQueryParameter(LIMIT_PARAM_KEY, "1")
                .build();

        /**
         * Query parameter used to specify the starting record to return.
         * <p>
@@ -839,11 +846,11 @@ public class CallLog {
            Cursor c = null;
            try {
                c = resolver.query(
                    CONTENT_URI,
                    CONTENT_URI_LIMIT_1,
                    new String[] {NUMBER},
                    TYPE + " = " + OUTGOING_TYPE,
                    null,
                    DEFAULT_SORT_ORDER + " LIMIT 1");
                    DEFAULT_SORT_ORDER);
                if (c == null || !c.moveToFirst()) {
                    return "";
                }