aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java30
1 files changed, 11 insertions, 19 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java
index 8f0a715bf..b70dd4d80 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysListFragment.java
@@ -222,7 +222,7 @@ public class ImportKeysListFragment extends ListFragment implements
@Override
public Loader<AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>>
- onCreateLoader(int id, Bundle args) {
+ onCreateLoader(int id, Bundle args) {
switch (id) {
case LOADER_ID_BYTES: {
InputData inputData = getInputData(mKeyBytes, mDataUri);
@@ -288,38 +288,30 @@ public class ImportKeysListFragment extends ListFragment implements
break;
case LOADER_ID_SERVER_QUERY:
+ case LOADER_ID_KEYBASE:
+ // TODO: possibly fine-tune message building for these two cases
if (error == null) {
AppMsg.makeText(
getActivity(), getResources().getQuantityString(R.plurals.keys_found,
mAdapter.getCount(), mAdapter.getCount()),
AppMsg.STYLE_INFO
).show();
- } else if (error instanceof Keyserver.InsufficientQuery) {
+ } else if (error instanceof Keyserver.QueryTooShortException) {
AppMsg.makeText(getActivity(), R.string.error_keyserver_insufficient_query,
AppMsg.STYLE_ALERT).show();
- } else if (error instanceof Keyserver.QueryException) {
- AppMsg.makeText(getActivity(), R.string.error_keyserver_query,
- AppMsg.STYLE_ALERT).show();
- } else if (error instanceof Keyserver.TooManyResponses) {
+ } else if (error instanceof Keyserver.TooManyResponsesException) {
AppMsg.makeText(getActivity(), R.string.error_keyserver_too_many_responses,
AppMsg.STYLE_ALERT).show();
+ } else if (error instanceof Keyserver.QueryFailedException) {
+ Log.d(Constants.TAG,
+ "Unrecoverable keyserver query error: " + error.getLocalizedMessage());
+ String alert = getActivity().getString(R.string.error_searching_keys);
+ alert = alert + " (" + error.getLocalizedMessage() + ")";
+ AppMsg.makeText(getActivity(), alert, AppMsg.STYLE_ALERT).show();
}
break;
- case LOADER_ID_KEYBASE:
-
- if (error == null) {
- AppMsg.makeText(
- getActivity(), getResources().getQuantityString(R.plurals.keys_found,
- mAdapter.getCount(), mAdapter.getCount()),
- AppMsg.STYLE_INFO
- ).show();
- } else if (error instanceof Keyserver.QueryException) {
- AppMsg.makeText(getActivity(), R.string.error_keyserver_query,
- AppMsg.STYLE_ALERT).show();
- }
-
default:
break;
}