summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2017-12-12 16:20:13 +0100
committercyBerta <cyberta@riseup.net>2017-12-12 16:20:13 +0100
commit824ed42e0ed55e10cc2b6efc4d4bb20211147f64 (patch)
treedf86dc976b3e9a47573405c2cb7c59a9b7cda8d7 /app/src/main/java/se/leap
parenta60fa8124fc8c8cfc80ced0a8faa62abb39075f5 (diff)
8742 fix broken onboot feature
Diffstat (limited to 'app/src/main/java/se/leap')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/VpnFragment.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/VpnFragment.java b/app/src/main/java/se/leap/bitmaskclient/VpnFragment.java
index 77aa17c1..f857f966 100644
--- a/app/src/main/java/se/leap/bitmaskclient/VpnFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/VpnFragment.java
@@ -67,7 +67,7 @@ public class VpnFragment extends Fragment implements Observer {
@InjectView(R.id.vpn_main_button)
Button main_button;
- private static Dashboard dashboard;
+ private Dashboard dashboard;
private static EIPReceiver eip_receiver;
private static EipStatus eip_status;
private boolean wants_to_connect;
@@ -143,8 +143,7 @@ public class VpnFragment extends Fragment implements Observer {
}
private void saveStatus(boolean restartOnBoot) {
- //boolean is_on = eip_status.isConnected() || eip_status.isConnecting() || eip_status.isBlocking();
- Dashboard.preferences.edit().putBoolean(Constants.RESTART_ON_BOOT, restartOnBoot).commit();
+ Dashboard.preferences.edit().putBoolean(Constants.RESTART_ON_BOOT, restartOnBoot).apply();
}
@OnClick(R.id.vpn_main_button)
@@ -153,8 +152,6 @@ public class VpnFragment extends Fragment implements Observer {
handleSwitchOff();
else
handleSwitchOn();
- //FIXME ONBOOT IS BROKEN!
- saveStatus(eip_status.isConnected() || eip_status.isConnecting());
}
private void handleSwitchOn() {
@@ -189,9 +186,6 @@ public class VpnFragment extends Fragment implements Observer {
askPendingStartCancellation();
} else if (eip_status.isConnected()) {
askToStopEIP();
- } else if (eip_status.isBlocking()) {
- //FIXME DEAD CODE
- stop();
} else {
updateIcon();
}
@@ -217,13 +211,12 @@ public class VpnFragment extends Fragment implements Observer {
public void startEipFromScratch() {
wants_to_connect = false;
- //eip_status.setEipLevel(BLOCKING);
-
saveStatus(true);
eipCommand(Constants.ACTION_START_EIP);
}
private void stop() {
+ saveStatus(false);
if (eip_status.isBlockingVpnEstablished()) {
stopBlockingVpn();
}