mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-11 12:40:22 -05:00
New callback model for ImportKeysActivity
This commit is contained in:
parent
0db425b289
commit
7fc188dbd6
@ -53,15 +53,16 @@ public class KeybaseKeyserver extends Keyserver {
|
|||||||
|
|
||||||
// only list them if they have a key
|
// only list them if they have a key
|
||||||
if (JWalk.optObject(match, "components", "key_fingerprint") != null) {
|
if (JWalk.optObject(match, "components", "key_fingerprint") != null) {
|
||||||
String keybaseId = JWalk.getString(match, "components", "username", "val");
|
// TODO: needed anymore?
|
||||||
String fingerprint = JWalk.getString(match, "components", "key_fingerprint", "val");
|
// String keybaseId = JWalk.getString(match, "components", "username", "val");
|
||||||
fingerprint = fingerprint.replace(" ", "").toUpperCase();
|
// String fingerprint = JWalk.getString(match, "components", "key_fingerprint", "val");
|
||||||
|
// fingerprint = fingerprint.replace(" ", "").toUpperCase();
|
||||||
if (keybaseId.equals(query) || fingerprint.startsWith(query.toUpperCase())) {
|
// if (keybaseId.equals(query) || fingerprint.startsWith(query.toUpperCase())) {
|
||||||
results.add(makeEntry(match));
|
// results.add(makeEntry(match));
|
||||||
} else {
|
// } else {
|
||||||
results.add(makeEntry(match));
|
// results.add(makeEntry(match));
|
||||||
}
|
// }
|
||||||
|
results.add(makeEntry(match));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -18,9 +18,7 @@
|
|||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.nfc.NdefMessage;
|
import android.nfc.NdefMessage;
|
||||||
@ -31,17 +29,12 @@ import android.os.Message;
|
|||||||
import android.os.Messenger;
|
import android.os.Messenger;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v7.app.ActionBar;
|
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.util.DisplayMetrics;
|
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
|
|
||||||
import com.github.johnpersano.supertoasts.SuperCardToast;
|
import com.github.johnpersano.supertoasts.SuperCardToast;
|
||||||
import com.github.johnpersano.supertoasts.SuperToast;
|
import com.github.johnpersano.supertoasts.SuperToast;
|
||||||
@ -52,7 +45,6 @@ import org.sufficientlysecure.keychain.Constants;
|
|||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.helper.OtherHelper;
|
import org.sufficientlysecure.keychain.helper.OtherHelper;
|
||||||
import org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry;
|
import org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry;
|
||||||
import org.sufficientlysecure.keychain.keyimport.KeybaseKeyserver;
|
|
||||||
import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing;
|
import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing;
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
||||||
@ -378,8 +370,8 @@ public class ImportKeysActivity extends ActionBarActivity {
|
|||||||
startListFragment(savedInstanceState, null, null, query);
|
startListFragment(savedInstanceState, null, null, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadCallback(byte[] importData, Uri dataUri, String serverQuery, String keyServer, String keybaseQuery) {
|
public void loadCallback(ImportKeysListFragment.LoaderState loaderState) {
|
||||||
mListFragment.loadNew(importData, dataUri, serverQuery, keyServer, keybaseQuery);
|
mListFragment.loadNew(loaderState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -490,7 +482,8 @@ public class ImportKeysActivity extends ActionBarActivity {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (mListFragment.getKeyBytes() != null || mListFragment.getDataUri() != null) {
|
ImportKeysListFragment.LoaderState ls = mListFragment.getLoaderState();
|
||||||
|
if (ls instanceof ImportKeysListFragment.BytesLoaderState) {
|
||||||
Log.d(Constants.TAG, "importKeys started");
|
Log.d(Constants.TAG, "importKeys started");
|
||||||
|
|
||||||
// Send all information needed to service to import key in other thread
|
// Send all information needed to service to import key in other thread
|
||||||
@ -516,7 +509,9 @@ public class ImportKeysActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
// start service with intent
|
// start service with intent
|
||||||
startService(intent);
|
startService(intent);
|
||||||
} else if (mListFragment.getServerQuery() != null) {
|
} else if (ls instanceof ImportKeysListFragment.KeyserverLoaderState) {
|
||||||
|
ImportKeysListFragment.KeyserverLoaderState sls = (ImportKeysListFragment.KeyserverLoaderState) ls;
|
||||||
|
|
||||||
// Send all information needed to service to query keys in other thread
|
// Send all information needed to service to query keys in other thread
|
||||||
Intent intent = new Intent(this, KeychainIntentService.class);
|
Intent intent = new Intent(this, KeychainIntentService.class);
|
||||||
|
|
||||||
@ -525,7 +520,7 @@ public class ImportKeysActivity extends ActionBarActivity {
|
|||||||
// fill values for this action
|
// fill values for this action
|
||||||
Bundle data = new Bundle();
|
Bundle data = new Bundle();
|
||||||
|
|
||||||
data.putString(KeychainIntentService.DOWNLOAD_KEY_SERVER, mListFragment.getKeyServer());
|
data.putString(KeychainIntentService.DOWNLOAD_KEY_SERVER, sls.keyserver);
|
||||||
|
|
||||||
// get selected key entries
|
// get selected key entries
|
||||||
ArrayList<ImportKeysListEntry> selectedEntries = mListFragment.getSelectedEntries();
|
ArrayList<ImportKeysListEntry> selectedEntries = mListFragment.getSelectedEntries();
|
||||||
@ -542,7 +537,7 @@ public class ImportKeysActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
// start service with intent
|
// start service with intent
|
||||||
startService(intent);
|
startService(intent);
|
||||||
} else if (mListFragment.getKeybaseQuery() != null) {
|
} else if (ls instanceof ImportKeysListFragment.KeybaseLoaderState) {
|
||||||
// Send all information needed to service to query keys in other thread
|
// Send all information needed to service to query keys in other thread
|
||||||
Intent intent = new Intent(this, KeychainIntentService.class);
|
Intent intent = new Intent(this, KeychainIntentService.class);
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ public class ImportKeysFileFragment extends Fragment {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mImportActivity.loadCallback(sendText.getBytes(), null, null, null, null);
|
mImportActivity.loadCallback(new ImportKeysListFragment.BytesLoaderState(sendText.getBytes(), null));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ public class ImportKeysFileFragment extends Fragment {
|
|||||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||||
|
|
||||||
// load data
|
// load data
|
||||||
mImportActivity.loadCallback(null, data.getData(), null, null, null);
|
mImportActivity.loadCallback(new ImportKeysListFragment.BytesLoaderState(null, data.getData()));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -117,6 +117,6 @@ public class ImportKeysKeybaseFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void search(String query) {
|
private void search(String query) {
|
||||||
mImportActivity.loadCallback(null, null, null, null, query);
|
mImportActivity.loadCallback(new ImportKeysListFragment.KeybaseLoaderState(query));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,6 @@ import android.support.v4.util.LongSparseArray;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
|
||||||
import com.devspark.appmsg.AppMsg;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.helper.Preferences;
|
import org.sufficientlysecure.keychain.helper.Preferences;
|
||||||
@ -60,11 +58,7 @@ public class ImportKeysListFragment extends ListFragment implements
|
|||||||
private Activity mActivity;
|
private Activity mActivity;
|
||||||
private ImportKeysAdapter mAdapter;
|
private ImportKeysAdapter mAdapter;
|
||||||
|
|
||||||
private byte[] mKeyBytes;
|
private LoaderState mLoaderState;
|
||||||
private Uri mDataUri;
|
|
||||||
private String mServerQuery;
|
|
||||||
private String mKeyServer;
|
|
||||||
private String mKeybaseQuery;
|
|
||||||
|
|
||||||
private static final int LOADER_ID_BYTES = 0;
|
private static final int LOADER_ID_BYTES = 0;
|
||||||
private static final int LOADER_ID_SERVER_QUERY = 1;
|
private static final int LOADER_ID_SERVER_QUERY = 1;
|
||||||
@ -72,24 +66,8 @@ public class ImportKeysListFragment extends ListFragment implements
|
|||||||
|
|
||||||
private LongSparseArray<ParcelableKeyRing> mCachedKeyData;
|
private LongSparseArray<ParcelableKeyRing> mCachedKeyData;
|
||||||
|
|
||||||
public byte[] getKeyBytes() {
|
public LoaderState getLoaderState() {
|
||||||
return mKeyBytes;
|
return mLoaderState;
|
||||||
}
|
|
||||||
|
|
||||||
public Uri getDataUri() {
|
|
||||||
return mDataUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getServerQuery() {
|
|
||||||
return mServerQuery;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getKeybaseQuery() {
|
|
||||||
return mKeybaseQuery;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getKeyServer() {
|
|
||||||
return mKeyServer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ImportKeysListEntry> getData() {
|
public List<ImportKeysListEntry> getData() {
|
||||||
@ -124,6 +102,37 @@ public class ImportKeysListFragment extends ListFragment implements
|
|||||||
return frag;
|
return frag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public class LoaderState {
|
||||||
|
}
|
||||||
|
|
||||||
|
static public class BytesLoaderState extends LoaderState {
|
||||||
|
byte[] keyBytes;
|
||||||
|
Uri dataUri;
|
||||||
|
|
||||||
|
BytesLoaderState(byte[] keyBytes, Uri dataUri) {
|
||||||
|
this.keyBytes = keyBytes;
|
||||||
|
this.dataUri = dataUri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static public class KeyserverLoaderState extends LoaderState {
|
||||||
|
String serverQuery;
|
||||||
|
String keyserver;
|
||||||
|
|
||||||
|
KeyserverLoaderState(String serverQuery, String keyserver) {
|
||||||
|
this.serverQuery = serverQuery;
|
||||||
|
this.keyserver = keyserver;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static public class KeybaseLoaderState extends LoaderState {
|
||||||
|
String keybaseQuery;
|
||||||
|
|
||||||
|
KeybaseLoaderState(String keybaseQuery) {
|
||||||
|
this.keybaseQuery = keybaseQuery;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define Adapter and Loader on create of Activity
|
* Define Adapter and Loader on create of Activity
|
||||||
*/
|
*/
|
||||||
@ -140,43 +149,20 @@ public class ImportKeysListFragment extends ListFragment implements
|
|||||||
mAdapter = new ImportKeysAdapter(mActivity);
|
mAdapter = new ImportKeysAdapter(mActivity);
|
||||||
setListAdapter(mAdapter);
|
setListAdapter(mAdapter);
|
||||||
|
|
||||||
mDataUri = getArguments().getParcelable(ARG_DATA_URI);
|
if (getArguments().containsKey(ARG_DATA_URI) || getArguments().containsKey(ARG_BYTES)) {
|
||||||
mKeyBytes = getArguments().getByteArray(ARG_BYTES);
|
Uri dataUri = getArguments().getParcelable(ARG_DATA_URI);
|
||||||
mServerQuery = getArguments().getString(ARG_SERVER_QUERY);
|
byte[] bytes = getArguments().getByteArray(ARG_BYTES);
|
||||||
|
mLoaderState = new BytesLoaderState(bytes, dataUri);
|
||||||
// TODO: this is used when scanning QR Code. Currently it simply uses keyserver nr 0
|
} else if (getArguments().containsKey(ARG_SERVER_QUERY)) {
|
||||||
mKeyServer = Preferences.getPreferences(getActivity())
|
String query = getArguments().getString(ARG_SERVER_QUERY);
|
||||||
.getKeyServers()[0];
|
// TODO: this is used when scanning QR Code or updating a key.
|
||||||
|
// Currently it simply uses keyserver nr 0
|
||||||
if (mDataUri != null || mKeyBytes != null) {
|
String keyserver = Preferences.getPreferences(getActivity())
|
||||||
// Start out with a progress indicator.
|
.getKeyServers()[0];
|
||||||
setListShown(false);
|
mLoaderState = new KeyserverLoaderState(query, keyserver);
|
||||||
|
|
||||||
// Prepare the loader. Either re-connect with an existing one,
|
|
||||||
// or start a new one.
|
|
||||||
// give arguments to onCreateLoader()
|
|
||||||
getLoaderManager().initLoader(LOADER_ID_BYTES, null, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mServerQuery != null && mKeyServer != null) {
|
restartLoaders();
|
||||||
// Start out with a progress indicator.
|
|
||||||
setListShown(false);
|
|
||||||
|
|
||||||
// Prepare the loader. Either re-connect with an existing one,
|
|
||||||
// or start a new one.
|
|
||||||
// give arguments to onCreateLoader()
|
|
||||||
getLoaderManager().initLoader(LOADER_ID_SERVER_QUERY, null, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mKeybaseQuery != null) {
|
|
||||||
// Start out with a progress indicator.
|
|
||||||
setListShown(false);
|
|
||||||
|
|
||||||
// Prepare the loader. Either re-connect with an existing one,
|
|
||||||
// or start a new one.
|
|
||||||
// give arguments to onCreateLoader()
|
|
||||||
getLoaderManager().initLoader(LOADER_ID_KEYBASE, null, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -192,31 +178,33 @@ public class ImportKeysListFragment extends ListFragment implements
|
|||||||
mAdapter.notifyDataSetChanged();
|
mAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadNew(byte[] keyBytes, Uri dataUri, String serverQuery, String keyServer, String keybaseQuery) {
|
public void loadNew(LoaderState loaderState) {
|
||||||
mKeyBytes = keyBytes;
|
mLoaderState = loaderState;
|
||||||
mDataUri = dataUri;
|
|
||||||
mServerQuery = serverQuery;
|
|
||||||
mKeyServer = keyServer;
|
|
||||||
mKeybaseQuery = keybaseQuery;
|
|
||||||
|
|
||||||
if (mKeyBytes != null || mDataUri != null) {
|
restartLoaders();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void restartLoaders() {
|
||||||
|
if (mLoaderState instanceof BytesLoaderState) {
|
||||||
// Start out with a progress indicator.
|
// Start out with a progress indicator.
|
||||||
setListShown(false);
|
setListShown(false);
|
||||||
|
|
||||||
getLoaderManager().restartLoader(LOADER_ID_BYTES, null, this);
|
getLoaderManager().restartLoader(LOADER_ID_BYTES, null, this);
|
||||||
}
|
getLoaderManager().destroyLoader(LOADER_ID_SERVER_QUERY);
|
||||||
|
getLoaderManager().destroyLoader(LOADER_ID_KEYBASE);
|
||||||
if (mServerQuery != null && mKeyServer != null) {
|
} else if (mLoaderState instanceof KeyserverLoaderState) {
|
||||||
// Start out with a progress indicator.
|
// Start out with a progress indicator.
|
||||||
setListShown(false);
|
setListShown(false);
|
||||||
|
|
||||||
|
getLoaderManager().destroyLoader(LOADER_ID_BYTES);
|
||||||
getLoaderManager().restartLoader(LOADER_ID_SERVER_QUERY, null, this);
|
getLoaderManager().restartLoader(LOADER_ID_SERVER_QUERY, null, this);
|
||||||
}
|
getLoaderManager().destroyLoader(LOADER_ID_KEYBASE);
|
||||||
|
} else if (mLoaderState instanceof KeybaseLoaderState) {
|
||||||
if (mKeybaseQuery != null) {
|
|
||||||
// Start out with a progress indicator.
|
// Start out with a progress indicator.
|
||||||
setListShown(false);
|
setListShown(false);
|
||||||
|
|
||||||
|
getLoaderManager().destroyLoader(LOADER_ID_BYTES);
|
||||||
|
getLoaderManager().destroyLoader(LOADER_ID_SERVER_QUERY);
|
||||||
getLoaderManager().restartLoader(LOADER_ID_KEYBASE, null, this);
|
getLoaderManager().restartLoader(LOADER_ID_KEYBASE, null, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -226,14 +214,17 @@ public class ImportKeysListFragment extends ListFragment implements
|
|||||||
onCreateLoader(int id, Bundle args) {
|
onCreateLoader(int id, Bundle args) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case LOADER_ID_BYTES: {
|
case LOADER_ID_BYTES: {
|
||||||
InputData inputData = getInputData(mKeyBytes, mDataUri);
|
BytesLoaderState ls = (BytesLoaderState) mLoaderState;
|
||||||
|
InputData inputData = getInputData(ls.keyBytes, ls.dataUri);
|
||||||
return new ImportKeysListLoader(mActivity, inputData);
|
return new ImportKeysListLoader(mActivity, inputData);
|
||||||
}
|
}
|
||||||
case LOADER_ID_SERVER_QUERY: {
|
case LOADER_ID_SERVER_QUERY: {
|
||||||
return new ImportKeysListServerLoader(getActivity(), mServerQuery, mKeyServer);
|
KeyserverLoaderState ls = (KeyserverLoaderState) mLoaderState;
|
||||||
|
return new ImportKeysListServerLoader(getActivity(), ls.serverQuery, ls.keyserver);
|
||||||
}
|
}
|
||||||
case LOADER_ID_KEYBASE: {
|
case LOADER_ID_KEYBASE: {
|
||||||
return new ImportKeysListKeybaseLoader(getActivity(), mKeybaseQuery);
|
KeybaseLoaderState ls = (KeybaseLoaderState) mLoaderState;
|
||||||
|
return new ImportKeysListKeybaseLoader(getActivity(), ls.keybaseQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -280,7 +271,8 @@ public class ImportKeysListFragment extends ListFragment implements
|
|||||||
((ImportKeysListLoader.NonPgpPart) error).getCount() + " " + getResources().
|
((ImportKeysListLoader.NonPgpPart) error).getCount() + " " + getResources().
|
||||||
getQuantityString(R.plurals.error_import_non_pgp_part,
|
getQuantityString(R.plurals.error_import_non_pgp_part,
|
||||||
((ImportKeysListLoader.NonPgpPart) error).getCount()),
|
((ImportKeysListLoader.NonPgpPart) error).getCount()),
|
||||||
Notify.Style.OK);
|
Notify.Style.OK
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
Notify.showNotify(getActivity(), R.string.error_generic_report_bug, Notify.Style.ERROR);
|
Notify.showNotify(getActivity(), R.string.error_generic_report_bug, Notify.Style.ERROR);
|
||||||
}
|
}
|
||||||
@ -289,7 +281,6 @@ public class ImportKeysListFragment extends ListFragment implements
|
|||||||
case LOADER_ID_SERVER_QUERY:
|
case LOADER_ID_SERVER_QUERY:
|
||||||
case LOADER_ID_KEYBASE:
|
case LOADER_ID_KEYBASE:
|
||||||
|
|
||||||
// TODO: possibly fine-tune message building for these two cases
|
|
||||||
if (error == null) {
|
if (error == null) {
|
||||||
// No error
|
// No error
|
||||||
} else if (error instanceof Keyserver.QueryTooShortException) {
|
} else if (error instanceof Keyserver.QueryTooShortException) {
|
||||||
|
@ -129,7 +129,7 @@ public class ImportKeysQrCodeFragment extends Fragment {
|
|||||||
|
|
||||||
// is this a full key encoded as qr code?
|
// is this a full key encoded as qr code?
|
||||||
if (scannedContent.startsWith("-----BEGIN PGP")) {
|
if (scannedContent.startsWith("-----BEGIN PGP")) {
|
||||||
mImportActivity.loadCallback(scannedContent.getBytes(), null, null, null, null);
|
mImportActivity.loadCallback(new ImportKeysListFragment.BytesLoaderState(scannedContent.getBytes(), null));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ public class ImportKeysQrCodeFragment extends Fragment {
|
|||||||
for (String in : mQrCodeContent) {
|
for (String in : mQrCodeContent) {
|
||||||
result += in;
|
result += in;
|
||||||
}
|
}
|
||||||
mImportActivity.loadCallback(result.getBytes(), null, null, null, null);
|
mImportActivity.loadCallback(new ImportKeysListFragment.BytesLoaderState(result.getBytes(), null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,8 +170,8 @@ public class ImportKeysServerFragment extends Fragment {
|
|||||||
mImportActivity = (ImportKeysActivity) activity;
|
mImportActivity = (ImportKeysActivity) activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void search(String query, String keyServer) {
|
private void search(String query, String keyserver) {
|
||||||
mImportActivity.loadCallback(null, null, query, keyServer, null);
|
mImportActivity.loadCallback(new ImportKeysListFragment.KeyserverLoaderState(query, keyserver));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user