From 64abb3edff9c6791fac3c621ef014916a4033875 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 30 Jan 2014 20:03:29 +0100 Subject: Fix importing tos auth file on KitKat --HG-- extra : rebase_source : 31bf8f5d435be2fead8b1ec98d24566d863afab8 --- .../blinkt/openvpn/fragments/Settings_Authentication.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/de/blinkt/openvpn/fragments/Settings_Authentication.java b/src/de/blinkt/openvpn/fragments/Settings_Authentication.java index ac0d804a..b153ce4d 100644 --- a/src/de/blinkt/openvpn/fragments/Settings_Authentication.java +++ b/src/de/blinkt/openvpn/fragments/Settings_Authentication.java @@ -14,9 +14,12 @@ import android.preference.SwitchPreference; import android.util.Pair; import de.blinkt.openvpn.activities.FileSelect; import de.blinkt.openvpn.R; +import de.blinkt.openvpn.core.VpnStatus; import de.blinkt.openvpn.views.RemoteCNPreference; import de.blinkt.openvpn.VpnProfile; +import java.io.IOException; + public class Settings_Authentication extends OpenVpnPreferencesFragment implements OnPreferenceChangeListener, OnPreferenceClickListener { private static final int SELECT_TLS_FILE = 23223232; @@ -186,9 +189,13 @@ public class Settings_Authentication extends OpenVpnPreferencesFragment implemen String result = data.getStringExtra(FileSelect.RESULT_DATA); mTlsAuthFileData=result; setTlsAuthSummary(result); - - } else if (requestCode == SELECT_TLS_FILE_KITKAT && requestCode == Activity.RESULT_OK) { - + } else if (requestCode == SELECT_TLS_FILE_KITKAT && resultCode == Activity.RESULT_OK) { + try { + mTlsAuthFileData= VpnProfile.INLINE_TAG + Utils.getStringFromFilePickerResult(Utils.FileType.TLS_AUTH_FILE,data,getActivity()); + setTlsAuthSummary(mTlsAuthFileData); + } catch (IOException e) { + VpnStatus.logException(e); + } } } -- cgit v1.2.3