diff options
Diffstat (limited to 'main/src/ui/java/de')
-rw-r--r-- | main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt | 6 | ||||
-rw-r--r-- | main/src/ui/java/de/blinkt/openvpn/fragments/SendDumpFragment.java | 7 |
2 files changed, 10 insertions, 3 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 3c878d4d..6ba7c6fd 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt @@ -73,8 +73,10 @@ class GeneralSettings : PreferenceFragmentCompat(), Preference.OnPreferenceClick findPreference<Preference>("restartvpnonboot") as CheckBoxPreference if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - val vpn:VpnService = VpnService() - startOnBoot.isChecked = vpn.isAlwaysOn + val vpn = VpnService() + if (vpn.isAlwaysOn) + /* This is not reliable when the VPN is not active */ + startOnBoot.isChecked } startOnBoot.onPreferenceChangeListener = diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/SendDumpFragment.java b/main/src/ui/java/de/blinkt/openvpn/fragments/SendDumpFragment.java index 6d4d2968..ae90f3d5 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/SendDumpFragment.java +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/SendDumpFragment.java @@ -36,7 +36,12 @@ public class SendDumpFragment extends Fragment { if (c.getCacheDir() == null) return null; - for (File f : c.getCacheDir().listFiles()) { + File[] filesList = c.getCacheDir().listFiles(); + + if (filesList == null) + return null; + + for (File f : filesList) { if (!f.getName().endsWith(".dmp")) continue; |