- // Only populate `versionRadioTextView` if there is a radio in the device.
- if (!radio.equals("")) {
- String radioLabel = getString(R.string.radio) + " ";
- SpannableStringBuilder radioStringBuilder = new SpannableStringBuilder(radioLabel + radio);
- radioStringBuilder.setSpan(blueColorSpan, radioLabel.length(), radioStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
- versionRadioTextView.setText(radioStringBuilder);
- } else { // Hide `versionRadioTextView`.
- versionRadioTextView.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);
+ }
+
+ // Only populate the Orbot text view if it is installed.
+ if (!orbot.isEmpty()) {
+ String orbotLabel = getString(R.string.orbot) + " ";
+ SpannableStringBuilder orbotStringBuilder = new SpannableStringBuilder(orbotLabel + orbot);
+ orbotStringBuilder.setSpan(blueColorSpan, orbotLabel.length(), orbotStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+ orbotTextView.setText(orbotStringBuilder);
+ } else { // Orbot is not installed.
+ orbotTextView.setVisibility(View.GONE);
+ }
+
+ // Only populate the OpenKeychain text view if it is installed.
+ if (!openKeychain.isEmpty()) {
+ String openKeychainLabel = getString(R.string.openkeychain) + " ";
+ SpannableStringBuilder openKeychainStringBuilder = new SpannableStringBuilder(openKeychainLabel + openKeychain);
+ openKeychainStringBuilder.setSpan(blueColorSpan, openKeychainLabel.length(), openKeychainStringBuilder.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+ openKeychainTextView.setText(openKeychainStringBuilder);
+ } else { //OpenKeychain is not installed.
+ openKeychainTextView.setVisibility(View.GONE);