diff options
author | Dominik <dominik@dominikschuermann.de> | 2012-09-20 17:13:45 +0200 |
---|---|---|
committer | Dominik <dominik@dominikschuermann.de> | 2012-09-20 17:13:45 +0200 |
commit | 95e35a4ffa1f4c54078009ec6846450240a0884c (patch) | |
tree | e2509434cd7ecde2ebd5b1c3397dbf2759c2d495 /org_apg/src/org/thialfihar/android/apg/service | |
parent | fb49f9e9c8d1b6d27a489c047431925974738a24 (diff) | |
download | open-keychain-95e35a4ffa1f4c54078009ec6846450240a0884c.tar.gz open-keychain-95e35a4ffa1f4c54078009ec6846450240a0884c.tar.bz2 open-keychain-95e35a4ffa1f4c54078009ec6846450240a0884c.zip |
more Provider Helper methods
Diffstat (limited to 'org_apg/src/org/thialfihar/android/apg/service')
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/service/ApgService.java | 19 | ||||
-rw-r--r-- | org_apg/src/org/thialfihar/android/apg/service/PassphraseCacheService.java | 4 |
2 files changed, 12 insertions, 11 deletions
diff --git a/org_apg/src/org/thialfihar/android/apg/service/ApgService.java b/org_apg/src/org/thialfihar/android/apg/service/ApgService.java index c324c4c62..95434ab30 100644 --- a/org_apg/src/org/thialfihar/android/apg/service/ApgService.java +++ b/org_apg/src/org/thialfihar/android/apg/service/ApgService.java @@ -35,7 +35,6 @@ import org.spongycastle.openpgp.PGPSecretKeyRing; import org.thialfihar.android.apg.Constants; import org.thialfihar.android.apg.Id; import org.thialfihar.android.apg.R; -import org.thialfihar.android.apg.deprecated.DataProvider; import org.thialfihar.android.apg.helper.FileHelper; import org.thialfihar.android.apg.helper.OtherHelper; import org.thialfihar.android.apg.helper.PGPMain; @@ -43,7 +42,7 @@ import org.thialfihar.android.apg.helper.Preferences; import org.thialfihar.android.apg.helper.PGPMain.ApgGeneralException; import org.thialfihar.android.apg.helper.PGPConversionHelper; import org.thialfihar.android.apg.provider.ApgContract.DataStream; -import org.thialfihar.android.apg.provider.ApgProvider; +import org.thialfihar.android.apg.provider.ProviderHelper; import org.thialfihar.android.apg.util.HkpKeyServer; import org.thialfihar.android.apg.util.InputData; import org.thialfihar.android.apg.util.KeyServer.KeyInfo; @@ -622,8 +621,8 @@ public class ApgService extends IntentService implements ProgressDialogUpdater { throw new PGPMain.ApgGeneralException(getString(R.string.error_fileNotFound, deleteFile)); } catch (IOException e) { - throw new PGPMain.ApgGeneralException(getString(R.string.error_fileDeleteFailed, - deleteFile)); + throw new PGPMain.ApgGeneralException(getString( + R.string.error_fileDeleteFailed, deleteFile)); } /* Output */ @@ -715,9 +714,11 @@ public class ApgService extends IntentService implements ProgressDialogUpdater { Vector<Integer> keyRingIds = new Vector<Integer>(); if (exportAll) { - keyRingIds = PGPMain - .getKeyRingIds(keyType == Id.type.public_key ? Id.database.type_public - : Id.database.type_secret); + if (keyType == Id.type.public_key) { + keyRingIds = ProviderHelper.getPublicKeyRingsRowIds(this); + } else { + keyRingIds = ProviderHelper.getSecretKeyRingsRowIds(this); + } } else { keyRingIds.add(keyRingId); } @@ -742,8 +743,8 @@ public class ApgService extends IntentService implements ProgressDialogUpdater { /* Operation */ HkpKeyServer server = new HkpKeyServer(keyServer); - PGPKeyRing keyring = PGPMain.getKeyRing(keyRingId); - if (keyring != null && keyring instanceof PGPPublicKeyRing) { + PGPPublicKeyRing keyring = ProviderHelper.getPGPPublicKeyRing(this, keyRingId); + if (keyring != null) { boolean uploaded = PGPMain.uploadKeyRingToServer(server, (PGPPublicKeyRing) keyring); if (!uploaded) { diff --git a/org_apg/src/org/thialfihar/android/apg/service/PassphraseCacheService.java b/org_apg/src/org/thialfihar/android/apg/service/PassphraseCacheService.java index 6e2fc1d86..1909facd3 100644 --- a/org_apg/src/org/thialfihar/android/apg/service/PassphraseCacheService.java +++ b/org_apg/src/org/thialfihar/android/apg/service/PassphraseCacheService.java @@ -24,8 +24,8 @@ import org.spongycastle.openpgp.PGPSecretKeyRing; import org.thialfihar.android.apg.Constants; import org.thialfihar.android.apg.Id; import org.thialfihar.android.apg.helper.PGPHelper; -import org.thialfihar.android.apg.helper.PGPMain; import org.thialfihar.android.apg.helper.Preferences; +import org.thialfihar.android.apg.provider.ProviderHelper; import android.app.AlarmManager; import android.app.PendingIntent; @@ -88,7 +88,7 @@ public class PassphraseCacheService extends Service { // try to get real key id long realId = keyId; if (realId != Id.key.symmetric) { - PGPSecretKeyRing keyRing = PGPMain.getSecretKeyRing(keyId); + PGPSecretKeyRing keyRing = ProviderHelper.getPGPSecretKeyRing(context, keyId); if (keyRing == null) { return null; } |