summaryrefslogtreecommitdiff
path: root/app/src/debug/java/se
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-03-12 12:54:18 +0100
committerParménides GV <parmegv@sdf.org>2015-03-12 12:54:18 +0100
commit037d65da739ed2630affe181894e640fa06d35b1 (patch)
tree72c7127ff5efdb10ba6b2e85be29ea61ff99be2e /app/src/debug/java/se
parentc5124635b8272d08538889c1a9edfafe4acaf759 (diff)
Restore state on Configuration Wizard.
Diffstat (limited to 'app/src/debug/java/se')
-rw-r--r--app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java13
-rw-r--r--app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java2
2 files changed, 10 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 27984147..d28bb690 100644
--- a/app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java
+++ b/app/src/debug/java/se/leap/bitmaskclient/ConfigurationWizard.java
@@ -95,7 +95,6 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download
outState.putString(PROGRESSBAR_TEXT, progressbar_description.getText().toString());
if(selected_provider != null)
outState.putParcelable(Provider.KEY, selected_provider);
- outState.putParcelable(ProviderAPI.RECEIVER_KEY, providerAPI_result_receiver);
super.onSaveInstanceState(outState);
}
@@ -112,7 +111,6 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download
if(savedInstanceState != null)
restoreState(savedInstanceState);
- else
setUpProviderAPIResultReceiver();
}
@@ -121,8 +119,14 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download
provider_name = savedInstanceState.getString(Provider.NAME, "");
selected_provider = savedInstanceState.getParcelable(Provider.KEY);
progress = savedInstanceState.getInt(PROGRESSBAR_NUMBER, -1);
- providerAPI_result_receiver = savedInstanceState.getParcelable(ProviderAPI.RECEIVER_KEY);
- providerAPI_result_receiver.setReceiver(this);
+
+ if(fragment_manager.findFragmentByTag(ProviderDetailFragment.TAG) == null && setting_up_provider) {
+ if (selected_provider != null)
+ onItemSelectedUi(selected_provider);
+ if (progress > 0)
+ mProgressBar.setProgress(progress);
+ }
+
}
@Override
@@ -356,6 +360,7 @@ implements NewProviderDialogInterface, ProviderDetailFragmentInterface, Download
DialogFragment newFragment = ProviderDetailFragment.newInstance();
newFragment.show(fragment_transaction, ProviderDetailFragment.TAG);
+ setting_up_provider = false;
}
}
diff --git a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
index 0650f0ad..fa923948 100644
--- a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
+++ b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
@@ -675,7 +675,7 @@ public class ProviderAPI extends IntentService {
String json_file_content = "";
URL provider_url = null;
- int seconds_of_timeout = 1;
+ int seconds_of_timeout = 2;
try {
provider_url = new URL(string_url);
URLConnection url_connection = provider_url.openConnection();