diff options
author | Arne Schwabe <arne@rfc2549.org> | 2013-12-28 13:56:45 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2013-12-28 13:56:45 +0100 |
commit | 2dde271d7058e989fccbee3d2e9c09ee3cc77b27 (patch) | |
tree | f6b418c5bc6cc26d9de961bce77261dcb6b943c3 | |
parent | 59d82987c594cf6cbf9e1fb9cd0be222fec81b16 (diff) |
lint fixes
--HG--
extra : rebase_source : 3255789b1dc3b39dddf101f46ac78d68b01ec5e4
-rw-r--r-- | res/layout-sw600dp/log_fragment.xml | 41 | ||||
-rw-r--r-- | res/layout/about.xml | 2 | ||||
-rw-r--r-- | res/layout/api_confirm.xml | 10 | ||||
-rw-r--r-- | res/layout/file_dialog.xml | 1 | ||||
-rw-r--r-- | res/layout/log_fragment.xml | 1 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/api/ExternalOpenVPNService.java | 9 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/fragments/Settings_Basic.java | 16 |
7 files changed, 42 insertions, 38 deletions
diff --git a/res/layout-sw600dp/log_fragment.xml b/res/layout-sw600dp/log_fragment.xml index d8e8562f..c4e1355c 100644 --- a/res/layout-sw600dp/log_fragment.xml +++ b/res/layout-sw600dp/log_fragment.xml @@ -3,35 +3,30 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" + android:orientation="horizontal" + android:padding="20dp" tools:context=".LogWindow"> + <LinearLayout - android:padding="20dp" + android:minWidth="300dp" + android:orientation="vertical" android:layout_width="wrap_content" - android:orientation="horizontal" android:layout_height="match_parent"> - <LinearLayout - android:minWidth="300dp" - android:orientation="vertical" - android:layout_width="wrap_content" - android:layout_height="match_parent"> - - <include layout="@layout/log_silders"/> + <include layout="@layout/log_silders"/> - <include layout="@layout/vpnstatus"/> - </LinearLayout> + <include layout="@layout/vpnstatus"/> + </LinearLayout> - <Space - android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:minWidth="5dp"/> + <Space + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:minWidth="5dp"/> - <ListView - android:id="@android:id/list" - android:transcriptMode="normal" - android:layout_width="fill_parent" - android:layout_height="match_parent"/> - </LinearLayout> -</LinearLayout>
\ No newline at end of file + <ListView + android:id="@android:id/list" + android:transcriptMode="normal" + android:layout_width="fill_parent" + android:layout_height="match_parent"/> +</LinearLayout> diff --git a/res/layout/about.xml b/res/layout/about.xml index 61343517..afe1f6ba 100644 --- a/res/layout/about.xml +++ b/res/layout/about.xml @@ -178,7 +178,7 @@ <TextView android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="Full licenses" + android:text="@string/full_licenses" android:textAppearance="?android:attr/textAppearanceLarge" /> <WebView diff --git a/res/layout/api_confirm.xml b/res/layout/api_confirm.xml index afec0df8..28624880 100644 --- a/res/layout/api_confirm.xml +++ b/res/layout/api_confirm.xml @@ -16,23 +16,25 @@ --> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:padding="3mm"> + android:padding="20dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" + tools:ignore="UseCompoundDrawables" android:gravity="center_vertical"> <ImageView android:id="@+id/icon" android:contentDescription="@string/permission_icon_app" android:layout_width="@android:dimen/app_icon_size" android:layout_height="@android:dimen/app_icon_size" - android:paddingRight="1mm"/> + android:paddingRight="5dp"/> <TextView android:id="@+id/prompt" android:layout_width="fill_parent" @@ -43,8 +45,8 @@ <TextView android:id="@+id/warning" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:paddingTop="1mm" - android:paddingBottom="1mm" + android:paddingTop="5dp" + android:paddingBottom="5dp" android:text="@string/remote_warning" android:textSize="18sp"/> diff --git a/res/layout/file_dialog.xml b/res/layout/file_dialog.xml index 8e07ce31..12abe497 100644 --- a/res/layout/file_dialog.xml +++ b/res/layout/file_dialog.xml @@ -6,6 +6,7 @@ <LinearLayout android:id="@+id/fragment_place" + android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" > </LinearLayout> diff --git a/res/layout/log_fragment.xml b/res/layout/log_fragment.xml index bcc3f9af..0b428070 100644 --- a/res/layout/log_fragment.xml +++ b/res/layout/log_fragment.xml @@ -16,6 +16,7 @@ android:text="@string/speed_waiting" android:singleLine="true" android:id="@+id/speed" + tools:ignore="InconsistentLayout" android:layout_width="match_parent" android:layout_height="wrap_content"/> diff --git a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java index c42ac065..928a85eb 100644 --- a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java +++ b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java @@ -6,6 +6,7 @@ import java.lang.ref.WeakReference; import java.util.LinkedList;
import java.util.List;
+import android.annotation.TargetApi;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
@@ -15,12 +16,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.VpnService;
-import android.os.Binder;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.RemoteCallbackList;
-import android.os.RemoteException;
+import android.os.*;
import de.blinkt.openvpn.R;
import de.blinkt.openvpn.VpnProfile;
import de.blinkt.openvpn.core.ConfigParser;
@@ -33,6 +29,7 @@ import de.blinkt.openvpn.core.OpenVpnService.LocalBinder; import de.blinkt.openvpn.core.ProfileManager;
import de.blinkt.openvpn.core.VPNLaunchHelper;
+@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
public class ExternalOpenVPNService extends Service implements StateListener {
private static final int SEND_TOALL = 0;
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) { |