From 16903357e127aacbc7e82da5dc3c762184089a12 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 22 Aug 2015 12:22:43 +0200 Subject: mention filename to export to in log --- .../org/sufficientlysecure/keychain/operations/ExportOperation.java | 2 ++ .../sufficientlysecure/keychain/operations/results/OperationResult.java | 1 + 2 files changed, 3 insertions(+) (limited to 'OpenKeychain/src/main/java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ExportOperation.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ExportOperation.java index a5b70a41f..531ac01f2 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ExportOperation.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ExportOperation.java @@ -145,6 +145,8 @@ public class ExportOperation extends BaseOperation { return new ExportResult(ExportResult.RESULT_ERROR, log); } + log.add(LogType.MSG_EXPORT_FILE_NAME, 1, outputFile); + // check if storage is ready if (!FileHelper.isStorageMounted(outputFile)) { log.add(LogType.MSG_EXPORT_ERROR_STORAGE, 1); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java index 5ac1e89bb..a2164009a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/OperationResult.java @@ -719,6 +719,7 @@ public abstract class OperationResult implements Parcelable { MSG_IMPORT_SUCCESS (LogLevel.OK, R.string.msg_import_success), MSG_EXPORT (LogLevel.START, R.plurals.msg_export), + MSG_EXPORT_FILE_NAME (LogLevel.INFO, R.string.msg_export_file_name), MSG_EXPORT_UPLOAD_PUBLIC (LogLevel.START, R.string.msg_export_upload_public), MSG_EXPORT_PUBLIC (LogLevel.DEBUG, R.string.msg_export_public), MSG_EXPORT_SECRET (LogLevel.DEBUG, R.string.msg_export_secret), -- cgit v1.2.3 From e3d1f68e797b7d6cf27c64bef0c5d183031d4f38 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 22 Aug 2015 12:54:19 +0200 Subject: trigger indexing of file after operation (#1498) --- .../java/org/sufficientlysecure/keychain/util/ExportHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenKeychain/src/main/java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ExportHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ExportHelper.java index 5f2329170..72620e712 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ExportHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ExportHelper.java @@ -20,6 +20,8 @@ package org.sufficientlysecure.keychain.util; import java.io.File; +import android.content.Intent; +import android.net.Uri; import android.support.v4.app.FragmentActivity; import org.sufficientlysecure.keychain.Constants; @@ -98,7 +100,10 @@ public class ExportHelper } @Override - public void onCryptoOperationSuccess(ExportResult result) { + final public void onCryptoOperationSuccess(ExportResult result) { + // trigger scan of the created 'media' file so it shows up on MTP + // http://stackoverflow.com/questions/13737261/nexus-4-not-showing-files-via-mtp + mActivity.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(mExportFile))); result.createNotify(mActivity).show(); } -- cgit v1.2.3