summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/fragments
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-12-28 13:56:45 +0100
committerArne Schwabe <arne@rfc2549.org>2013-12-28 13:56:45 +0100
commit2dde271d7058e989fccbee3d2e9c09ee3cc77b27 (patch)
treef6b418c5bc6cc26d9de961bce77261dcb6b943c3 /src/de/blinkt/openvpn/fragments
parent59d82987c594cf6cbf9e1fb9cd0be222fec81b16 (diff)
lint fixes
--HG-- extra : rebase_source : 3255789b1dc3b39dddf101f46ac78d68b01ec5e4
Diffstat (limited to 'src/de/blinkt/openvpn/fragments')
-rw-r--r--src/de/blinkt/openvpn/fragments/Settings_Basic.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/de/blinkt/openvpn/fragments/Settings_Basic.java b/src/de/blinkt/openvpn/fragments/Settings_Basic.java
index cd8730dd..d18a2ed1 100644
--- a/src/de/blinkt/openvpn/fragments/Settings_Basic.java
+++ b/src/de/blinkt/openvpn/fragments/Settings_Basic.java
@@ -1,5 +1,6 @@
package de.blinkt.openvpn.fragments;
+import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
@@ -13,6 +14,7 @@ import android.os.Handler.Callback;
import android.os.Message;
import android.security.KeyChain;
import android.security.KeyChainAliasCallback;
+import android.security.KeyChainException;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
@@ -87,10 +89,10 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On
X509Certificate cert = KeyChain.getCertificateChain(getActivity(), mProfile.mAlias)[0];
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
- String algorithm= KeyChain.getPrivateKey(getActivity(),mProfile.mAlias).getAlgorithm();
- if (KeyChain.isBoundKeyAlgorithm(algorithm))
+ {
+ if (isInHardwareKeystore())
certstr+=getString(R.string.hwkeychain);
-
+ }
}
certstr+=X509Utils.getCertificateFriendlyName(cert);
@@ -111,7 +113,13 @@ public class Settings_Basic extends Fragment implements View.OnClickListener, On
}.start();
}
- @Override
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
+ private boolean isInHardwareKeystore() throws KeyChainException, InterruptedException {
+ String algorithm = KeyChain.getPrivateKey(getActivity(), mProfile.mAlias).getAlgorithm();
+ return KeyChain.isBoundKeyAlgorithm(algorithm);
+ }
+
+ @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {