preserve trust ids over key updates
This commit is contained in:
@@ -62,6 +62,7 @@ import org.sufficientlysecure.keychain.pgp.UncachedPublicKey;
|
||||
import org.sufficientlysecure.keychain.pgp.WrappedSignature;
|
||||
import org.sufficientlysecure.keychain.pgp.WrappedUserAttribute;
|
||||
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
|
||||
import org.sufficientlysecure.keychain.provider.KeychainContract.ApiTrustIdentity;
|
||||
import org.sufficientlysecure.keychain.provider.KeychainContract.Certs;
|
||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRingData;
|
||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
||||
@@ -602,6 +603,7 @@ public class KeyWritableRepository extends KeyRepository {
|
||||
android.util.Log.e(Constants.TAG, "Could not delete file!", e);
|
||||
return false;
|
||||
}
|
||||
mContentResolver.delete(ApiTrustIdentity.buildByMasterKeyId(masterKeyId),null, null);
|
||||
int deletedRows = mContentResolver.delete(KeyRingData.buildPublicKeyRingUri(masterKeyId), null, null);
|
||||
return deletedRows > 0;
|
||||
}
|
||||
|
||||
@@ -356,6 +356,10 @@ public class KeychainContract {
|
||||
public static Uri buildByPackageNameAndTrustId(String packageName, String trustId) {
|
||||
return CONTENT_URI.buildUpon().appendPath(PATH_BY_PACKAGE_NAME).appendPath(packageName).appendPath(trustId).build();
|
||||
}
|
||||
|
||||
public static Uri buildByMasterKeyId(long masterKeyId) {
|
||||
return CONTENT_URI.buildUpon().appendPath(PATH_BY_KEY_ID).appendPath(Long.toString(masterKeyId)).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Certs implements CertsColumns, BaseColumns {
|
||||
|
||||
Reference in New Issue
Block a user