diff options
24 files changed, 27 insertions, 101 deletions
diff --git a/src/org/thialfihar/android/apg/Apg.java b/src/org/thialfihar/android/apg/Apg.java index 34c2acc6b..860893075 100644 --- a/src/org/thialfihar/android/apg/Apg.java +++ b/src/org/thialfihar/android/apg/Apg.java @@ -372,10 +372,10 @@ public class Apg { new SecureRandom(), new BouncyCastleProvider().getName()); ringGen.addSubKey(keyPair); PGPSecretKeyRing secKeyRing = ringGen.generateSecretKeyRing(); - Iterator it = secKeyRing.getSecretKeys(); + Iterator<PGPSecretKey> it = secKeyRing.getSecretKeys(); // first one is the master key it.next(); - secretKey = (PGPSecretKey) it.next(); + secretKey = it.next(); } return secretKey; @@ -1048,7 +1048,7 @@ public class Apg { } else if (i != 0 && i % 2 == 0) { fingerPrint += " "; } - String chunk = Integer.toHexString((((int)fp[i]) + 256) % 256).toUpperCase(); + String chunk = Integer.toHexString((fp[i] + 256) % 256).toUpperCase(); while (chunk.length() < 2) { chunk = "0" + chunk; } @@ -1597,7 +1597,7 @@ public class Apg { // TODO: currently we always only look at the first known key // find the secret key PGPSecretKey secretKey = null; - Iterator it = enc.getEncryptedDataObjects(); + Iterator<?> it = enc.getEncryptedDataObjects(); boolean gotAsymmetricEncryption = false; while (it.hasNext()) { Object obj = it.next(); @@ -1640,7 +1640,7 @@ public class Apg { throw new GeneralException(context.getString(R.string.error_invalidData)); } - Iterator it = enc.getEncryptedDataObjects(); + Iterator<?> it = enc.getEncryptedDataObjects(); while (it.hasNext()) { Object obj = it.next(); if (obj instanceof PGPPBEEncryptedData) { @@ -1688,7 +1688,7 @@ public class Apg { // there might be more... if (assumeSymmetric) { PGPPBEEncryptedData pbe = null; - Iterator it = enc.getEncryptedDataObjects(); + Iterator<?> it = enc.getEncryptedDataObjects(); // find secret key while (it.hasNext()) { Object obj = it.next(); @@ -1710,7 +1710,7 @@ public class Apg { progress.setProgress(R.string.progress_findingKey, currentProgress, 100); PGPPublicKeyEncryptedData pbe = null; PGPSecretKey secretKey = null; - Iterator it = enc.getEncryptedDataObjects(); + Iterator<?> it = enc.getEncryptedDataObjects(); // find secret key while (it.hasNext()) { Object obj = it.next(); @@ -1842,7 +1842,7 @@ public class Apg { if (signature != null) { progress.setProgress(R.string.progress_verifyingSignature, 90, 100); PGPSignatureList signatureList = (PGPSignatureList) plainFact.nextObject(); - PGPSignature messageSignature = (PGPSignature) signatureList.get(signatureIndex); + PGPSignature messageSignature = signatureList.get(signatureIndex); if (signature.verify(messageSignature)) { returnData.putBoolean(EXTRA_SIGNATURE_SUCCESS, true); } else { @@ -2195,13 +2195,13 @@ public class Apg { random.nextBytes(bytes); String result = ""; for (int i = 0; i < length; ++i) { - int v = ((int)bytes[i] + 256) % 64; + int v = (bytes[i] + 256) % 64; if (v < 10) { - result += (char)((int)'0' + v); + result += (char)('0' + v); } else if (v < 36) { - result += (char)((int)'A' + v - 10); + result += (char)('A' + v - 10); } else if (v < 62) { - result += (char)((int)'a' + v - 36); + result += (char)('a' + v - 36); } else if (v == 62) { result += '_'; } else if (v == 63) { diff --git a/src/org/thialfihar/android/apg/AskForSecretKeyPassPhrase.java b/src/org/thialfihar/android/apg/AskForSecretKeyPassPhrase.java index 829244e0d..bc9ddfdaf 100644 --- a/src/org/thialfihar/android/apg/AskForSecretKeyPassPhrase.java +++ b/src/org/thialfihar/android/apg/AskForSecretKeyPassPhrase.java @@ -20,8 +20,6 @@ import org.bouncycastle2.jce.provider.BouncyCastleProvider; import org.bouncycastle2.openpgp.PGPException; import org.bouncycastle2.openpgp.PGPPrivateKey; import org.bouncycastle2.openpgp.PGPSecretKey; -import org.thialfihar.android.apg.Apg.GeneralException; - import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; @@ -56,7 +54,6 @@ public class AskForSecretKeyPassPhrase { alert.setTitle(R.string.title_keyNotFound); alert.setMessage(context.getString(R.string.keyNotFound, secretKeyId)); alert.setPositiveButton(android.R.string.ok, new OnClickListener() { - @Override public void onClick(DialogInterface dialog, int which) { activity.removeDialog(Id.dialog.pass_phrase); } diff --git a/src/org/thialfihar/android/apg/BaseActivity.java b/src/org/thialfihar/android/apg/BaseActivity.java index 5226b90d6..44e6022dd 100644 --- a/src/org/thialfihar/android/apg/BaseActivity.java +++ b/src/org/thialfihar/android/apg/BaseActivity.java @@ -253,7 +253,6 @@ public class BaseActivity extends Activity final File file = new File(getDeleteFile()); showDialog(Id.dialog.deleting); mDeletingThread = new Thread(new Runnable() { - @Override public void run() { Bundle data = new Bundle(); data.putInt(Constants.extras.status, Id.message.delete_done); diff --git a/src/org/thialfihar/android/apg/CachedPassPhrase.java b/src/org/thialfihar/android/apg/CachedPassPhrase.java index 92ef708c2..4a3b86500 100644 --- a/src/org/thialfihar/android/apg/CachedPassPhrase.java +++ b/src/org/thialfihar/android/apg/CachedPassPhrase.java @@ -10,13 +10,15 @@ public class CachedPassPhrase { this.passPhrase = passPhrase; } - public int hashCode() { + @Override + public int hashCode() { int hc1 = (int)(this.timestamp & 0xffffffff); int hc2 = (this.passPhrase == null ? 0 : this.passPhrase.hashCode()); return (hc1 + hc2) * hc2 + hc1; } - public boolean equals(Object other) { + @Override + public boolean equals(Object other) { if (!(other instanceof CachedPassPhrase)) { return false; } @@ -39,7 +41,8 @@ public class CachedPassPhrase { return true; } - public String toString() { + @Override + public String toString() { return "(" + timestamp + ", *******)"; } } diff --git a/src/org/thialfihar/android/apg/DecryptActivity.java b/src/org/thialfihar/android/apg/DecryptActivity.java index 576b6d531..5f0a26451 100644 --- a/src/org/thialfihar/android/apg/DecryptActivity.java +++ b/src/org/thialfihar/android/apg/DecryptActivity.java @@ -108,7 +108,6 @@ public class DecryptActivity extends BaseActivity { mSourcePrevious.setClickable(true); mSourcePrevious.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { mSource.setInAnimation(AnimationUtils.loadAnimation(DecryptActivity.this, R.anim.push_right_in)); @@ -121,7 +120,6 @@ public class DecryptActivity extends BaseActivity { mSourceNext.setClickable(true); OnClickListener nextSourceClickListener = new OnClickListener() { - @Override public void onClick(View v) { mSource.setInAnimation(AnimationUtils.loadAnimation(DecryptActivity.this, R.anim.push_left_in)); @@ -154,7 +152,6 @@ public class DecryptActivity extends BaseActivity { mFilename = (EditText) findViewById(R.id.filename); mBrowse = (ImageButton) findViewById(R.id.btn_browse); mBrowse.setOnClickListener(new View.OnClickListener() { - @Override public void onClick(View v) { openFile(); } @@ -282,7 +279,6 @@ public class DecryptActivity extends BaseActivity { mSignatureLayout.setVisibility(View.GONE); mSignatureLayout.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { if (mSignatureKeyId == 0) { return; @@ -298,14 +294,12 @@ public class DecryptActivity extends BaseActivity { }); mDecryptButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { decryptClicked(); } }); mReplyButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { replyClicked(); } @@ -704,14 +698,12 @@ public class DecryptActivity extends BaseActivity { getString(R.string.specifyFileToDecryptTo), mOutputFilename, new FileDialog.OnClickListener() { - @Override public void onOkClick(String filename, boolean checked) { removeDialog(Id.dialog.output_filename); mOutputFilename = filename; decryptStart(); } - @Override public void onCancelClick() { removeDialog(Id.dialog.output_filename); } diff --git a/src/org/thialfihar/android/apg/EditKeyActivity.java b/src/org/thialfihar/android/apg/EditKeyActivity.java index 4bb8899ca..0d8e874b1 100644 --- a/src/org/thialfihar/android/apg/EditKeyActivity.java +++ b/src/org/thialfihar/android/apg/EditKeyActivity.java @@ -93,7 +93,6 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener { mChangePassPhrase = (Button) findViewById(R.id.btn_change_pass_phrase); mChangePassPhrase.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { showDialog(Id.dialog.new_pass_phrase); } @@ -209,7 +208,6 @@ public class EditKeyActivity extends BaseActivity implements OnClickListener { } } - @Override public void onClick(View v) { if (v == mSaveButton) { // TODO: some warning diff --git a/src/org/thialfihar/android/apg/EncryptActivity.java b/src/org/thialfihar/android/apg/EncryptActivity.java index 9ba71f570..197745a4d 100644 --- a/src/org/thialfihar/android/apg/EncryptActivity.java +++ b/src/org/thialfihar/android/apg/EncryptActivity.java @@ -119,7 +119,6 @@ public class EncryptActivity extends BaseActivity { mSourcePrevious.setClickable(true); mSourcePrevious.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { mSource.setInAnimation(AnimationUtils.loadAnimation(EncryptActivity.this, R.anim.push_right_in)); @@ -132,7 +131,6 @@ public class EncryptActivity extends BaseActivity { mSourceNext.setClickable(true); OnClickListener nextSourceClickListener = new OnClickListener() { - @Override public void onClick(View v) { mSource.setInAnimation(AnimationUtils.loadAnimation(EncryptActivity.this, R.anim.push_left_in)); @@ -154,7 +152,6 @@ public class EncryptActivity extends BaseActivity { mModePrevious.setClickable(true); mModePrevious.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { mMode.setInAnimation(AnimationUtils.loadAnimation(EncryptActivity.this, R.anim.push_right_in)); @@ -166,7 +163,6 @@ public class EncryptActivity extends BaseActivity { }); OnClickListener nextModeClickListener = new OnClickListener() { - @Override public void onClick(View v) { mMode.setInAnimation(AnimationUtils.loadAnimation(EncryptActivity.this, R.anim.push_left_in)); @@ -202,7 +198,6 @@ public class EncryptActivity extends BaseActivity { mFilename = (EditText) findViewById(R.id.filename); mBrowse = (ImageButton) findViewById(R.id.btn_browse); mBrowse.setOnClickListener(new View.OnClickListener() { - @Override public void onClick(View v) { openFile(); } @@ -234,35 +229,30 @@ public class EncryptActivity extends BaseActivity { mAsciiArmour = (CheckBox) findViewById(R.id.asciiArmour); mAsciiArmour.setChecked(mPreferences.getDefaultAsciiArmour()); mAsciiArmour.setOnClickListener(new OnClickListener() { - @Override public void onClick(View view) { guessOutputFilename(); } }); mEncryptToClipboardButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { encryptToClipboardClicked(); } }); mEncryptButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { encryptClicked(); } }); mSelectKeysButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { selectPublicKeys(); } }); mSign.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { CheckBox checkBox = (CheckBox) v; if (checkBox.isChecked()) { @@ -949,14 +939,12 @@ public class EncryptActivity extends BaseActivity { getString(R.string.specifyFileToEncryptTo), mOutputFilename, new FileDialog.OnClickListener() { - @Override public void onOkClick(String filename, boolean checked) { removeDialog(Id.dialog.output_filename); mOutputFilename = filename; encryptStart(); } - @Override public void onCancelClick() { removeDialog(Id.dialog.output_filename); } diff --git a/src/org/thialfihar/android/apg/FileDialog.java b/src/org/thialfihar/android/apg/FileDialog.java index 02eb80fdf..a054b8518 100644 --- a/src/org/thialfihar/android/apg/FileDialog.java +++ b/src/org/thialfihar/android/apg/FileDialog.java @@ -58,14 +58,13 @@ public class FileDialog { alert.setTitle(title); alert.setMessage(message); - View view = (View) inflater.inflate(R.layout.file_dialog, null); + View view = inflater.inflate(R.layout.file_dialog, null); mActivity = activity; mFilename = (EditText) view.findViewById(R.id.input); mFilename.setText(defaultFile); mBrowse = (ImageButton) view.findViewById(R.id.btn_browse); mBrowse.setOnClickListener(new View.OnClickListener() { - @Override public void onClick(View v) { openFile(); } diff --git a/src/org/thialfihar/android/apg/GeneralActivity.java b/src/org/thialfihar/android/apg/GeneralActivity.java index 01bd93f92..8f2a77e26 100644 --- a/src/org/thialfihar/android/apg/GeneralActivity.java +++ b/src/org/thialfihar/android/apg/GeneralActivity.java @@ -94,7 +94,6 @@ public class GeneralActivity extends BaseActivity { mList.setAdapter(mAdapter); mList.setOnItemClickListener(new OnItemClickListener() { - @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { clicked(mAdapter.getItem(arg2).getId()); } @@ -102,8 +101,6 @@ public class GeneralActivity extends BaseActivity { mCancelButton = (Button) findViewById(R.id.btn_cancel); mCancelButton.setOnClickListener(new OnClickListener() { - - @Override public void onClick(View v) { GeneralActivity.this.finish(); } diff --git a/src/org/thialfihar/android/apg/KeyListActivity.java b/src/org/thialfihar/android/apg/KeyListActivity.java index 57a7f5de1..b9e0087d7 100644 --- a/src/org/thialfihar/android/apg/KeyListActivity.java +++ b/src/org/thialfihar/android/apg/KeyListActivity.java @@ -86,12 +86,11 @@ public class KeyListActivity extends BaseActivity { mList = (ExpandableListView) findViewById(R.id.list); registerForContextMenu(mList); - mFilterLayout = (View) findViewById(R.id.layout_filter); + mFilterLayout = findViewById(R.id.layout_filter); mFilterInfo = (TextView) mFilterLayout.findViewById(R.id.filterInfo); mClearFilterButton = (Button) mFilterLayout.findViewById(R.id.btn_clear); mClearFilterButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { handleIntent(new Intent()); } @@ -232,8 +231,6 @@ public class KeyListActivity extends BaseActivity { getString(R.string.specifyFileToImportFrom), mImportFilename, new FileDialog.OnClickListener() { - - @Override public void onOkClick(String filename, boolean checked) { removeDialog(Id.dialog.import_keys); mDeleteAfterImport = checked; @@ -241,7 +238,6 @@ public class KeyListActivity extends BaseActivity { importKeys(); } - @Override public void onCancelClick() { removeDialog(Id.dialog.import_keys); } @@ -270,14 +266,12 @@ public class KeyListActivity extends BaseActivity { R.string.specifyFileToExportSecretKeysTo), mExportFilename, new FileDialog.OnClickListener() { - @Override public void onOkClick(String filename, boolean checked) { removeDialog(thisDialogId); mExportFilename = filename; exportKeys(); } - @Override public void onCancelClick() { removeDialog(thisDialogId); } @@ -646,12 +640,10 @@ public class KeyListActivity extends BaseActivity { return children; } - @Override public boolean hasStableIds() { return true; } - @Override public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } diff --git a/src/org/thialfihar/android/apg/KeyServerPreferenceActivity.java b/src/org/thialfihar/android/apg/KeyServerPreferenceActivity.java index 6d7dc1914..4f5a026a1 100644 --- a/src/org/thialfihar/android/apg/KeyServerPreferenceActivity.java +++ b/src/org/thialfihar/android/apg/KeyServerPreferenceActivity.java @@ -70,7 +70,6 @@ public class KeyServerPreferenceActivity extends BaseActivity Button okButton = (Button) findViewById(R.id.btn_ok); okButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { okClicked(); } @@ -78,7 +77,6 @@ public class KeyServerPreferenceActivity extends BaseActivity Button cancelButton = (Button) findViewById(R.id.btn_cancel); cancelButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { cancelClicked(); } diff --git a/src/org/thialfihar/android/apg/KeyServerQueryActivity.java b/src/org/thialfihar/android/apg/KeyServerQueryActivity.java index 01cfec0c0..8c4829dda 100644 --- a/src/org/thialfihar/android/apg/KeyServerQueryActivity.java +++ b/src/org/thialfihar/android/apg/KeyServerQueryActivity.java @@ -71,14 +71,12 @@ public class KeyServerQueryActivity extends BaseActivity { } mList.setOnItemClickListener(new OnItemClickListener() { - @Override public void onItemClick(AdapterView<?> adapter, View view, int position, long keyId) { get(keyId); } }); mSearch.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { String query = mQuery.getText().toString(); search(query); @@ -112,7 +110,8 @@ public class KeyServerQueryActivity extends BaseActivity { startThread(); } - protected Dialog onCreateDialog(int id) { + @Override + protected Dialog onCreateDialog(int id) { ProgressDialog progress = (ProgressDialog) super.onCreateDialog(id); progress.setMessage(this.getString(R.string.progress_queryingServer, (String)mKeyServer.getSelectedItem())); @@ -211,22 +210,18 @@ public class KeyServerQueryActivity extends BaseActivity { return true; } - @Override public int getCount() { return mKeys.size(); } - @Override public Object getItem(int position) { return mKeys.get(position); } - @Override public long getItemId(int position) { return mKeys.get(position).keyId; } - @Override public View getView(int position, View convertView, ViewGroup parent) { KeyInfo keyInfo = mKeys.get(position); diff --git a/src/org/thialfihar/android/apg/MailListActivity.java b/src/org/thialfihar/android/apg/MailListActivity.java index 9bcf5eaf8..2f3108644 100644 --- a/src/org/thialfihar/android/apg/MailListActivity.java +++ b/src/org/thialfihar/android/apg/MailListActivity.java @@ -153,7 +153,6 @@ public class MailListActivity extends ListActivity { setListAdapter(new MailboxAdapter()); getListView().setOnItemClickListener(new OnItemClickListener() { - @Override public void onItemClick(AdapterView<?> arg0, View v, int position, long id) { Intent intent = new Intent(MailListActivity.this, DecryptActivity.class); intent.setAction(Apg.Intent.DECRYPT); @@ -179,22 +178,18 @@ public class MailListActivity extends ListActivity { return true; } - @Override public int getCount() { return mMessages.size(); } - @Override public Object getItem(int position) { return mMessages.get(position); } - @Override public long getItemId(int position) { return mMessages.get(position).id; } - @Override public View getView(int position, View convertView, ViewGroup parent) { View view = mInflater.inflate(R.layout.mailbox_message_item, null); diff --git a/src/org/thialfihar/android/apg/MainActivity.java b/src/org/thialfihar/android/apg/MainActivity.java index 5a07b0a42..e7f2d5199 100644 --- a/src/org/thialfihar/android/apg/MainActivity.java +++ b/src/org/thialfihar/android/apg/MainActivity.java @@ -67,7 +67,6 @@ public class MainActivity extends BaseActivity { mAccounts = (ListView) findViewById(R.id.accounts); encryptMessageButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, EncryptActivity.class); intent.setAction(Apg.Intent.ENCRYPT); @@ -76,7 +75,6 @@ public class MainActivity extends BaseActivity { }); decryptMessageButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, DecryptActivity.class); intent.setAction(Apg.Intent.DECRYPT); @@ -85,7 +83,6 @@ public class MainActivity extends BaseActivity { }); encryptFileButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, EncryptActivity.class); intent.setAction(Apg.Intent.ENCRYPT_FILE); @@ -94,7 +91,6 @@ public class MainActivity extends BaseActivity { }); decryptFileButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, DecryptActivity.class); intent.setAction(Apg.Intent.DECRYPT_FILE); @@ -113,7 +109,6 @@ public class MainActivity extends BaseActivity { mListAdapter = new AccountListAdapter(this, mAccountCursor); mAccounts.setAdapter(mListAdapter); mAccounts.setOnItemClickListener(new OnItemClickListener() { - @Override public void onItemClick(AdapterView<?> arg0, View view, int index, long id) { String accountName = (String) mAccounts.getItemAtPosition(index); startActivity(new Intent(MainActivity.this, MailListActivity.class) @@ -142,7 +137,7 @@ public class MainActivity extends BaseActivity { LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); - View view = (View) inflater.inflate(R.layout.add_account_dialog, null); + View view = inflater.inflate(R.layout.add_account_dialog, null); final EditText input = (EditText) view.findViewById(R.id.input); alert.setView(view); diff --git a/src/org/thialfihar/android/apg/SecretKeyListActivity.java b/src/org/thialfihar/android/apg/SecretKeyListActivity.java index d3c89ddc9..8410eb0f0 100644 --- a/src/org/thialfihar/android/apg/SecretKeyListActivity.java +++ b/src/org/thialfihar/android/apg/SecretKeyListActivity.java @@ -106,7 +106,6 @@ public class SecretKeyListActivity extends KeyListActivity implements OnChildCli } } - @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { mSelectedItem = groupPosition; diff --git a/src/org/thialfihar/android/apg/SelectPublicKeyListActivity.java b/src/org/thialfihar/android/apg/SelectPublicKeyListActivity.java index 53cf5f720..40b261d1b 100644 --- a/src/org/thialfihar/android/apg/SelectPublicKeyListActivity.java +++ b/src/org/thialfihar/android/apg/SelectPublicKeyListActivity.java @@ -48,7 +48,6 @@ public class SelectPublicKeyListActivity extends BaseActivity { Button okButton = (Button) findViewById(R.id.btn_ok); okButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { okClicked(); } @@ -56,18 +55,16 @@ public class SelectPublicKeyListActivity extends BaseActivity { Button cancelButton = (Button) findViewById(R.id.btn_cancel); cancelButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { cancelClicked(); } }); - mFilterLayout = (View) findViewById(R.id.layout_filter); + mFilterLayout = findViewById(R.id.layout_filter); mFilterInfo = (TextView) mFilterLayout.findViewById(R.id.filterInfo); mClearFilterButton = (Button) mFilterLayout.findViewById(R.id.btn_clear); mClearFilterButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { handleIntent(new Intent()); } diff --git a/src/org/thialfihar/android/apg/SelectPublicKeyListAdapter.java b/src/org/thialfihar/android/apg/SelectPublicKeyListAdapter.java index 8eaa400ee..5933aad64 100644 --- a/src/org/thialfihar/android/apg/SelectPublicKeyListAdapter.java +++ b/src/org/thialfihar/android/apg/SelectPublicKeyListAdapter.java @@ -143,24 +143,20 @@ public class SelectPublicKeyListAdapter extends BaseAdapter { return true; } - @Override public int getCount() { return mCursor.getCount(); } - @Override public Object getItem(int position) { mCursor.moveToPosition(position); return mCursor.getString(2); // USER_ID } - @Override public long getItemId(int position) { mCursor.moveToPosition(position); return mCursor.getLong(1); // MASTER_KEY_ID } - @Override public View getView(int position, View convertView, ViewGroup parent) { mCursor.moveToPosition(position); diff --git a/src/org/thialfihar/android/apg/SelectSecretKeyListActivity.java b/src/org/thialfihar/android/apg/SelectSecretKeyListActivity.java index 36bd482e5..45aac9d08 100644 --- a/src/org/thialfihar/android/apg/SelectSecretKeyListActivity.java +++ b/src/org/thialfihar/android/apg/SelectSecretKeyListActivity.java @@ -48,7 +48,6 @@ public class SelectSecretKeyListActivity extends BaseActivity { mList = (ListView) findViewById(R.id.list); mList.setOnItemClickListener(new OnItemClickListener() { - @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { Intent data = new Intent(); data.putExtra(Apg.EXTRA_KEY_ID, id); @@ -58,12 +57,11 @@ public class SelectSecretKeyListActivity extends BaseActivity { } }); - mFilterLayout = (View) findViewById(R.id.layout_filter); + mFilterLayout = findViewById(R.id.layout_filter); mFilterInfo = (TextView) mFilterLayout.findViewById(R.id.filterInfo); mClearFilterButton = (Button) mFilterLayout.findViewById(R.id.btn_clear); mClearFilterButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { handleIntent(new Intent()); } diff --git a/src/org/thialfihar/android/apg/SelectSecretKeyListAdapter.java b/src/org/thialfihar/android/apg/SelectSecretKeyListAdapter.java index 3b41d1626..405498d7c 100644 --- a/src/org/thialfihar/android/apg/SelectSecretKeyListAdapter.java +++ b/src/org/thialfihar/android/apg/SelectSecretKeyListAdapter.java @@ -102,24 +102,20 @@ public class SelectSecretKeyListAdapter extends BaseAdapter { return true; } - @Override public int getCount() { return mCursor.getCount(); } - @Override public Object getItem(int position) { mCursor.moveToPosition(position); return mCursor.getString(2); // USER_ID } - @Override public long getItemId(int position) { mCursor.moveToPosition(position); return mCursor.getLong(1); // MASTER_KEY_ID } - @Override public View getView(int position, View convertView, ViewGroup parent) { mCursor.moveToPosition(position); diff --git a/src/org/thialfihar/android/apg/ui/widget/KeyEditor.java b/src/org/thialfihar/android/apg/ui/widget/KeyEditor.java index dbdae9def..9de10acfa 100644 --- a/src/org/thialfihar/android/apg/ui/widget/KeyEditor.java +++ b/src/org/thialfihar/android/apg/ui/widget/KeyEditor.java @@ -105,7 +105,6 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { setExpiryDate(null); mExpiryDateButton.setOnClickListener(new OnClickListener() { - @Override public void onClick(View v) { GregorianCalendar date = mExpiryDate; if (date == null) { @@ -201,7 +200,6 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { return mKey; } - @Override public void onClick(View v) { final ViewGroup parent = (ViewGroup)getParent(); if (v == mDeleteButton) { @@ -212,7 +210,6 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { } } - @Override public void setEditorListener(EditorListener listener) { mEditorListener = listener; } diff --git a/src/org/thialfihar/android/apg/ui/widget/KeyServerEditor.java b/src/org/thialfihar/android/apg/ui/widget/KeyServerEditor.java index 4e1fed398..cbea7f031 100644 --- a/src/org/thialfihar/android/apg/ui/widget/KeyServerEditor.java +++ b/src/org/thialfihar/android/apg/ui/widget/KeyServerEditor.java @@ -62,7 +62,6 @@ public class KeyServerEditor extends LinearLayout implements Editor, OnClickList return mServer.getText().toString().trim(); } - @Override public void onClick(View v) { final ViewGroup parent = (ViewGroup)getParent(); if (v == mDeleteButton) { @@ -73,7 +72,6 @@ public class KeyServerEditor extends LinearLayout implements Editor, OnClickList } } - @Override public void setEditorListener(EditorListener listener) { mEditorListener = listener; } diff --git a/src/org/thialfihar/android/apg/ui/widget/SectionView.java b/src/org/thialfihar/android/apg/ui/widget/SectionView.java index 124c1c9da..196e4ec2f 100644 --- a/src/org/thialfihar/android/apg/ui/widget/SectionView.java +++ b/src/org/thialfihar/android/apg/ui/widget/SectionView.java @@ -212,7 +212,6 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor dialog.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { - @Override public void onClick(DialogInterface di, int id) { di.dismiss(); try { @@ -229,7 +228,6 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor dialog.setCancelable(true); dialog.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { - @Override public void onClick(DialogInterface di, int id) { di.dismiss(); } diff --git a/src/org/thialfihar/android/apg/ui/widget/UserIdEditor.java b/src/org/thialfihar/android/apg/ui/widget/UserIdEditor.java index c8f9f74e7..0ff6fde4f 100644 --- a/src/org/thialfihar/android/apg/ui/widget/UserIdEditor.java +++ b/src/org/thialfihar/android/apg/ui/widget/UserIdEditor.java @@ -154,7 +154,6 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene return userId; } - @Override public void onClick(View v) { final ViewGroup parent = (ViewGroup)getParent(); if (v == mDeleteButton) { @@ -187,7 +186,6 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene return mIsMainUserId.isChecked(); } - @Override public void setEditorListener(EditorListener listener) { mEditorListener = listener; } diff --git a/src/org/thialfihar/android/apg/utils/Choice.java b/src/org/thialfihar/android/apg/utils/Choice.java index 4014a1f4a..0cd35e048 100644 --- a/src/org/thialfihar/android/apg/utils/Choice.java +++ b/src/org/thialfihar/android/apg/utils/Choice.java @@ -38,7 +38,8 @@ public class Choice { return mName; } - public String toString() { + @Override + public String toString() { return mName; } } |