allow setting custom headers in autocrypt setup message

This commit is contained in:
Vincent Breitmoser
2018-05-03 15:11:35 +02:00
parent a63aca623d
commit 8edd084212
5 changed files with 62 additions and 11 deletions

View File

@@ -18,6 +18,8 @@
package org.sufficientlysecure.keychain.service;
import java.util.List;
import android.net.Uri;
import android.os.Parcelable;
import android.support.annotation.Nullable;
@@ -36,15 +38,24 @@ public abstract class BackupKeyringParcel implements Parcelable {
public abstract boolean getEnableAsciiArmorOutput();
@Nullable
public abstract Uri getOutputUri();
@Nullable
public abstract List<String> getExtraHeaders();
public static BackupKeyringParcel create(long[] masterKeyIds, boolean exportSecret,
boolean isEncrypted, boolean enableAsciiArmorOutput, Uri outputUri) {
return new AutoValue_BackupKeyringParcel(
masterKeyIds, exportSecret, true, isEncrypted, enableAsciiArmorOutput, outputUri);
masterKeyIds, exportSecret, true, isEncrypted, enableAsciiArmorOutput, outputUri, null);
}
public static BackupKeyringParcel createExportAutocryptSetupMessage(long[] masterKeyIds) {
public static BackupKeyringParcel create(long[] masterKeyIds, boolean exportSecret,
boolean isEncrypted, boolean enableAsciiArmorOutput, Uri outputUri, List<String> extraHeaders) {
return new AutoValue_BackupKeyringParcel(
masterKeyIds, true, false, true, true, null);
masterKeyIds, exportSecret, true, isEncrypted, enableAsciiArmorOutput, outputUri, extraHeaders);
}
public static BackupKeyringParcel createExportAutocryptSetupMessage(long[] masterKeyIds,
List<String> extraHeaders) {
return new AutoValue_BackupKeyringParcel(
masterKeyIds, true, false, true, true, null, extraHeaders);
}
}