diff options
author | Parménides GV <parmegv@sdf.org> | 2014-04-02 17:08:32 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-04-02 17:08:32 +0200 |
commit | 4335ef38d5ce8040eca2a6bace5f2e4ae8a179e5 (patch) | |
tree | 15918e1f56ff9c0d60895da93c135e23065f04a9 /src/se/leap/bitmaskclient/EipServiceFragment.java | |
parent | 6cb654d169c62653d652009d3c8de51ca877e38b (diff) |
Eip switch turns off accordingly to log in state.
Diffstat (limited to 'src/se/leap/bitmaskclient/EipServiceFragment.java')
-rw-r--r-- | src/se/leap/bitmaskclient/EipServiceFragment.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/se/leap/bitmaskclient/EipServiceFragment.java b/src/se/leap/bitmaskclient/EipServiceFragment.java index bae1b942..ab4f9a5c 100644 --- a/src/se/leap/bitmaskclient/EipServiceFragment.java +++ b/src/se/leap/bitmaskclient/EipServiceFragment.java @@ -26,7 +26,7 @@ import android.widget.TextView; public class EipServiceFragment extends Fragment implements StateListener, OnCheckedChangeListener { - private static final String IS_EIP_PENDING = "is_eip_pending"; + protected static final String IS_EIP_PENDING = "is_eip_pending"; private View eipFragment; private static Switch eipSwitch; @@ -37,6 +37,8 @@ public class EipServiceFragment extends Fragment implements StateListener, OnChe private boolean mEipStartPending = false; + private boolean set_switch_off = false; + private static EIPReceiver mEIPReceiver; @@ -90,8 +92,16 @@ public class EipServiceFragment extends Fragment implements StateListener, OnChe super.onResume(); OpenVPN.addStateListener(this); + if(set_switch_off) { + eipSwitch.setChecked(false); + set_switch_off = false; + } } + protected void setSwitchOff(boolean value) { + set_switch_off = value; + } + @Override public void onPause() { super.onPause(); @@ -145,7 +155,9 @@ public class EipServiceFragment extends Fragment implements StateListener, OnChe } else { Dashboard dashboard = (Dashboard)getActivity(); - dashboard.logInDialog(getActivity().getCurrentFocus(), Bundle.EMPTY); + Bundle waiting_on_login = new Bundle(); + waiting_on_login.putBoolean(IS_EIP_PENDING, true); + dashboard.logInDialog(getActivity().getCurrentFocus(), waiting_on_login); } } eipAutoSwitched = true; @@ -282,4 +294,9 @@ public class EipServiceFragment extends Fragment implements StateListener, OnChe public static boolean isEipSwitchChecked() { return eipSwitch.isChecked(); } + + public void checkEipSwitch(boolean checked) { + eipSwitch.setChecked(checked); + onCheckedChanged(eipSwitch, checked); + } } |