diff options
author | cyBerta <cyberta@riseup.net> | 2019-10-06 00:59:31 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2019-10-06 00:59:31 +0200 |
commit | 488a804c3060b3abbcbd24e6b832673d0abbb71f (patch) | |
tree | 66c7711313f419bcff17643212b4376da2aee5e9 /app/src/main/java | |
parent | 9341f1e405bba7de0ea57a0588ac54ce653ff32f (diff) |
fix merge conflict related bug with excluding apps from vpn
Diffstat (limited to 'app/src/main/java')
3 files changed, 9 insertions, 5 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java index 474e639e..0246174e 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -295,7 +295,7 @@ public final class EIP extends JobIntentService implements Observer { * @return GatewaysManager */ private GatewaysManager gatewaysFromPreferences() { - GatewaysManager gatewaysManager = new GatewaysManager(preferences); + GatewaysManager gatewaysManager = new GatewaysManager(getApplicationContext(), preferences); gatewaysManager.configureFromPreferences(); return gatewaysManager; } diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java index c7d7f86f..5da40977 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java @@ -52,8 +52,9 @@ public class GatewaysManager { private LinkedHashMap<String, Gateway> gateways = new LinkedHashMap<>(); private Type listType = new TypeToken<ArrayList<Gateway>>() {}.getType(); - GatewaysManager(SharedPreferences preferences) { + GatewaysManager(Context context, SharedPreferences preferences) { this.preferences = preferences; + this.context = context; } /** diff --git a/app/src/main/java/se/leap/bitmaskclient/fragments/ExcludeAppsFragment.java b/app/src/main/java/se/leap/bitmaskclient/fragments/ExcludeAppsFragment.java index 066c9636..63b3908d 100644 --- a/app/src/main/java/se/leap/bitmaskclient/fragments/ExcludeAppsFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/fragments/ExcludeAppsFragment.java @@ -103,16 +103,13 @@ public class ExcludeAppsFragment extends Fragment implements AdapterView.OnItemC if (isChecked) { Log.d("openvpn", "adding to allowed apps" + packageName); - apps.add(packageName); } else { Log.d("openvpn", "removing from allowed apps" + packageName); - apps.remove(packageName); } - PreferenceHelper.setExcludedApps(this.getContext(), apps); } @@ -260,6 +257,12 @@ public class ExcludeAppsFragment extends Fragment implements AdapterView.OnItemC } @Override + public void onDestroy() { + PreferenceHelper.setExcludedApps(this.getActivity().getApplicationContext(), apps); + super.onDestroy(); + } + + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); |