add LocalKeyStorage, don't store public keys larger than 50kb in database
This commit is contained in:
@@ -111,7 +111,8 @@ public class KeychainService extends Service implements Progressable {
|
||||
|
||||
// just for brevity
|
||||
KeychainService outerThis = KeychainService.this;
|
||||
DatabaseReadWriteInteractor databaseInteractor = new DatabaseReadWriteInteractor(outerThis);
|
||||
DatabaseReadWriteInteractor databaseInteractor =
|
||||
DatabaseReadWriteInteractor.createDatabaseReadWriteInteractor(outerThis);
|
||||
if (inputParcel instanceof SignEncryptParcel) {
|
||||
op = new SignEncryptOperation(outerThis, databaseInteractor, outerThis, mActionCanceled);
|
||||
} else if (inputParcel instanceof PgpDecryptVerifyInputParcel) {
|
||||
|
||||
@@ -321,7 +321,8 @@ public class KeyserverSyncAdapterService extends Service {
|
||||
private ImportKeyResult directUpdate(Context context, ArrayList<ParcelableKeyRing> keyList,
|
||||
CryptoInputParcel cryptoInputParcel) {
|
||||
Log.d(Constants.TAG, "Starting normal update");
|
||||
ImportOperation importOp = new ImportOperation(context, new DatabaseReadWriteInteractor(context), null);
|
||||
ImportOperation importOp = new ImportOperation(context,
|
||||
DatabaseReadWriteInteractor.createDatabaseReadWriteInteractor(context), null);
|
||||
return importOp.execute(
|
||||
new ImportKeyringParcel(keyList,
|
||||
Preferences.getPreferences(context).getPreferredKeyserver()),
|
||||
@@ -381,7 +382,7 @@ public class KeyserverSyncAdapterService extends Service {
|
||||
new OperationResult.OperationLog());
|
||||
}
|
||||
ImportKeyResult result =
|
||||
new ImportOperation(context, new DatabaseReadWriteInteractor(context), null, mCancelled)
|
||||
new ImportOperation(context, DatabaseReadWriteInteractor.createDatabaseReadWriteInteractor(context), null, mCancelled)
|
||||
.execute(
|
||||
new ImportKeyringParcel(
|
||||
keyWrapper,
|
||||
|
||||
@@ -245,7 +245,7 @@ public class PassphraseCacheService extends Service {
|
||||
+ masterKeyId + ", subKeyId " + subKeyId);
|
||||
|
||||
// get the type of key (from the database)
|
||||
CachedPublicKeyRing keyRing = new DatabaseInteractor(getContentResolver()).getCachedPublicKeyRing(masterKeyId);
|
||||
CachedPublicKeyRing keyRing = DatabaseInteractor.createDatabaseInteractor(this).getCachedPublicKeyRing(masterKeyId);
|
||||
SecretKeyType keyType = keyRing.getSecretKeyType(subKeyId);
|
||||
|
||||
switch (keyType) {
|
||||
|
||||
Reference in New Issue
Block a user