Cleanup, fix advanced sharing

This commit is contained in:
Dominik Schürmann
2015-10-15 21:48:01 +02:00
parent 52c6d8f8e0
commit 53680b6213
11 changed files with 100 additions and 237 deletions

View File

@@ -23,11 +23,10 @@ import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import org.sufficientlysecure.keychain.pgp.UncachedKeyRing;
import org.sufficientlysecure.keychain.util.Passphrase;
public class ExportKeyringParcel implements Parcelable {
public class BackupKeyringParcel implements Parcelable {
public Uri mCanonicalizedPublicKeyringUri;
public Passphrase mSymmetricPassphrase;
@@ -35,15 +34,15 @@ public class ExportKeyringParcel implements Parcelable {
public long mMasterKeyIds[];
public Uri mOutputUri;
public ExportKeyringParcel(Passphrase symmetricPassphrase,
long[] masterKeyIds, boolean exportSecret, Uri outputUri) {
public BackupKeyringParcel(Passphrase symmetricPassphrase,
long[] masterKeyIds, boolean exportSecret, Uri outputUri) {
mSymmetricPassphrase = symmetricPassphrase;
mMasterKeyIds = masterKeyIds;
mExportSecret = exportSecret;
mOutputUri = outputUri;
}
protected ExportKeyringParcel(Parcel in) {
protected BackupKeyringParcel(Parcel in) {
mCanonicalizedPublicKeyringUri = (Uri) in.readValue(Uri.class.getClassLoader());
mExportSecret = in.readByte() != 0x00;
mOutputUri = (Uri) in.readValue(Uri.class.getClassLoader());
@@ -65,15 +64,15 @@ public class ExportKeyringParcel implements Parcelable {
dest.writeParcelable(mSymmetricPassphrase, 0);
}
public static final Parcelable.Creator<ExportKeyringParcel> CREATOR = new Parcelable.Creator<ExportKeyringParcel>() {
public static final Parcelable.Creator<BackupKeyringParcel> CREATOR = new Parcelable.Creator<BackupKeyringParcel>() {
@Override
public ExportKeyringParcel createFromParcel(Parcel in) {
return new ExportKeyringParcel(in);
public BackupKeyringParcel createFromParcel(Parcel in) {
return new BackupKeyringParcel(in);
}
@Override
public ExportKeyringParcel[] newArray(int size) {
return new ExportKeyringParcel[size];
public BackupKeyringParcel[] newArray(int size) {
return new BackupKeyringParcel[size];
}
};
}

View File

@@ -33,7 +33,7 @@ import org.sufficientlysecure.keychain.operations.CertifyOperation;
import org.sufficientlysecure.keychain.operations.ConsolidateOperation;
import org.sufficientlysecure.keychain.operations.DeleteOperation;
import org.sufficientlysecure.keychain.operations.EditKeyOperation;
import org.sufficientlysecure.keychain.operations.ExportOperation;
import org.sufficientlysecure.keychain.operations.BackupOperation;
import org.sufficientlysecure.keychain.operations.ImportOperation;
import org.sufficientlysecure.keychain.operations.KeybaseVerificationOperation;
import org.sufficientlysecure.keychain.operations.InputDataOperation;
@@ -125,8 +125,8 @@ public class KeychainService extends Service implements Progressable {
op = new PromoteKeyOperation(outerThis, new ProviderHelper(outerThis), outerThis, mActionCanceled);
} else if (inputParcel instanceof ImportKeyringParcel) {
op = new ImportOperation(outerThis, new ProviderHelper(outerThis), outerThis, mActionCanceled);
} else if (inputParcel instanceof ExportKeyringParcel) {
op = new ExportOperation(outerThis, new ProviderHelper(outerThis), outerThis, mActionCanceled);
} else if (inputParcel instanceof BackupKeyringParcel) {
op = new BackupOperation(outerThis, new ProviderHelper(outerThis), outerThis, mActionCanceled);
} else if (inputParcel instanceof UploadKeyringParcel) {
op = new UploadOperation(outerThis, new ProviderHelper(outerThis), outerThis, mActionCanceled);
} else if (inputParcel instanceof ConsolidateInputParcel) {