From 52c41f4c49efb892a4e3b433ce86342236962d3d Mon Sep 17 00:00:00 2001 From: Branden Archer Date: Sun, 31 Dec 2017 15:53:57 -0500 Subject: [PATCH] Remove file:// Uri from backup file picker On Android SDK 24+ exposing a file Uri causes a failure. Picking a file from a file chooser using data of a file:// Uri also hits this. As this is not necessary, removing the Uri. --- .../main/java/protect/card_locker/ImportExportActivity.java | 1 - .../java/protect/card_locker/ImportExportActivityTest.java | 4 ---- 2 files changed, 5 deletions(-) diff --git a/app/src/main/java/protect/card_locker/ImportExportActivity.java b/app/src/main/java/protect/card_locker/ImportExportActivity.java index 22978fb86..e323e393e 100644 --- a/app/src/main/java/protect/card_locker/ImportExportActivity.java +++ b/app/src/main/java/protect/card_locker/ImportExportActivity.java @@ -85,7 +85,6 @@ public class ImportExportActivity extends AppCompatActivity // Check that there is an activity that can bring up a file chooser final Intent intentPickAction = new Intent(Intent.ACTION_PICK); - intentPickAction.setData(Uri.parse("file://")); Button importFilesystem = (Button) findViewById(R.id.importOptionFilesystemButton); importFilesystem.setOnClickListener(new View.OnClickListener() diff --git a/app/src/test/java/protect/card_locker/ImportExportActivityTest.java b/app/src/test/java/protect/card_locker/ImportExportActivityTest.java index 7b6485782..8c096110e 100644 --- a/app/src/test/java/protect/card_locker/ImportExportActivityTest.java +++ b/app/src/test/java/protect/card_locker/ImportExportActivityTest.java @@ -40,10 +40,6 @@ public class ImportExportActivityTest info.activityInfo.exported = true; Intent intent = new Intent(handler); - if(handler.equals(Intent.ACTION_PICK)) - { - intent.setData(Uri.parse("file://")); - } if(handler.equals(Intent.ACTION_GET_CONTENT)) {