mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-25 16:01:52 -05:00
prevent recursive consolidate
This commit is contained in:
parent
43930ed8f2
commit
5466d1e980
@ -520,6 +520,7 @@ public abstract class OperationResult implements Parcelable {
|
|||||||
MSG_CON_ERROR_PUBLIC (LogLevel.ERROR, R.string.msg_con_error_public),
|
MSG_CON_ERROR_PUBLIC (LogLevel.ERROR, R.string.msg_con_error_public),
|
||||||
MSG_CON_ERROR_SECRET (LogLevel.ERROR, R.string.msg_con_error_secret),
|
MSG_CON_ERROR_SECRET (LogLevel.ERROR, R.string.msg_con_error_secret),
|
||||||
MSG_CON_RECOVER (LogLevel.DEBUG, R.string.msg_con_recover),
|
MSG_CON_RECOVER (LogLevel.DEBUG, R.string.msg_con_recover),
|
||||||
|
MSG_CON_RECURSIVE (LogLevel.OK, R.string.msg_con_recursive),
|
||||||
MSG_CON_REIMPORT_PUBLIC (LogLevel.DEBUG, R.plurals.msg_con_reimport_public),
|
MSG_CON_REIMPORT_PUBLIC (LogLevel.DEBUG, R.plurals.msg_con_reimport_public),
|
||||||
MSG_CON_REIMPORT_PUBLIC_SKIP (LogLevel.DEBUG, R.string.msg_con_reimport_public_skip),
|
MSG_CON_REIMPORT_PUBLIC_SKIP (LogLevel.DEBUG, R.string.msg_con_reimport_public_skip),
|
||||||
MSG_CON_REIMPORT_SECRET (LogLevel.DEBUG, R.plurals.msg_con_reimport_secret),
|
MSG_CON_REIMPORT_SECRET (LogLevel.DEBUG, R.plurals.msg_con_reimport_secret),
|
||||||
|
@ -1053,6 +1053,11 @@ public class ProviderHelper {
|
|||||||
log.add(LogType.MSG_CON, indent);
|
log.add(LogType.MSG_CON, indent);
|
||||||
indent += 1;
|
indent += 1;
|
||||||
|
|
||||||
|
if (mConsolidateCritical) {
|
||||||
|
log.add(LogType.MSG_CON_RECURSIVE, indent);
|
||||||
|
return new ConsolidateResult(ConsolidateResult.RESULT_OK, log);
|
||||||
|
}
|
||||||
|
|
||||||
progress.setProgress(R.string.progress_con_saving, 0, 100);
|
progress.setProgress(R.string.progress_con_saving, 0, 100);
|
||||||
|
|
||||||
// The consolidate operation can never be cancelled!
|
// The consolidate operation can never be cancelled!
|
||||||
@ -1219,13 +1224,11 @@ public class ProviderHelper {
|
|||||||
log.add(LogType.MSG_CON_DB_CLEAR, indent);
|
log.add(LogType.MSG_CON_DB_CLEAR, indent);
|
||||||
mContentResolver.delete(KeyRings.buildUnifiedKeyRingsUri(), null, null);
|
mContentResolver.delete(KeyRings.buildUnifiedKeyRingsUri(), null, null);
|
||||||
|
|
||||||
ParcelableFileCache<ParcelableKeyRing> cacheSecret =
|
ParcelableFileCache<ParcelableKeyRing> cacheSecret, cachePublic;
|
||||||
new ParcelableFileCache<>(mContext, "consolidate_secret.pcl");
|
|
||||||
ParcelableFileCache<ParcelableKeyRing> cachePublic =
|
|
||||||
new ParcelableFileCache<>(mContext, "consolidate_public.pcl");
|
|
||||||
|
|
||||||
// Set flag that we have a cached consolidation here
|
// Set flag that we have a cached consolidation here
|
||||||
try {
|
try {
|
||||||
|
cacheSecret = new ParcelableFileCache<>(mContext, "consolidate_secret.pcl");
|
||||||
IteratorWithSize<ParcelableKeyRing> itSecrets = cacheSecret.readCache(false);
|
IteratorWithSize<ParcelableKeyRing> itSecrets = cacheSecret.readCache(false);
|
||||||
int numSecrets = itSecrets.getSize();
|
int numSecrets = itSecrets.getSize();
|
||||||
|
|
||||||
@ -1253,6 +1256,7 @@ public class ProviderHelper {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
cachePublic = new ParcelableFileCache<>(mContext, "consolidate_public.pcl");
|
||||||
IteratorWithSize<ParcelableKeyRing> itPublics = cachePublic.readCache();
|
IteratorWithSize<ParcelableKeyRing> itPublics = cachePublic.readCache();
|
||||||
int numPublics = itPublics.getSize();
|
int numPublics = itPublics.getSize();
|
||||||
|
|
||||||
|
@ -131,6 +131,7 @@ public class KeychainIntentServiceHandler extends Handler {
|
|||||||
|
|
||||||
case MESSAGE_PREVENT_CANCEL:
|
case MESSAGE_PREVENT_CANCEL:
|
||||||
mProgressDialogFragment.setPreventCancel(true);
|
mProgressDialogFragment.setPreventCancel(true);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Log.e(Constants.TAG, "unknown handler message!");
|
Log.e(Constants.TAG, "unknown handler message!");
|
||||||
|
@ -104,7 +104,6 @@ public class ParcelableFileCache<E extends Parcelable> {
|
|||||||
throw new IOException(e);
|
throw new IOException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// yes this is sloppy data flow. WE WOULDN'T NEED THIS WITH TUPLE RETURN TYPES
|
|
||||||
final int numEntries = ois.readInt();
|
final int numEntries = ois.readInt();
|
||||||
|
|
||||||
return new IteratorWithSize<E>() {
|
return new IteratorWithSize<E>() {
|
||||||
|
@ -886,6 +886,7 @@
|
|||||||
<string name="msg_con_error_public">"Error reimporting public keys!"</string>
|
<string name="msg_con_error_public">"Error reimporting public keys!"</string>
|
||||||
<string name="msg_con_error_secret">"Error reimporting secret keys!"</string>
|
<string name="msg_con_error_secret">"Error reimporting secret keys!"</string>
|
||||||
<string name="msg_con_recover">"Resuming consolidation process"</string>
|
<string name="msg_con_recover">"Resuming consolidation process"</string>
|
||||||
|
<string name="msg_con_recursive">"Skipping recursive consolidation"</string>
|
||||||
<string name="msg_con_recover_unknown">"Resuming consolidation process from unknown state"</string>
|
<string name="msg_con_recover_unknown">"Resuming consolidation process from unknown state"</string>
|
||||||
<plurals name="msg_con_reimport_public">
|
<plurals name="msg_con_reimport_public">
|
||||||
<item quantity="one">"Reimporting one public key"</item>
|
<item quantity="one">"Reimporting one public key"</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user