diff options
author | cyBerta <richy@cyborgsociety.org> | 2013-12-03 22:05:12 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2013-12-04 16:03:48 +0100 |
commit | 8c54cb758514aef996a362d0c021bf0f93006ea2 (patch) | |
tree | b14b7a59b66a64cd28689bfdffdf5847bc92c936 /src/se/leap/bitmaskclient/Dashboard.java | |
parent | 017e493dc7c7e0565000d2afa76eb93c1fa5c2d6 (diff) |
logout simplified and logs removed
Diffstat (limited to 'src/se/leap/bitmaskclient/Dashboard.java')
-rw-r--r-- | src/se/leap/bitmaskclient/Dashboard.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/se/leap/bitmaskclient/Dashboard.java b/src/se/leap/bitmaskclient/Dashboard.java index 24cf13f6..65ff2800 100644 --- a/src/se/leap/bitmaskclient/Dashboard.java +++ b/src/se/leap/bitmaskclient/Dashboard.java @@ -70,8 +70,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf final public static String SHARED_PREFERENCES = "LEAPPreferences"; final public static String ACTION_QUIT = "quit"; public static final String REQUEST_CODE = "request_code"; - public static final String LOGOUT_FIRST = "logout_first"; - public static final String STOP_FIRST = "stop_first"; + @@ -124,18 +123,12 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf protected void onActivityResult(int requestCode, int resultCode, Intent data){ if ( requestCode == CONFIGURE_LEAP || requestCode == SWITCH_PROVIDER) { // It should be equivalent: if ( (requestCode == CONFIGURE_LEAP) || (data!= null && data.hasExtra(STOP_FIRST))) { - if ( resultCode == RESULT_OK ){ - if ((data != null) && (data.hasExtra(STOP_FIRST))){ - Log.d(TAG_EIP_FRAGMENT, "onActivityResult() -> eipStop!"); - eipStop(); - } else{ - Log.d(TAG_EIP_FRAGMENT, "onActivityResult() -> has no Extra STOP_FIRST"); - } - + if ( resultCode == RESULT_OK ){ ConfigHelper.saveSharedPref(EIP.PARSED_SERIAL, 0); ConfigHelper.saveSharedPref(EIP.AUTHED_EIP, authed_eip); startService( new Intent(EIP.ACTION_UPDATE_EIP_SERVICE) ); buildDashboard(); + if(data != null && data.hasExtra(LogInDialog.VERB)) { View view = ((ViewGroup)findViewById(android.R.id.content)).getChildAt(0); logInDialog(view, Bundle.EMPTY); @@ -146,7 +139,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf configErrorDialog(); } } - + /** * Dialog shown when encountering a configuration error. Such errors require * reconfiguring LEAP or aborting the application. @@ -244,6 +237,12 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf startActivity(intent); return true; case R.id.switch_provider: + if (Provider.getInstance().hasEIP()){ + if (ConfigHelper.getBoolFromSharedPref(EIP.AUTHED_EIP)){ + logOut(); + } + eipStop(); + } startActivityForResult(new Intent(this,ConfigurationWizard.class), SWITCH_PROVIDER); return true; case R.id.login_button: @@ -482,7 +481,6 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf eip_intent.setAction(EIP.ACTION_STOP_EIP); // eip_intent.putExtra(EIP.RECEIVER_TAG, eip_receiver); startService(eip_intent); - Log.d(TAG_EIP_FRAGMENT, "eipStop() -> service started to stop"); } |