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

Commit 0ec586b9 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Add accessor methods to aid testing.

If you can set things, you should be able to read them back.

Bug: 123601452
Test: manual
Change-Id: I3a842aa873f96872581ec49523e9a3cc1d7dbb50
parent 147f82a1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -13064,6 +13064,10 @@ package android.database.sqlite {
    method public String buildUnionSubQuery(String, String[], java.util.Set<java.lang.String>, int, String, String, String, String);
    method @Deprecated public String buildUnionSubQuery(String, String[], java.util.Set<java.lang.String>, int, String, String, String[], String, String);
    method public int delete(@NonNull android.database.sqlite.SQLiteDatabase, @Nullable String, @Nullable String[]);
    method public android.database.sqlite.SQLiteDatabase.CursorFactory getCursorFactory();
    method public boolean getDistinct();
    method public java.util.Map<java.lang.String,java.lang.String> getProjectionMap();
    method public boolean getStrict();
    method public String getTables();
    method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, String[], String, String[], String, String, String);
    method public android.database.Cursor query(android.database.sqlite.SQLiteDatabase, String[], String, String[], String, String, String, String);
+42 −0
Original line number Diff line number Diff line
@@ -76,6 +76,14 @@ public class SQLiteQueryBuilder {
        mDistinct = distinct;
    }

    /**
     * Get if the query is marked as DISTINCT, as last configured by
     * {@link #setDistinct(boolean)}.
     */
    public boolean getDistinct() {
        return mDistinct;
    }

    /**
     * Returns the list of tables being queried
     *
@@ -166,6 +174,14 @@ public class SQLiteQueryBuilder {
        mProjectionMap = columnMap;
    }

    /**
     * Gets the projection map for the query, as last configured by
     * {@link #setProjectionMap(Map)}.
     */
    public Map<String, String> getProjectionMap() {
        return mProjectionMap;
    }

    /**
     * Sets a projection greylist of columns that will be allowed through, even
     * when {@link #setStrict(boolean)} is enabled. This provides a way for
@@ -177,6 +193,16 @@ public class SQLiteQueryBuilder {
        mProjectionGreylist = projectionGreylist;
    }

    /**
     * Gets the projection greylist for the query, as last configured by
     * {@link #setProjectionGreylist(List)}.
     *
     * @hide
     */
    public List<Pattern> getProjectionGreylist() {
        return mProjectionGreylist;
    }

    /**
     * Sets the cursor factory to be used for the query.  You can use
     * one factory for all queries on a database but it is normally
@@ -188,6 +214,14 @@ public class SQLiteQueryBuilder {
        mFactory = factory;
    }

    /**
     * Sets the cursor factory to be used for the query, as last configured by
     * {@link #setCursorFactory(android.database.sqlite.SQLiteDatabase.CursorFactory)}.
     */
    public SQLiteDatabase.CursorFactory getCursorFactory() {
        return mFactory;
    }

    /**
     * When set, the selection is verified against malicious arguments.
     * When using this class to create a statement using
@@ -213,6 +247,14 @@ public class SQLiteQueryBuilder {
        mStrict = flag;
    }

    /**
     * Get if the query is marked as strict, as last configured by
     * {@link #setStrict(boolean)}.
     */
    public boolean getStrict() {
        return mStrict;
    }

    /**
     * Build an SQL query string from the given clauses.
     *