Merge "Remove custom schema parsing in favor of Uri" into pi-dev

am: e3125c7e89

Change-Id: Ia306e77a7047d6f8bdc923cfd1ad160e4c82863c
This commit is contained in:
Jan Althaus
2018-05-14 01:31:22 -07:00
committed by android-build-merger

View File

@@ -755,14 +755,8 @@ public final class TextClassifierImpl implements TextClassifier {
@NonNull
private static List<LabeledIntent> createForUrl(Context context, String text) {
final String httpPrefix = "http://";
final String httpsPrefix = "https://";
if (text.toLowerCase().startsWith(httpPrefix)) {
text = httpPrefix + text.substring(httpPrefix.length());
} else if (text.toLowerCase().startsWith(httpsPrefix)) {
text = httpsPrefix + text.substring(httpsPrefix.length());
} else {
text = httpPrefix + text;
if (Uri.parse(text).getScheme() == null) {
text = "http://" + text;
}
return Arrays.asList(new LabeledIntent(
context.getString(com.android.internal.R.string.browse),