File ending consisitency for backups

This commit is contained in:
Dominik Schürmann
2015-10-15 21:56:23 +02:00
parent 53680b6213
commit c03dee6fe2
3 changed files with 15 additions and 7 deletions

View File

@@ -147,12 +147,11 @@ public class BackupOperation extends BaseOperation<BackupKeyringParcel> {
String filename;
if (exportInput.mMasterKeyIds != null && exportInput.mMasterKeyIds.length == 1) {
filename = "backup_" + KeyFormattingUtils.convertKeyIdToHex(exportInput.mMasterKeyIds[0]);
filename += exportInput.mExportSecret ? ".sec.asc" : ".pub.asc";
filename = Constants.FILE_BACKUP_PREFIX + KeyFormattingUtils.convertKeyIdToHex(exportInput.mMasterKeyIds[0]);
} else {
filename = "backup_" + new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(new Date());
filename += exportInput.mExportSecret ? ".asc" : ".pub.asc";
filename = Constants.FILE_BACKUP_PREFIX + new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(new Date());
}
filename += exportInput.mExportSecret ? Constants.FILE_EXTENSION_BACKUP_SECRET : Constants.FILE_EXTENSION_BACKUP_PUBLIC;
InputData inputData = new InputData(inStream, exportedDataSize, filename);