summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-10-06 00:59:31 +0200
committercyBerta <cyberta@riseup.net>2019-10-06 00:59:31 +0200
commit488a804c3060b3abbcbd24e6b832673d0abbb71f (patch)
tree66c7711313f419bcff17643212b4376da2aee5e9 /app/src/main/java/se/leap
parent9341f1e405bba7de0ea57a0588ac54ce653ff32f (diff)
fix merge conflict related bug with excluding apps from vpn
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/EIP.java2
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java3
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/fragments/ExcludeAppsFragment.java9
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);