summaryrefslogtreecommitdiff
path: root/app/src/debug/java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-04-22 14:20:09 +0200
committerParménides GV <parmegv@sdf.org>2015-04-22 14:20:09 +0200
commit449c3953ce79947554bbfd6ed0386d68aa9f04bd (patch)
tree289724ea5320f22a63cc293f5bec96a61d203629 /app/src/debug/java
parent1a1b49a36e6c8ddccdb2a3308b6739601a691efe (diff)
Avoid the check for a null provider.
A provider can be asked if it's configured or not, so that we don't find more provider = null issues. I've created a DefaultedURL which links to https://example.net, so that we can initialize an URL. I use composition instead of inheritance, since URL class is final.
Diffstat (limited to 'app/src/debug/java')
-rw-r--r--app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java b/app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java
index aac53a07..6ab08a06 100644
--- a/app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java
+++ b/app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java
@@ -97,8 +97,7 @@ public class ConfigurationWizard extends Activity
outState.putInt(PROGRESSBAR_NUMBER, mProgressBar.getProgress());
if (progressbar_description != null)
outState.putString(PROGRESSBAR_TEXT, progressbar_description.getText().toString());
- if (selected_provider != null)
- outState.putParcelable(Provider.KEY, selected_provider);
+ outState.putParcelable(Provider.KEY, selected_provider);
super.onSaveInstanceState(outState);
}
@@ -125,8 +124,7 @@ public class ConfigurationWizard extends Activity
progress = savedInstanceState.getInt(PROGRESSBAR_NUMBER, -1);
if (fragment_manager.findFragmentByTag(ProviderDetailFragment.TAG) == null && setting_up_provider) {
- if (selected_provider != null)
- onItemSelectedUi();
+ onItemSelectedUi();
if (progress > 0)
mProgressBar.setProgress(progress);
}
@@ -393,7 +391,7 @@ public class ConfigurationWizard extends Activity
public void setUpProvider(boolean danger_on) {
Intent provider_API_command = new Intent(this, ProviderAPI.class);
Bundle parameters = new Bundle();
- parameters.putString(Provider.MAIN_URL, selected_provider.mainUrl().toString());
+ parameters.putString(Provider.MAIN_URL, selected_provider.mainUrl().getUrl().toString());
parameters.putBoolean(ProviderItem.DANGER_ON, danger_on);
parameters.putString(Provider.CA_CERT_FINGERPRINT, selected_provider.certificatePin());