From 1baf6675aaeea3aee46f3e2d2709ab2bc9579113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Mon, 24 Mar 2014 19:37:25 +0100 Subject: 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. --- src/se/leap/bitmaskclient/EipServiceFragment.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- cgit v1.2.3