mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-30 12:32:17 -05:00
Merge pull request #1142 from tdjogi010/development
Preselected Suitable Key
This commit is contained in:
commit
ff60e80d42
@ -93,11 +93,17 @@ public class CertifyKeySpinner extends KeySpinner {
|
|||||||
mIndexIsRevoked = data.getColumnIndex(KeychainContract.KeyRings.IS_REVOKED);
|
mIndexIsRevoked = data.getColumnIndex(KeychainContract.KeyRings.IS_REVOKED);
|
||||||
mIndexIsExpired = data.getColumnIndex(KeychainContract.KeyRings.IS_EXPIRED);
|
mIndexIsExpired = data.getColumnIndex(KeychainContract.KeyRings.IS_EXPIRED);
|
||||||
|
|
||||||
// If there is only one choice, pick it by default
|
// If there is more than one choice, pick a key
|
||||||
if (mAdapter.getCount() == 2) {
|
if (mAdapter.getCount() >= 2) {
|
||||||
// preselect if key can certify
|
// preselect if key can certify
|
||||||
if (data.moveToPosition(0) && !data.isNull(mIndexHasCertify)) {
|
if (data.moveToPosition(0)) {
|
||||||
setSelection(1);
|
do {
|
||||||
|
if (!data.isNull(mIndexHasCertify)) {
|
||||||
|
setSelection(data.getPosition() + 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (data.moveToNext());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user