summaryrefslogtreecommitdiff
path: root/src/se/leap/bitmaskclient/ConfigurationWizard.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-10-14 15:52:38 +0200
committerParménides GV <parmegv@sdf.org>2013-11-19 17:54:29 +0100
commit39c95e3452f35467d0dbe89d21b0c96fa3d8ccdb (patch)
treed0a47dfd4d7f1ab3d89dbd360326163e9da04da7 /src/se/leap/bitmaskclient/ConfigurationWizard.java
parentaa2b794baeffe7afc8c3c5bbac8b76e8829af84f (diff)
Provider setup: One method downloads everything.
This method uses another 3 to download each file. Next step: broadcast progress and remove unnecessary methods.
Diffstat (limited to 'src/se/leap/bitmaskclient/ConfigurationWizard.java')
-rw-r--r--src/se/leap/bitmaskclient/ConfigurationWizard.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/se/leap/bitmaskclient/ConfigurationWizard.java b/src/se/leap/bitmaskclient/ConfigurationWizard.java
index faff4455..2c6c52c3 100644
--- a/src/se/leap/bitmaskclient/ConfigurationWizard.java
+++ b/src/se/leap/bitmaskclient/ConfigurationWizard.java
@@ -162,7 +162,20 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
mProgressBar.incrementProgressBy(1);
}
- downloadJSONFiles(provider_json, danger_on);
+
+ if (ConfigHelper.getBoolFromSharedPref(EIP.ALLOWED_ANON)){
+ mConfigState.putExtra(SERVICES_RETRIEVED, true);
+ downloadAnonCert();
+ } else {
+ mProgressBar.incrementProgressBy(1);
+ mProgressBar.setVisibility(ProgressBar.GONE);
+ progressbar_description.setVisibility(TextView.GONE);
+ //refreshProviderList(0);
+ //Toast.makeText(getApplicationContext(), R.string.success, Toast.LENGTH_LONG).show();
+ setResult(RESULT_OK);
+ showProviderDetails(getCurrentFocus());
+ }
+ //downloadJSONFiles(provider_json, danger_on);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -234,7 +247,7 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
int provider_index = getProviderIndex(id);
startProgressBar(provider_index);
mSelectedProvider = selected_provider;
- updateProviderDotJson(mSelectedProvider.providerMainUrl(), mSelectedProvider.completelyTrusted());
+ updateProviderDotJson(mSelectedProvider.providerMainUrl(), true);
}
@Override
@@ -329,7 +342,7 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
boolean custom = false;
provider_name = url_filepath.subSequence(0, url_filepath.indexOf(".")).toString();
if(ProviderListContent.ITEMS.isEmpty()) //TODO I have to implement a way of checking if a provider new or is already present in that ITEMS list
- ProviderListContent.addItem(new ProviderItem(provider_name, asset_manager.open(url_files_folder + "/" + url_filepath), custom, false));
+ ProviderListContent.addItem(new ProviderItem(provider_name, asset_manager.open(url_files_folder + "/" + url_filepath)));
loaded_preseeded_providers = true;
}
} catch (IOException e) {
@@ -443,7 +456,7 @@ implements ProviderListFragment.Callbacks, NewProviderDialog.NewProviderDialogIn
private void showProvider(final String provider_main_url, final boolean danger_on) {
String provider_name = provider_main_url.replaceFirst("http[s]?://", "").replaceFirst("\\/", "_");
- final ProviderItem added_provider = new ProviderItem(provider_name, provider_main_url, danger_on);
+ final ProviderItem added_provider = new ProviderItem(provider_name, provider_main_url);
//ProviderListContent.addItem(added_provider);
provider_list_fragment.addItem(added_provider);