instrument: some updates to asymmetric decrypt tests
This commit is contained in:
@@ -50,14 +50,9 @@ public class EncryptFilesActivity extends EncryptActivity {
|
||||
|
||||
Intent intent = getIntent();
|
||||
String action = intent.getAction();
|
||||
Bundle extras = intent.getExtras();
|
||||
String type = intent.getType();
|
||||
ArrayList<Uri> uris = new ArrayList<>();
|
||||
|
||||
if (extras == null) {
|
||||
extras = new Bundle();
|
||||
}
|
||||
|
||||
if (intent.getData() != null) {
|
||||
uris.add(intent.getData());
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class EncryptFilesFragment
|
||||
public static final String ARG_USE_ASCII_ARMOR = "use_ascii_armor";
|
||||
public static final String ARG_URIS = "uris";
|
||||
|
||||
private static final int REQUEST_CODE_INPUT = 0x00007003;
|
||||
public static final int REQUEST_CODE_INPUT = 0x00007003;
|
||||
private static final int REQUEST_CODE_OUTPUT = 0x00007007;
|
||||
|
||||
private boolean mUseArmor;
|
||||
@@ -229,8 +229,13 @@ public class EncryptFilesFragment
|
||||
String targetName =
|
||||
(mEncryptFilenames ? "1" : FileHelper.getFilename(getActivity(), model.inputUri))
|
||||
+ (mUseArmor ? Constants.FILE_EXTENSION_ASC : Constants.FILE_EXTENSION_PGP_MAIN);
|
||||
Uri inputUri = model.inputUri;
|
||||
saveDocumentIntent(targetName, inputUri);
|
||||
}
|
||||
|
||||
private void saveDocumentIntent(String targetName, Uri inputUri) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
||||
File file = new File(model.inputUri.getPath());
|
||||
File file = new File(inputUri.getPath());
|
||||
File parentDir = file.exists() ? file.getParentFile() : Constants.Path.APP_DIR;
|
||||
File targetFile = new File(parentDir, targetName);
|
||||
FileHelper.saveFile(this, getString(R.string.title_encrypt_to_file),
|
||||
|
||||
Reference in New Issue
Block a user