From 122e562675bd64ab6fe7fa2327b12097fa122c30 Mon Sep 17 00:00:00 2001 From: Emantor Date: Mon, 3 Mar 2014 11:48:45 +0100 Subject: [PATCH 1/3] Fix ScrollViewSize Lint Warnings --- .../src/main/res/layout/api_app_register_activity.xml | 4 ++-- .../src/main/res/layout/api_app_settings_activity.xml | 4 ++-- .../src/main/res/layout/key_server_preference.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenPGP-Keychain/src/main/res/layout/api_app_register_activity.xml b/OpenPGP-Keychain/src/main/res/layout/api_app_register_activity.xml index c60416494..aa9d59004 100644 --- a/OpenPGP-Keychain/src/main/res/layout/api_app_register_activity.xml +++ b/OpenPGP-Keychain/src/main/res/layout/api_app_register_activity.xml @@ -6,7 +6,7 @@ @@ -26,4 +26,4 @@ tools:layout="@layout/api_app_settings_fragment" /> - \ No newline at end of file + diff --git a/OpenPGP-Keychain/src/main/res/layout/api_app_settings_activity.xml b/OpenPGP-Keychain/src/main/res/layout/api_app_settings_activity.xml index d4fb5103a..d83c8e87d 100644 --- a/OpenPGP-Keychain/src/main/res/layout/api_app_settings_activity.xml +++ b/OpenPGP-Keychain/src/main/res/layout/api_app_settings_activity.xml @@ -6,7 +6,7 @@ @@ -18,4 +18,4 @@ tools:layout="@layout/api_app_settings_fragment" /> - \ No newline at end of file + diff --git a/OpenPGP-Keychain/src/main/res/layout/key_server_preference.xml b/OpenPGP-Keychain/src/main/res/layout/key_server_preference.xml index 8b99e5d2f..4a09e4240 100644 --- a/OpenPGP-Keychain/src/main/res/layout/key_server_preference.xml +++ b/OpenPGP-Keychain/src/main/res/layout/key_server_preference.xml @@ -71,8 +71,8 @@ - \ No newline at end of file + From 736eac074d23091c7cd1f12ba8eea390890e2b77 Mon Sep 17 00:00:00 2001 From: Emantor Date: Mon, 3 Mar 2014 11:50:48 +0100 Subject: [PATCH 2/3] Fix DefaultLocale Lint Warnings --- .../org/sufficientlysecure/keychain/util/HkpKeyServer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java index 61fe13ffb..9c169506b 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java @@ -32,6 +32,7 @@ import java.util.List; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.Locale import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; @@ -172,11 +173,11 @@ public class HkpKeyServer extends KeyServer { if (e.getCode() == 404) { return results; } else { - if (e.getData().toLowerCase().contains("no keys found")) { + if (e.getData().toLowerCase(Locale.US).contains("no keys found")) { return results; - } else if (e.getData().toLowerCase().contains("too many")) { + } else if (e.getData().toLowerCase(Locale.US).contains("too many")) { throw new TooManyResponses(); - } else if (e.getData().toLowerCase().contains("insufficient")) { + } else if (e.getData().toLowerCase(Locale.US).contains("insufficient")) { throw new InsufficientQuery(); } } From ed7485e91d38c1201154843c983581162b2f0c0a Mon Sep 17 00:00:00 2001 From: Emantor Date: Mon, 3 Mar 2014 11:55:36 +0100 Subject: [PATCH 3/3] Fix NewApi Lint Errors Fix missing ; import android.annotation.TargetApi where needed --- .../keychain/ui/KeyListPublicFragment.java | 7 +++++-- .../keychain/ui/KeyListSecretFragment.java | 2 ++ .../org/sufficientlysecure/keychain/util/HkpKeyServer.java | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java index c28d57627..0afa556cb 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java @@ -33,6 +33,7 @@ import se.emilsjolander.stickylistheaders.ApiLevelTooLowException; import se.emilsjolander.stickylistheaders.StickyListHeadersListView; import android.annotation.SuppressLint; +import android.annotation.TargetApi; import android.content.Intent; import android.database.Cursor; import android.net.Uri; @@ -276,7 +277,8 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte viewIntent.setData(KeychainContract.KeyRings.buildPublicKeyRingsUri(Long.toString(id))); startActivity(viewIntent); } - + + @TargetApi(11) public void encrypt(ActionMode mode, long[] keyRingRowIds) { // get master key ids from row ids long[] keyRingIds = new long[keyRingRowIds.length]; @@ -298,6 +300,7 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte * * @param keyRingRowIds */ + @TargetApi(11) public void showDeleteKeyDialog(final ActionMode mode, long[] keyRingRowIds) { // Message is received after key is deleted Handler returnHandler = new Handler() { @@ -332,4 +335,4 @@ public class KeyListPublicFragment extends Fragment implements AdapterView.OnIte deleteKeyDialog.show(getActivity().getSupportFragmentManager(), "deleteKeyDialog"); } -} \ No newline at end of file +} diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListSecretFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListSecretFragment.java index f9d267f27..7bb77b60f 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListSecretFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListSecretFragment.java @@ -29,6 +29,7 @@ import org.sufficientlysecure.keychain.ui.adapter.KeyListSecretAdapter; import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment; import android.annotation.SuppressLint; +import android.annotation.TargetApi; import android.content.Intent; import android.database.Cursor; import android.net.Uri; @@ -209,6 +210,7 @@ public class KeyListSecretFragment extends ListFragment implements * * @param keyRingRowIds */ + @TargetApi(11) public void showDeleteKeyDialog(final ActionMode mode, long[] keyRingRowIds) { // Message is received after key is deleted Handler returnHandler = new Handler() { diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java index 9c169506b..b94c42e90 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/util/HkpKeyServer.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.Locale +import java.util.Locale; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse;