Introduce ProviderHelper.NotFoundException, remove dead code

This commit is contained in:
Dominik Schürmann
2014-04-08 22:25:42 +02:00
parent 946c1e115c
commit a1efb24228
12 changed files with 150 additions and 126 deletions

View File

@@ -171,11 +171,12 @@ public class PassphraseCacheService extends Service {
// try to get master key id which is used as an identifier for cached passphrases
long masterKeyId = keyId;
if (masterKeyId != Id.key.symmetric) {
masterKeyId = ProviderHelper.getMasterKeyId(this,
KeychainContract.KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(Long.toString(keyId)));
// Failure
if(masterKeyId == 0)
try {
masterKeyId = ProviderHelper.getMasterKeyId(this,
KeychainContract.KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(Long.toString(keyId)));
} catch (ProviderHelper.NotFoundException e) {
return null;
}
}
Log.d(TAG, "getCachedPassphraseImpl() for masterKeyId " + masterKeyId);