diff options
Diffstat (limited to 'main/src/ui')
-rw-r--r-- | main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt b/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt index 0842925d..7db8cba6 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt @@ -20,6 +20,7 @@ import androidx.preference.* import de.blinkt.openvpn.BuildConfig import de.blinkt.openvpn.R import de.blinkt.openvpn.activities.OpenSSLSpeed +import de.blinkt.openvpn.api.ConfirmDialog.ANONYMOUS_PACKAGE import de.blinkt.openvpn.api.ExternalAppDatabase import de.blinkt.openvpn.core.ProfileManager import java.io.File @@ -153,13 +154,17 @@ class GeneralSettings : PreferenceFragmentCompat(), Preference.OnPreferenceClick val pm = requireActivity().packageManager val applist = StringBuilder() for (packagename in mExtapp.extAppList) { - try { - app = pm.getApplicationInfo(packagename, 0) - if (applist.length != 0) applist.append(delim) - applist.append(app.loadLabel(pm)) - } catch (e: PackageManager.NameNotFoundException) { - // App not found. Remove it from the list - mExtapp.removeApp(packagename) + if (packagename == ANONYMOUS_PACKAGE) { + applist.append("(Any app)") + } else { + try { + app = pm.getApplicationInfo(packagename, 0) + if (applist.length != 0) applist.append(delim) + applist.append(app.loadLabel(pm)) + } catch (e: PackageManager.NameNotFoundException) { + // App not found. Remove it from the list + mExtapp.removeApp(packagename) + } } } return applist.toString() |