diff options
author | Arne Schwabe <arne@rfc2549.org> | 2023-06-05 13:21:01 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2023-06-05 16:43:38 +0200 |
commit | d73ff892bd4966d51a78f8d3835f7999e61de6b3 (patch) | |
tree | afdd76d2e5f1f7511c1a8b16db4d1e3aba26c75d /main/src/ui/java/de | |
parent | f18fa39fb3de6b2c899d41a01d564d429088916f (diff) |
Rename Onboot to always active
Also try to keep that connection always active
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; |