aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2014-04-11 17:58:32 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2014-04-11 17:58:32 +0200
commitc4d9fd88aae38a6b7cfd9c840c3e0d8716cc7ac9 (patch)
tree6757ca47777eef2b0cd2b5566adf70d1067e7ec0 /OpenKeychain/src/main/java
parent094fb698deca4aa269a754e89acacde2f339a97f (diff)
downloadopen-keychain-c4d9fd88aae38a6b7cfd9c840c3e0d8716cc7ac9.tar.gz
open-keychain-c4d9fd88aae38a6b7cfd9c840c3e0d8716cc7ac9.tar.bz2
open-keychain-c4d9fd88aae38a6b7cfd9c840c3e0d8716cc7ac9.zip
More cleanup in providerHelper
Diffstat (limited to 'OpenKeychain/src/main/java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
index 414a79ef8..1da4ffe55 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/ProviderHelper.java
@@ -384,7 +384,6 @@ public class ProviderHelper {
* Saves a PGPSecretKeyRing in the DB. This will only work if a corresponding public keyring
* is already in the database!
*/
- @SuppressWarnings("unchecked")
public void saveKeyRing(PGPSecretKeyRing keyRing) throws IOException {
long masterKeyId = keyRing.getPublicKey().getKeyID();
@@ -400,7 +399,6 @@ public class ProviderHelper {
/**
* Saves (or updates) a pair of public and secret KeyRings in the database
*/
- @SuppressWarnings("unchecked")
public void saveKeyRing(PGPPublicKeyRing pubRing, PGPSecretKeyRing privRing) throws IOException {
long masterKeyId = pubRing.getPublicKey().getKeyID();
@@ -510,8 +508,14 @@ public class ProviderHelper {
return getKeyRingAsArmoredString(data);
}
- // TODO This method is NOT ACTUALLY USED. Is this preparation for something, or just dead code?
- public ArrayList<String> getKeyRingsAsArmoredString(Context context, long[] masterKeyIds)
+ /**
+ * TODO: currently not used, but will be needed to upload many keys at once!
+ *
+ * @param masterKeyIds
+ * @return
+ * @throws IOException
+ */
+ public ArrayList<String> getKeyRingsAsArmoredString(long[] masterKeyIds)
throws IOException {
ArrayList<String> output = new ArrayList<String>();
@@ -521,7 +525,7 @@ public class ProviderHelper {
}
// Build a cursor for the selected masterKeyIds
- Cursor cursor = null;
+ Cursor cursor;
{
String inMasterKeyList = KeyRingData.MASTER_KEY_ID + " IN (";
for (int i = 0; i < masterKeyIds.length; ++i) {
@@ -532,7 +536,7 @@ public class ProviderHelper {
}
inMasterKeyList += ")";
- cursor = context.getContentResolver().query(KeyRingData.buildPublicKeyRingUri(), new String[]{
+ cursor = mContentResolver.query(KeyRingData.buildPublicKeyRingUri(), new String[]{
KeyRingData._ID, KeyRingData.MASTER_KEY_ID, KeyRingData.KEY_RING_DATA
}, inMasterKeyList, null, null);
}
@@ -613,13 +617,6 @@ public class ProviderHelper {
mContentResolver.insert(uri, contentValueForApiAccounts(accSettings));
}
- public void updateApiApp(AppSettings appSettings, Uri uri) {
- if (mContentResolver.update(uri, contentValueForApiApps(appSettings), null,
- null) <= 0) {
- throw new RuntimeException();
- }
- }
-
public void updateApiAccount(AccountSettings accSettings, Uri uri) {
if (mContentResolver.update(uri, contentValueForApiAccounts(accSettings), null,
null) <= 0) {