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

Commit accbadeb authored by Yusuke Ohmichi(maimuzo)'s avatar Yusuke Ohmichi(maimuzo) Committed by Jean-Baptiste Queru
Browse files

fix issue #1587

parent bfcb2193
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -351,23 +351,26 @@ public class SQLiteQueryBuilder
            String groupBy, String having, String sortOrder, String limit) {
        String[] projection = computeProjection(projectionIn);

        StringBuilder where = new StringBuilder();

        if (mWhereClause.length() > 0) {
            mWhereClause.append(')');
            where.append(mWhereClause.toString());
            where.append(')');
        }

        // Tack on the user's selection, if present.
        if (selection != null && selection.length() > 0) {
            if (mWhereClause.length() > 0) {
                mWhereClause.append(" AND ");
                where.append(" AND ");
            }

            mWhereClause.append('(');
            mWhereClause.append(selection);
            mWhereClause.append(')');
            where.append('(');
            where.append(selection);
            where.append(')');
        }

        return buildQueryString(
                mDistinct, mTables, projection, mWhereClause.toString(),
                mDistinct, mTables, projection, where.toString(),
                groupBy, having, sortOrder, limit);
    }