diff options
author | Arne Schwabe <arne@rfc2549.org> | 2014-01-21 20:37:05 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2014-01-21 20:37:05 +0100 |
commit | f3957386eb230ab85fa7d727c96d9ca6fe122ee3 (patch) | |
tree | 1d8c26896b8b0283c740314068f09cbe2f36ee4a /src/de/blinkt/openvpn/fragments/VPNProfileList.java | |
parent | 3dbcc517f0f060c46adf0a54024bff85d54a5982 (diff) |
Move to common code for selecting and embedding files
--HG--
extra : rebase_source : 7e0aa4672ca93e4e3b6a7c056e1004edd12f2fbc
Diffstat (limited to 'src/de/blinkt/openvpn/fragments/VPNProfileList.java')
-rw-r--r-- | src/de/blinkt/openvpn/fragments/VPNProfileList.java | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/src/de/blinkt/openvpn/fragments/VPNProfileList.java b/src/de/blinkt/openvpn/fragments/VPNProfileList.java index 1fd875b0..b26f3505 100644 --- a/src/de/blinkt/openvpn/fragments/VPNProfileList.java +++ b/src/de/blinkt/openvpn/fragments/VPNProfileList.java @@ -220,37 +220,7 @@ public class VPNProfileList extends ListFragment { @TargetApi(Build.VERSION_CODES.KITKAT) private void startFilePicker() { - - - - Intent i = new Intent(Intent.ACTION_OPEN_DOCUMENT); - i.addCategory(Intent.CATEGORY_OPENABLE); - i.setType("application/x-openvpn-profile"); - - - TreeSet<String> supportedMimeTypes = new TreeSet<String>(); - supportedMimeTypes.add("application/x-openvpn-profile"); - supportedMimeTypes.add("application/openvpn-profile"); - supportedMimeTypes.add("application/ovpn"); - - - // Webservers unfortunately report this for .conf files sometimes - supportedMimeTypes.add("text/plain"); - supportedMimeTypes.add("application/conf"); - - MimeTypeMap mtm = MimeTypeMap.getSingleton(); - - for(String ext: new String[] {"ovpn", "conf"}) { - String mimeType = mtm.getMimeTypeFromExtension(ext); - if(mimeType!=null) - supportedMimeTypes.add(mimeType); - else - supportedMimeTypes.add("application/octet-stream"); - } - - - - i.putExtra(Intent.EXTRA_MIME_TYPES, supportedMimeTypes.toArray(new String[supportedMimeTypes.size()])); + Intent i = Utils.getFilePickerIntent(Utils.FileType.OVPN_CONFIG); startActivityForResult(i, FILE_PICKER_RESULT); } |