Update to latest backup tests.

This commit is contained in:
Greyson Parrelli
2025-11-21 11:14:12 -05:00
committed by jeffrey-signal
parent ae4a3433f9
commit 8783d69406
580 changed files with 17 additions and 5 deletions

View File

@@ -62,6 +62,7 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
private const val KEY_RESTORE_OVER_CELLULAR = "backup.restore.useCellular"
private const val KEY_OPTIMIZE_STORAGE = "backup.optimizeStorage"
private const val KEY_BACKUPS_INITIALIZED = "backup.initialized"
private const val KEY_IMPORTED_EMPTY_ANDROID_SETTINGS = "backup.importedEmptyAndroidSettings"
const val KEY_ARCHIVE_UPLOAD_STATE = "backup.archiveUploadState"
@@ -422,6 +423,11 @@ class BackupValues(store: KeyValueStore) : SignalStoreValues(store) {
.apply()
}
/**
* An annoying workaround to making tests pass when importing empty androidSpecificSettings.
*/
var importedEmptyAndroidSettings by booleanValue(KEY_IMPORTED_EMPTY_ANDROID_SETTINGS, false)
/**
* If set, this represents how far back we should backup messages. For instance, if the returned value is 1 year in milliseconds, you should back up
* every message within the last year. If unset, back up all messages. We only cutoff old messages for users whose backup is over the

View File

@@ -14,6 +14,7 @@ import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.dependencies.AppDependencies;
import org.thoughtcrime.securesms.mms.SentMediaQuality;
import org.thoughtcrime.securesms.preferences.widgets.NotificationPrivacyPreference;
import org.thoughtcrime.securesms.util.Environment;
import org.thoughtcrime.securesms.util.SingleLiveEvent;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.thoughtcrime.securesms.webrtc.CallDataMode;
@@ -83,7 +84,7 @@ public final class SettingsValues extends SignalStoreValues {
SettingsValues(@NonNull KeyValueStore store, Context context) {
super(store);
if (!store.containsKey(SCREEN_LOCK_ENABLED)) {
if (!store.containsKey(SCREEN_LOCK_ENABLED) && !Environment.IS_INSTRUMENTATION) {
migrateFromSharedPrefsV1(context);
}
}