diff options
author | Parménides GV <parmegv@sdf.org> | 2014-03-24 19:37:25 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-04-02 15:39:51 +0200 |
commit | 1baf6675aaeea3aee46f3e2d2709ab2bc9579113 (patch) | |
tree | 5952357668537b4f918921b4e7c859a6ad989700 /src/se/leap/bitmaskclient/EipServiceFragment.java | |
parent | cf286c03a4a263f9cebff7a1a81d4b4f5239d05b (diff) |
Prompt to login if no anon and no existing cert.
Now we need to turn on eip if the log in dialog was triggered by the eip switch.
Diffstat (limited to 'src/se/leap/bitmaskclient/EipServiceFragment.java')
-rw-r--r-- | src/se/leap/bitmaskclient/EipServiceFragment.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/se/leap/bitmaskclient/EipServiceFragment.java b/src/se/leap/bitmaskclient/EipServiceFragment.java index 0534838d..c2849bbd 100644 --- a/src/se/leap/bitmaskclient/EipServiceFragment.java +++ b/src/se/leap/bitmaskclient/EipServiceFragment.java @@ -108,6 +108,9 @@ public class EipServiceFragment extends Fragment implements StateListener, OnChe @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (buttonView.equals(eipSwitch) && !eipAutoSwitched){ + boolean allowed_anon = getActivity().getSharedPreferences(Dashboard.SHARED_PREFERENCES, Activity.MODE_PRIVATE).getBoolean(EIP.ALLOWED_ANON, false); + String certificate = getActivity().getSharedPreferences(Dashboard.SHARED_PREFERENCES, Activity.MODE_PRIVATE).getString(EIP.CERTIFICATE, ""); + if(allowed_anon || !certificate.isEmpty()) { if (isChecked){ mEipStartPending = true; eipFragment.findViewById(R.id.eipProgress).setVisibility(View.VISIBLE); @@ -139,6 +142,11 @@ public class EipServiceFragment extends Fragment implements StateListener, OnChe eipCommand(EIP.ACTION_STOP_EIP); } } + } + else { + Dashboard dashboard = (Dashboard)getActivity(); + dashboard.logInDialog(getActivity().getCurrentFocus(), Bundle.EMPTY); + } } eipAutoSwitched = true; } |