diff options
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; } |