diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-08-10 14:35:15 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-08-17 09:31:34 +0200 |
commit | dbaf7070ead596f5c70ad48fc55aada2f77a856a (patch) | |
tree | c3c5c32478d1aaba490f4ff206d051fdb24f728a /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service | |
parent | 7004d129a8546977c450bd40931b0b774cd2025e (diff) | |
download | open-keychain-dbaf7070ead596f5c70ad48fc55aada2f77a856a.tar.gz open-keychain-dbaf7070ead596f5c70ad48fc55aada2f77a856a.tar.bz2 open-keychain-dbaf7070ead596f5c70ad48fc55aada2f77a856a.zip |
WIP mime parsing
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service')
2 files changed, 77 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java index dca2a08c2..ce4381140 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainService.java @@ -36,6 +36,7 @@ import org.sufficientlysecure.keychain.operations.EditKeyOperation; import org.sufficientlysecure.keychain.operations.ExportOperation; import org.sufficientlysecure.keychain.operations.ImportOperation; import org.sufficientlysecure.keychain.operations.KeybaseVerificationOperation; +import org.sufficientlysecure.keychain.operations.MimeParsingOperation; import org.sufficientlysecure.keychain.operations.PromoteKeyOperation; import org.sufficientlysecure.keychain.operations.RevokeOperation; import org.sufficientlysecure.keychain.operations.SignEncryptOperation; @@ -137,6 +138,9 @@ public class KeychainService extends Service implements Progressable { } else if (inputParcel instanceof KeybaseVerificationParcel) { op = new KeybaseVerificationOperation(outerThis, new ProviderHelper(outerThis), outerThis); + } else if (inputParcel instanceof MimeParsingParcel) { + op = new MimeParsingOperation(outerThis, new ProviderHelper(outerThis), + outerThis); } else { throw new AssertionError("Unrecognized input parcel in KeychainService!"); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/MimeParsingParcel.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/MimeParsingParcel.java new file mode 100644 index 000000000..ccc817c21 --- /dev/null +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/MimeParsingParcel.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2015 Dominik Schürmann <dominik@dominikschuermann.de> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package org.sufficientlysecure.keychain.service; + +import android.net.Uri; +import android.os.Parcel; +import android.os.Parcelable; + +public class MimeParsingParcel implements Parcelable { + + private Uri mInputUri; + private Uri mOutputUri; + + public MimeParsingParcel() { + } + + public MimeParsingParcel(Uri inputUri, Uri outputUri) { + mInputUri = inputUri; + mOutputUri = outputUri; + } + + MimeParsingParcel(Parcel source) { + // we do all of those here, so the PgpSignEncryptInput class doesn't have to be parcelable + mInputUri = source.readParcelable(getClass().getClassLoader()); + mOutputUri = source.readParcelable(getClass().getClassLoader()); + } + + public Uri getInputUri() { + return mInputUri; + } + + public Uri getOutputUri() { + return mOutputUri; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeParcelable(mInputUri, 0); + dest.writeParcelable(mOutputUri, 0); + } + + public static final Creator<MimeParsingParcel> CREATOR = new Creator<MimeParsingParcel>() { + public MimeParsingParcel createFromParcel(final Parcel source) { + return new MimeParsingParcel(source); + } + + public MimeParsingParcel[] newArray(final int size) { + return new MimeParsingParcel[size]; + } + }; + +} + |