Revert "Replace PgpGeneralException with NotFoundException where appropriate"
This reverts commit 49b4ff6312.
This commit is contained in:
@@ -272,24 +272,23 @@ public class OpenPgpService extends RemoteService {
|
||||
InputData inputData = new InputData(is, inputLength);
|
||||
|
||||
// Find the appropriate subkey to sign with
|
||||
final long sigSubKeyId;
|
||||
try {
|
||||
CachedPublicKeyRing signingRing =
|
||||
new ProviderHelper(this).getCachedPublicKeyRing(accSettings.getKeyId());
|
||||
sigSubKeyId = signingRing.getSecretSignId();
|
||||
} catch (NotFoundException e) {
|
||||
// secret key that is set for this account is deleted?
|
||||
// show account config again!
|
||||
return getCreateAccountIntent(data, getAccountName(data));
|
||||
}
|
||||
CachedPublicKeyRing signingRing =
|
||||
new ProviderHelper(this).getCachedPublicKeyRing(accSettings.getKeyId());
|
||||
final long sigSubKeyId = signingRing.getSecretSignId();
|
||||
|
||||
// get passphrase from cache, if key has "no" passphrase, this returns an empty String
|
||||
String passphrase;
|
||||
if (data.hasExtra(OpenPgpApi.EXTRA_PASSPHRASE)) {
|
||||
passphrase = data.getStringExtra(OpenPgpApi.EXTRA_PASSPHRASE);
|
||||
} else {
|
||||
passphrase = PassphraseCacheService.getCachedPassphrase(getContext(),
|
||||
accSettings.getKeyId(), sigSubKeyId);
|
||||
try {
|
||||
passphrase = PassphraseCacheService.getCachedPassphrase(getContext(),
|
||||
accSettings.getKeyId(), sigSubKeyId);
|
||||
} catch (PassphraseCacheService.KeyNotFoundException e) {
|
||||
// secret key that is set for this account is deleted?
|
||||
// show account config again!
|
||||
return getCreateAccountIntent(data, getAccountName(data));
|
||||
}
|
||||
}
|
||||
if (passphrase == null) {
|
||||
// get PendingIntent for passphrase input, add it to given params and return to client
|
||||
|
||||
@@ -27,12 +27,13 @@ import android.view.View;
|
||||
|
||||
import org.sufficientlysecure.keychain.Constants;
|
||||
import org.sufficientlysecure.keychain.R;
|
||||
import org.sufficientlysecure.keychain.ui.util.ActionBarHelper;
|
||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||
import org.sufficientlysecure.keychain.remote.AccountSettings;
|
||||
import org.sufficientlysecure.keychain.service.results.OperationResult;
|
||||
import org.sufficientlysecure.keychain.service.results.OperationResult.LogLevel;
|
||||
import org.sufficientlysecure.keychain.service.results.OperationResult.LogType;
|
||||
import org.sufficientlysecure.keychain.service.results.SingletonResult;
|
||||
import org.sufficientlysecure.keychain.ui.util.ActionBarHelper;
|
||||
import org.sufficientlysecure.keychain.util.Log;
|
||||
|
||||
public class AccountSettingsActivity extends ActionBarActivity {
|
||||
|
||||
@@ -67,7 +67,7 @@ public class AccountSettingsFragment extends Fragment {
|
||||
}
|
||||
|
||||
public void setAccSettings(AccountSettings accountSettings) {
|
||||
mAccSettings = accountSettings;
|
||||
this.mAccSettings = accountSettings;
|
||||
|
||||
mAccNameView.setText(accountSettings.getAccountName());
|
||||
mSelectKeySpinner.setSelectedKeyId(accountSettings.getKeyId());
|
||||
|
||||
Reference in New Issue
Block a user