Fixing lint complaints, removing unused resources
This commit is contained in:
@@ -29,6 +29,7 @@ import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
public class EmailKeyHelper {
|
||||
@@ -86,7 +87,7 @@ public class EmailKeyHelper {
|
||||
for (ImportKeysListEntry key : keyServer.search(mail)) {
|
||||
if (key.isRevoked() || key.isExpired()) continue;
|
||||
for (String userId : key.getUserIds()) {
|
||||
if (userId.toLowerCase().contains(mail.toLowerCase())) {
|
||||
if (userId.toLowerCase().contains(mail.toLowerCase(Locale.ENGLISH))) {
|
||||
keys.add(key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,14 +251,14 @@ public class HkpKeyserver extends Keyserver {
|
||||
data = query(request);
|
||||
} catch (HttpError e) {
|
||||
if (e.getData() != null) {
|
||||
Log.d(Constants.TAG, "returned error data: " + e.getData().toLowerCase(Locale.US));
|
||||
Log.d(Constants.TAG, "returned error data: " + e.getData().toLowerCase(Locale.ENGLISH));
|
||||
|
||||
if (e.getData().toLowerCase(Locale.US).contains("no keys found")) {
|
||||
if (e.getData().toLowerCase(Locale.ENGLISH).contains("no keys found")) {
|
||||
// NOTE: This is also a 404 error for some keyservers!
|
||||
return results;
|
||||
} else if (e.getData().toLowerCase(Locale.US).contains("too many")) {
|
||||
} else if (e.getData().toLowerCase(Locale.ENGLISH).contains("too many")) {
|
||||
throw new TooManyResponsesException();
|
||||
} else if (e.getData().toLowerCase(Locale.US).contains("insufficient")) {
|
||||
} else if (e.getData().toLowerCase(Locale.ENGLISH).contains("insufficient")) {
|
||||
throw new QueryTooShortException();
|
||||
} else if (e.getCode() == 404) {
|
||||
// NOTE: handle this 404 at last, maybe it was a "no keys found" error
|
||||
@@ -285,7 +285,7 @@ public class HkpKeyserver extends Keyserver {
|
||||
|
||||
// group 1 contains the full fingerprint (v4) or the long key id if available
|
||||
// see http://bit.ly/1d4bxbk and http://bit.ly/1gD1wwr
|
||||
String fingerprintOrKeyId = matcher.group(1).toLowerCase(Locale.US);
|
||||
String fingerprintOrKeyId = matcher.group(1).toLowerCase(Locale.ENGLISH);
|
||||
if (fingerprintOrKeyId.length() > 16) {
|
||||
entry.setFingerprintHex(fingerprintOrKeyId);
|
||||
entry.setKeyIdHex("0x" + fingerprintOrKeyId.substring(fingerprintOrKeyId.length()
|
||||
|
||||
@@ -104,7 +104,7 @@ public class PgpKeyHelper {
|
||||
* @return
|
||||
*/
|
||||
public static String convertFingerprintToHex(byte[] fingerprint) {
|
||||
String hexString = Hex.toHexString(fingerprint).toLowerCase(Locale.US);
|
||||
String hexString = Hex.toHexString(fingerprint).toLowerCase(Locale.ENGLISH);
|
||||
|
||||
return hexString;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ public class PgpKeyHelper {
|
||||
}
|
||||
|
||||
private static String convertKeyIdToHex32bit(long keyId) {
|
||||
String hexString = Long.toHexString(keyId & 0xffffffffL).toLowerCase(Locale.US);
|
||||
String hexString = Long.toHexString(keyId & 0xffffffffL).toLowerCase(Locale.ENGLISH);
|
||||
while (hexString.length() < 8) {
|
||||
hexString = "0" + hexString;
|
||||
}
|
||||
|
||||
@@ -388,8 +388,8 @@ public class PassphraseCacheService extends Service {
|
||||
} else {
|
||||
// Fallback, since expandable notifications weren't available back then
|
||||
builder.setSmallIcon(R.drawable.ic_launcher)
|
||||
.setContentTitle(String.format(getString(R.string.passp_cache_notif_n_keys,
|
||||
mPassphraseCache.size())))
|
||||
.setContentTitle(String.format(getString(R.string.passp_cache_notif_n_keys),
|
||||
mPassphraseCache.size()))
|
||||
.setContentText(getString(R.string.passp_cache_notif_click_to_clear));
|
||||
|
||||
Intent intent = new Intent(getApplicationContext(), PassphraseCacheService.class);
|
||||
|
||||
@@ -103,7 +103,7 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mExportHelper = new ExportHelper(this);
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.sufficientlysecure.keychain.util.Log;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class EncryptKeyCompletionView extends TokenCompleteTextView {
|
||||
public EncryptKeyCompletionView(Context context) {
|
||||
@@ -242,8 +243,8 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
|
||||
|
||||
@Override
|
||||
protected boolean keepObject(EncryptionKey obj, String mask) {
|
||||
String m = mask.toLowerCase();
|
||||
return obj.getUserId().toLowerCase().contains(m) ||
|
||||
String m = mask.toLowerCase(Locale.ENGLISH);
|
||||
return obj.getUserId().toLowerCase(Locale.ENGLISH).contains(m) ||
|
||||
obj.getKeyIdHex().contains(m) ||
|
||||
obj.getKeyIdHexShort().startsWith(m);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user