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

Commit 3e399de9 authored by Cary Clark's avatar Cary Clark
Browse files

add WebView.FindAddress option to ignore case sensitivity

New public interface is set @hide for now. Old interface
uses the new one.

Requires a companion change to external/webkit
http://b/issue?id=1649036
parent 9f655a4a
Loading
Loading
Loading
Loading
+27 −1
Original line number Diff line number Diff line
@@ -2061,7 +2061,33 @@ public class WebView extends AbsoluteLayout
     * @return the address, or if no address is found, return null.
     */
    public static String findAddress(String addr) {
        return WebViewCore.nativeFindAddress(addr);
        return findAddress(addr, false);
    }

    /**
     * @hide
     * Return the first substring consisting of the address of a physical
     * location. Currently, only addresses in the United States are detected,
     * and consist of:
     * - a house number
     * - a street name
     * - a street type (Road, Circle, etc), either spelled out or abbreviated
     * - a city name
     * - a state or territory, either spelled out or two-letter abbr.
     * - an optional 5 digit or 9 digit zip code.
     *
     * Names are optionally capitalized, and the zip code, if present,
     * must be valid for the state. The street type must be a standard USPS
     * spelling or abbreviation. The state or territory must also be spelled
     * or abbreviated using USPS standards. The house number may not exceed
     * five digits.
     * @param addr The string to search for addresses.
     * @param caseInsensitive addr Set to true to make search ignore case.
     *
     * @return the address, or if no address is found, return null.
     */
    public static String findAddress(String addr, boolean caseInsensitive) {
        return WebViewCore.nativeFindAddress(addr, caseInsensitive);
    }

    /*
+1 −1
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ final class WebViewCore {
    // JNI methods
    //-------------------------------------------------------------------------

    static native String nativeFindAddress(String addr);
    static native String nativeFindAddress(String addr, boolean caseInsensitive);

    /**
     * Empty the picture set.