diff options
author | Parménides GV <parmegv@sdf.org> | 2015-01-12 19:18:54 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2015-01-12 19:18:54 +0100 |
commit | 32998b046977da5d272a948ad0668bf653d598f4 (patch) | |
tree | a8f68d5b09d7293ceb35211d2f26f48d4312fcf3 /app/src/main/java/se/leap/bitmaskclient/EipFragment.java | |
parent | 1d37f94a7980d1181a49863cb3880bc7938cc6d1 (diff) | |
parent | 6ed3fde3ea171700390552dd1040e10e8cc1ca32 (diff) |
Merge branch 'bug/Release-ConfigurationWizard-differs-from-debug's-#6633' into bug/ButterKnife-doesn't-find-provider_list_view-#6581
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/EipFragment.java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/EipFragment.java | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java index 420da7a1..54432033 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java @@ -56,8 +56,7 @@ public class EipFragment extends Fragment implements Observer { parent_activity = activity; Dashboard dashboard = (Dashboard) parent_activity; - Intent provider_API_command = dashboard.prepareProviderAPICommand(); - provider_API_command.setAction(ProviderAPI.DOWNLOAD_EIP_SERVICE); + Intent provider_API_command = dashboard.prepareProviderAPICommand(Bundle.EMPTY, ProviderAPI.DOWNLOAD_EIP_SERVICE); parent_activity.startService(provider_API_command); } @@ -110,15 +109,10 @@ public class EipFragment extends Fragment implements Observer { super.onSaveInstanceState(outState); } - protected void saveEipStatus() { - boolean eip_is_on = false; - Log.d(TAG, "saveEipStatus"); - if(eip_switch.isChecked()) { - eip_is_on = true; - } - - if(parent_activity != null) - Dashboard.preferences.edit().putBoolean(Dashboard.START_ON_BOOT, eip_is_on).commit(); + protected void saveStatus() { + boolean is_on = eip_switch.isChecked(); + Log.d(TAG, "saveStatus: is_on = " + is_on); + Dashboard.preferences.edit().putBoolean(Dashboard.START_ON_BOOT, is_on).commit(); } @OnCheckedChanged(R.id.eipSwitch) @@ -128,7 +122,7 @@ public class EipFragment extends Fragment implements Observer { else handleSwitchOff(); - saveEipStatus(); + saveStatus(); } private void handleSwitchOn() { @@ -139,7 +133,7 @@ public class EipFragment extends Fragment implements Observer { Dashboard dashboard = (Dashboard) parent_activity; Bundle bundle = new Bundle(); bundle.putBoolean(IS_PENDING, true); - dashboard.logInDialog(bundle); + dashboard.sessionDialog(bundle); } } @@ -193,8 +187,8 @@ public class EipFragment extends Fragment implements Observer { if(!eip_switch.isChecked()) { eip_switch.setChecked(true); - saveEipStatus(); } + saveStatus(); eipCommand(Constants.ACTION_START_EIP); } @@ -211,6 +205,7 @@ public class EipFragment extends Fragment implements Observer { String status = parent_activity.getString(R.string.eip_state_not_connected); status_message.setText(status); + eipCommand(Constants.ACTION_STOP_EIP); } @@ -343,10 +338,9 @@ public class EipFragment extends Fragment implements Observer { progress_bar.setVisibility(View.VISIBLE); status_message.setText(getString(R.string.updating_certificate_message)); if(LeapSRPSession.getToken().isEmpty() && !Dashboard.preferences.getBoolean(Constants.ALLOWED_ANON, false)) { - dashboard.logInDialog(Bundle.EMPTY); + dashboard.sessionDialog(Bundle.EMPTY); } else { - Intent provider_API_command = dashboard.prepareProviderAPICommand(); - provider_API_command.setAction(ProviderAPI.DOWNLOAD_CERTIFICATE); + Intent provider_API_command = dashboard.prepareProviderAPICommand(Bundle.EMPTY, ProviderAPI.DOWNLOAD_CERTIFICATE); parent_activity.startService(provider_API_command); } break; |