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

Commit 42c53fd6 authored by Justin Koh's avatar Justin Koh Committed by Android (Google) Code Review
Browse files

Merge "Catch OperationUnsupportedException when linkifying using WebView" into klp-modular-dev

parents b7c39cee 83955cb2
Loading
Loading
Loading
Loading
+30 −23
Original line number Diff line number Diff line
@@ -465,6 +465,7 @@ public class Linkify {
        String address;
        int base = 0;

        try {
            while ((address = WebView.findAddress(string)) != null) {
                int start = string.indexOf(address);

@@ -492,6 +493,12 @@ public class Linkify {
                spec.url = "geo:0,0?q=" + encodedAddress;
                links.add(spec);
            }
        } catch (UnsupportedOperationException e) {
            // findAddress may fail with an unsupported exception on platforms without a WebView.
            // In this case, we will not append anything to the links variable: it would have died
            // in WebView.findAddress.
            return;
        }
    }

    private static final void pruneOverlaps(ArrayList<LinkSpec> links) {