diff options
Diffstat (limited to 'main')
3 files changed, 13 insertions, 6 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/activities/FileSelect.java b/main/src/main/java/de/blinkt/openvpn/activities/FileSelect.java index b0b94e66..573fdd62 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/FileSelect.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/FileSelect.java @@ -111,6 +111,8 @@ public class FileSelect extends BaseActivity { if (grantResults[0] == PackageManager.PERMISSION_DENIED) { setResult(RESULT_CANCELED); finish(); + } else { + mFSFragment.refresh(); } } diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/FileSelectionFragment.java b/main/src/main/java/de/blinkt/openvpn/fragments/FileSelectionFragment.java index f59094bf..0a9384f9 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/FileSelectionFragment.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/FileSelectionFragment.java @@ -133,6 +133,10 @@ public class FileSelectionFragment extends ListFragment { getDir(mStartPath); } + public void refresh() { + getDir(currentPath); + } + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -153,11 +157,6 @@ public class FileSelectionFragment extends ListFragment { } - /** - * Monta a estrutura de arquivos e diretorios filhos do diretorio fornecido. - * - * @param dirPath Diretorio pai. - */ private void getDirImpl(final String dirPath) { currentPath = dirPath; @@ -172,6 +171,9 @@ public class FileSelectionFragment extends ListFragment { currentPath = ROOT; f = new File(currentPath); files = f.listFiles(); + + if (files == null) + files = new File [] {}; } myPath.setText(getText(R.string.location) + ": " + currentPath); diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java index 1344b1e6..4b8f8d93 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java @@ -91,6 +91,7 @@ public class Utils { case CRL_FILE: supportedMimeTypes.add("application/x-pkcs7-crl"); supportedMimeTypes.add("application/pkix-crl"); + extensions.add("crl"); break; case USERPW_FILE: @@ -118,7 +119,9 @@ public class Utils { /* Samsung has decided to do something strange, on stock Android GET_CONTENT opens the document UI */ /* fist try with documentsui */ - i.setPackage("com.android.documentsui"); + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) + i.setPackage("com.android.documentsui"); + |