Merge remote-tracking branch 'origin/master' into edit-key-rewrite
This commit is contained in:
@@ -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,37 +288,29 @@ public class ImportKeysListFragment extends ListFragment implements
|
||||
break;
|
||||
|
||||
case LOADER_ID_SERVER_QUERY:
|
||||
|
||||
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) {
|
||||
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) {
|
||||
AppMsg.makeText(getActivity(), R.string.error_keyserver_too_many_responses,
|
||||
AppMsg.STYLE_ALERT).show();
|
||||
}
|
||||
break;
|
||||
|
||||
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.QueryException) {
|
||||
AppMsg.makeText(getActivity(), R.string.error_keyserver_query,
|
||||
} else if (error instanceof Keyserver.QueryTooShortException) {
|
||||
AppMsg.makeText(getActivity(), R.string.error_keyserver_insufficient_query,
|
||||
AppMsg.STYLE_ALERT).show();
|
||||
} 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;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -94,14 +94,10 @@ public class ImportKeysListKeybaseLoader
|
||||
|
||||
mEntryList.addAll(searchResult);
|
||||
mEntryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList, null);
|
||||
} catch (Keyserver.InsufficientQuery e) {
|
||||
} catch (Keyserver.QueryFailedException e) {
|
||||
mEntryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList, e);
|
||||
} catch (Keyserver.QueryException e) {
|
||||
mEntryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList, e);
|
||||
} catch (Keyserver.TooManyResponses e) {
|
||||
} catch (Keyserver.QueryNeedsRepairException e) {
|
||||
mEntryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -116,11 +116,9 @@ public class ImportKeysListServerLoader
|
||||
mEntryList.addAll(searchResult);
|
||||
}
|
||||
mEntryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList, null);
|
||||
} catch (Keyserver.InsufficientQuery e) {
|
||||
} catch (Keyserver.QueryFailedException e) {
|
||||
mEntryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList, e);
|
||||
} catch (Keyserver.QueryException e) {
|
||||
mEntryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList, e);
|
||||
} catch (Keyserver.TooManyResponses e) {
|
||||
} catch (Keyserver.QueryNeedsRepairException e) {
|
||||
mEntryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>(mEntryList, e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user