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

Commit 41a2c47e authored by Justin Koh's avatar Justin Koh Committed by Android Git Automerger
Browse files

am 44195b4f: am 42c53fd6: Merge "Catch OperationUnsupportedException when...

am 44195b4f: am 42c53fd6: Merge "Catch OperationUnsupportedException when linkifying using WebView" into klp-modular-dev

* commit '44195b4f':
  Catch OperationUnsupportedException when linkifying using WebView
parents 69b8b79a 44195b4f
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) {