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

Commit a92e760d authored by Sam Blitzstein's avatar Sam Blitzstein
Browse files

Fixed bug for non-US locale event locations.

Event locations for non-US locales were picking up false positives for
phone numbers.

Change-Id: I14551a60720c0e0606c9142e21145077ca3cddf0
parent 12158058
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1582,7 +1582,11 @@ public class Utils {
         */
        String defaultPhoneRegion = System.getProperty("user.region", "US");
        if (!defaultPhoneRegion.equals("US")) {
            CharSequence origText = textView.getText();
            // We make a copy of the spannable so that we can replace it back
            // into the textview if the first linkify pass does not work.
            // This will still maintain any spans already present in the textView argument.
            CharSequence origText =
                    Spannable.Factory.getInstance().newSpannable(textView.getText());
            Linkify.addLinks(textView, Linkify.ALL);

            // If Linkify links the entire text, use that result.
@@ -1601,7 +1605,9 @@ public class Utils {

            // Otherwise default to geo.
            textView.setText(origText);
            if (lastDitchGeo) {
                Linkify.addLinks(textView, mWildcardPattern, "geo:0,0?q=");
            }
            return;
        }