diff options
Diffstat (limited to 'main/src/ui/java/de')
-rw-r--r-- | main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt b/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt index b91628a2..972ff479 100644 --- a/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt +++ b/main/src/ui/java/de/blinkt/openvpn/activities/ConfigConverter.kt @@ -612,6 +612,13 @@ class ConfigConverter : BaseActivity(), FileSelectCallback, View.OnClickListener startImportTask(Uri.fromParts("inline", "inlinetext", null), "imported profiles from AS", data); } + } else if (intent.action.equals(IMPORT_PROFILE)) { + val data = intent.data + if (data != null) { + mSourceUri = data + doImportUri(data) + + } } } @@ -658,7 +665,7 @@ class ConfigConverter : BaseActivity(), FileSelectCallback, View.OnClickListener } - private fun startImportTask(data: Uri, possibleName: String?, inlineData:String) { + private fun startImportTask(data: Uri, possibleName: String?, inlineData: String) { mImportTask = object : AsyncTask<Void, Void, Int>() { private var mProgress: ProgressBar? = null @@ -669,7 +676,7 @@ class ConfigConverter : BaseActivity(), FileSelectCallback, View.OnClickListener override fun doInBackground(vararg params: Void): Int? { try { - var inputStream:InputStream? + var inputStream: InputStream? if (data.scheme.equals("inline")) { inputStream = inlineData.byteInputStream() } else { @@ -763,10 +770,11 @@ class ConfigConverter : BaseActivity(), FileSelectCallback, View.OnClickListener } catch (e: ConfigParseError) { log(R.string.error_reading_config_file) log(e.localizedMessage) + } finally { + inputStream.close() } mResult = null - inputStream.close() } |