mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-26 00:48:51 -05:00
Export cancellable - minor changes
This commit is contained in:
parent
3f649d4458
commit
ccdf646c19
@ -42,6 +42,7 @@ import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry;
|
|||||||
import org.sufficientlysecure.keychain.util.HkpKeyServer;
|
import org.sufficientlysecure.keychain.util.HkpKeyServer;
|
||||||
import org.sufficientlysecure.keychain.util.IterableIterator;
|
import org.sufficientlysecure.keychain.util.IterableIterator;
|
||||||
import org.sufficientlysecure.keychain.util.KeyServer.AddKeyException;
|
import org.sufficientlysecure.keychain.util.KeyServer.AddKeyException;
|
||||||
|
import org.sufficientlysecure.keychain.util.KeychainServiceListener;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
import org.sufficientlysecure.keychain.util.ProgressDialogUpdater;
|
import org.sufficientlysecure.keychain.util.ProgressDialogUpdater;
|
||||||
|
|
||||||
@ -51,9 +52,6 @@ import android.os.Environment;
|
|||||||
|
|
||||||
public class PgpImportExport {
|
public class PgpImportExport {
|
||||||
|
|
||||||
public interface KeychainServiceListener{
|
|
||||||
public boolean hasServiceStopped();
|
|
||||||
}
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private ProgressDialogUpdater mProgress;
|
private ProgressDialogUpdater mProgress;
|
||||||
|
|
||||||
@ -201,7 +199,7 @@ public class PgpImportExport {
|
|||||||
if (secretKeyRing != null) {
|
if (secretKeyRing != null) {
|
||||||
secretKeyRing.encode(arOutStream);
|
secretKeyRing.encode(arOutStream);
|
||||||
}
|
}
|
||||||
if(mKeychainServiceListener.hasServiceStopped()==true){
|
if(mKeychainServiceListener.hasServiceStopped()){
|
||||||
arOutStream.close();
|
arOutStream.close();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -214,7 +212,7 @@ public class PgpImportExport {
|
|||||||
publicKeyRing.encode(arOutStream);
|
publicKeyRing.encode(arOutStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mKeychainServiceListener.hasServiceStopped() == true){
|
if(mKeychainServiceListener.hasServiceStopped()){
|
||||||
arOutStream.close();
|
arOutStream.close();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
|||||||
import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry;
|
import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry;
|
||||||
import org.sufficientlysecure.keychain.util.HkpKeyServer;
|
import org.sufficientlysecure.keychain.util.HkpKeyServer;
|
||||||
import org.sufficientlysecure.keychain.util.InputData;
|
import org.sufficientlysecure.keychain.util.InputData;
|
||||||
|
import org.sufficientlysecure.keychain.util.KeychainServiceListener;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
import org.sufficientlysecure.keychain.util.ProgressDialogUpdater;
|
import org.sufficientlysecure.keychain.util.ProgressDialogUpdater;
|
||||||
|
|
||||||
@ -73,7 +74,7 @@ import android.os.RemoteException;
|
|||||||
* data from the activities or other apps, queues these intents, executes them, and stops itself
|
* data from the activities or other apps, queues these intents, executes them, and stops itself
|
||||||
* after doing them.
|
* after doing them.
|
||||||
*/
|
*/
|
||||||
public class KeychainIntentService extends IntentService implements ProgressDialogUpdater, PgpImportExport.KeychainServiceListener {
|
public class KeychainIntentService extends IntentService implements ProgressDialogUpdater, KeychainServiceListener {
|
||||||
|
|
||||||
/* extras that can be given by intent */
|
/* extras that can be given by intent */
|
||||||
public static final String EXTRA_MESSENGER = "messenger";
|
public static final String EXTRA_MESSENGER = "messenger";
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
package org.sufficientlysecure.keychain.util;
|
||||||
|
|
||||||
|
public interface KeychainServiceListener {
|
||||||
|
boolean hasServiceStopped();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user