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

Commit f0cfe343 authored by Jeff Hamilton's avatar Jeff Hamilton
Browse files

Add a few helpful APIs.

Change-Id: Ie57aa71eb77a1e0fb058f4eb6f40d4144a6dfce7
parent 77bdba83
Loading
Loading
Loading
Loading
+30 −11
Original line number Diff line number Diff line
@@ -61923,6 +61923,21 @@
<parameter name="sqlString" type="java.lang.String">
</parameter>
</method>
<method name="appendSelectionArgs"
 return="java.lang.String[]"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="originalValues" type="java.lang.String[]">
</parameter>
<parameter name="newValues" type="java.lang.String[]">
</parameter>
</method>
<method name="appendValueToSql"
 return="void"
 abstract="false"
@@ -104574,6 +104589,21 @@
 visibility="public"
>
</method>
<method name="getBooleanQueryParameter"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="key" type="java.lang.String">
</parameter>
<parameter name="defaultValue" type="boolean">
</parameter>
</method>
<method name="getEncodedAuthority"
 return="java.lang.String"
 abstract="true"
@@ -213236,17 +213266,6 @@
 visibility="public"
>
</method>
<method name="getVisibleTitleHeight"
 return="int"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getZoomControls"
 return="android.view.View"
 abstract="false"
+14 −0
Original line number Diff line number Diff line
@@ -1203,4 +1203,18 @@ public class DatabaseUtils {
        }
        return STATEMENT_OTHER;
    }

    /**
     * Appends one set of selection args to another. This is useful when adding a selection
     * argument to a user provided set.
     */
    public static String[] appendSelectionArgs(String[] originalValues, String[] newValues) {
        if (originalValues == null || originalValues.length == 0) {
            return newValues;
        }
        String[] result = new String[originalValues.length + newValues.length ];
        System.arraycopy(originalValues, 0, result, 0, originalValues.length);
        System.arraycopy(newValues, 0, result, originalValues.length, newValues.length);
        return result;
    }
}
+19 −1
Original line number Diff line number Diff line
@@ -1608,6 +1608,24 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
        return null;
    }

    /**
     * Searches the query string for the first value with the given key and interprets it
     * as a boolean value. "false" and "0" are interpreted as <code>false</code>, everything
     * else is interpreted as <code>true</code>.
     *
     * @param key which will be decoded
     * @param defaultValue the default value to return if there is no query parameter for key
     * @return the boolean interpretation of the query parameter key
     */
    public boolean getBooleanQueryParameter(String key, boolean defaultValue) {
        String flag = getQueryParameter(key);
        if (flag == null) {
            return defaultValue;
        }
        flag = flag.toLowerCase();
        return (!"false".equals(flag) && !"0".equals(flag));
    }

    /** Identifies a null parcelled Uri. */
    private static final int NULL_TYPE_ID = 0;