diff options
author | Parménides GV <parmegv@sdf.org> | 2013-11-12 17:23:30 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2013-12-10 18:20:30 +0100 |
commit | 39d1a866d042441bf5c05520203973cb3ff5d357 (patch) | |
tree | 6917c233b5bdd985d379b3174575d25d414f1753 /src/se/leap/bitmaskclient/ConfigurationWizard.java | |
parent | 6f8a6b145f2e699258963a8a1b8f555fc96f4ead (diff) |
New provider dialog remembers previous data.
It also (supposedly, I didn't test because Bitmask is working ok from our client point of view) distinguishes between cancelling a new custom provider and cancelling a preseeded provider.
Diffstat (limited to 'src/se/leap/bitmaskclient/ConfigurationWizard.java')
-rw-r--r-- | src/se/leap/bitmaskclient/ConfigurationWizard.java | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/se/leap/bitmaskclient/ConfigurationWizard.java b/src/se/leap/bitmaskclient/ConfigurationWizard.java index 44d35370..e0a0d799 100644 --- a/src/se/leap/bitmaskclient/ConfigurationWizard.java +++ b/src/se/leap/bitmaskclient/ConfigurationWizard.java @@ -444,23 +444,19 @@ implements ProviderListFragment.Callbacks, NewProviderDialogInterface, ProviderD } public void retrySetUpProvider() { - removeLastProviderItem(); - addAndSelectNewProvider(ProviderAPI.lastProviderMainUrl(), ProviderAPI.lastDangerOn()); - /* - Intent provider_API_command = new Intent(this, ProviderAPI.class); - startService(provider_API_command); - */ - } + cancelSettingUpProvider(); + if(!ProviderAPI.caCertDownloaded()) { + addAndSelectNewProvider(ProviderAPI.lastProviderMainUrl(), ProviderAPI.lastDangerOn()); + } else { + Intent provider_API_command = new Intent(this, ProviderAPI.class); - public void retrySetUpProvider() { - Intent provider_API_command = new Intent(this, ProviderAPI.class); - - provider_API_command.setAction(ProviderAPI.SET_UP_PROVIDER); - provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPI_result_receiver); - - startService(provider_API_command); - } + provider_API_command.setAction(ProviderAPI.SET_UP_PROVIDER); + provider_API_command.putExtra(ProviderAPI.RECEIVER_KEY, providerAPI_result_receiver); + startService(provider_API_command); + } + } + @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.configuration_wizard_activity, menu);
@@ -504,11 +500,16 @@ implements ProviderListFragment.Callbacks, NewProviderDialogInterface, ProviderD provider_list_fragment.unhideAll();
}
- private void removeLastProviderItem() {
+ public void cancelSettingUpProvider() {
provider_list_fragment = (ProviderListFragment) getFragmentManager().findFragmentByTag(ProviderListFragment.TAG);
- if(provider_list_fragment != null) {
+ if(provider_list_fragment != null && ConfigHelper.sharedPrefContainsKey(ProviderItem.DANGER_ON)) {
provider_list_fragment.removeLastItem();
}
+
+ ConfigHelper.removeFromSharedPref(Provider.KEY);
+ ConfigHelper.removeFromSharedPref(ProviderItem.DANGER_ON);
+ ConfigHelper.removeFromSharedPref(EIP.ALLOWED_ANON);
+ ConfigHelper.removeFromSharedPref(EIP.KEY);
}
@Override
|