diff options
author | Arne Schwabe <arne@rfc2549.org> | 2022-07-22 16:34:16 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2022-07-22 16:35:02 +0200 |
commit | 552264611d9ca218a905e3e461df27e3d0f860cd (patch) | |
tree | a01b3a88a7a43ae46b1f1930d896ff968e503d42 /main/src/ui | |
parent | c1d835922541bcbb7ab88a8e3b9a80a3913a351d (diff) |
Do not delete any app permission when viewing settings (closes #1469)
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() |