- // Only populate the radio TextView if there is a radio in the device.
- if (!radio.isEmpty()) {
- String radioLabel = getString(R.string.radio) + " ";
- SpannableStringBuilder radioStringBuilder = new SpannableStringBuilder(radioLabel + radio);
- radioStringBuilder.setSpan(blueColorSpan, radioLabel.length(), radioStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
- radioTextView.setText(radioStringBuilder);
- } else { // This device does not have a radio.
- radioTextView.setVisibility(View.GONE);
+ // Only populate the WebView provider if the SDK >= 26.
+ if (Build.VERSION.SDK_INT >= 26) {
+ // Create the WebView provider label.
+ String webViewProviderLabel = getString(R.string.webview_provider) + " ";
+
+ // Get the current WebView package info.
+ PackageInfo webViewPackageInfo = WebView.getCurrentWebViewPackage();
+
+ // Remove the warning below that the package info might be null.
+ assert webViewPackageInfo != null;
+
+ // Get the WebView provider name.
+ String webViewPackageName = webViewPackageInfo.packageName;
+
+ // Create the spannable string builder.
+ SpannableStringBuilder webViewProviderStringBuilder = new SpannableStringBuilder(webViewProviderLabel + webViewPackageName);
+
+ // Apply the coloration.
+ webViewProviderStringBuilder.setSpan(blueColorSpan, webViewProviderLabel.length(), webViewProviderStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+
+ // Display the WebView provider.
+ webViewProviderTextView.setText(webViewProviderStringBuilder);
+ } else { // The API < 26.
+ // Hide the WebView provider text view.
+ webViewProviderTextView.setVisibility(View.GONE);