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-12-09 19:18:40 +0100
commit8a5be8fb481beaad45779909e726fb884476b4da (patch)
tree56bb340a35eb000ad903eb2e4364b3bac25f62d9 /src/se/leap/bitmaskclient/ConfigurationWizard.java
parent7f351332e7f308b52bbdded5e3df6a9c2c0d01e3 (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 36d90318..6c02d612 100644
--- a/src/se/leap/bitmaskclient/ConfigurationWizard.java
+++ b/src/se/leap/bitmaskclient/ConfigurationWizard.java
@@ -163,7 +163,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();
@@ -236,7 +249,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
@@ -331,7 +344,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) {
@@ -445,7 +458,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);