From ddf59fb45a9411100c7d5a9162fb5b19e96c779f Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Thu, 10 Feb 2022 14:51:13 -0500 Subject: [PATCH] Add internal settings for testing release channel notes. --- .../app/internal/InternalSettingsFragment.kt | 25 +++++++++++++++++-- app/src/main/res/values/strings.xml | 4 ++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalSettingsFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalSettingsFragment.kt index 3b63d4611..ae0d229a2 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalSettingsFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/internal/InternalSettingsFragment.kt @@ -23,6 +23,7 @@ import org.thoughtcrime.securesms.jobs.DownloadLatestEmojiDataJob import org.thoughtcrime.securesms.jobs.RefreshAttributesJob import org.thoughtcrime.securesms.jobs.RefreshOwnProfileJob import org.thoughtcrime.securesms.jobs.RemoteConfigRefreshJob +import org.thoughtcrime.securesms.jobs.RetrieveReleaseChannelJob import org.thoughtcrime.securesms.jobs.RotateProfileKeyJob import org.thoughtcrime.securesms.jobs.StorageForcePushJob import org.thoughtcrime.securesms.jobs.SubscriptionReceiptRequestResponseJob @@ -31,6 +32,7 @@ import org.thoughtcrime.securesms.payments.DataExportUtil import org.thoughtcrime.securesms.util.ConversationUtil import org.thoughtcrime.securesms.util.FeatureFlags import org.thoughtcrime.securesms.util.concurrent.SimpleTask +import kotlin.math.max class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__internal_preferences) { @@ -333,9 +335,9 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter } ) - dividerPref() - if (FeatureFlags.donorBadges() && SignalStore.donationsValues().getSubscriber() != null) { + dividerPref() + sectionHeaderPref(R.string.preferences__internal_badges) clickPref( @@ -345,6 +347,25 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter } ) } + + dividerPref() + + sectionHeaderPref(R.string.preferences__internal_release_channel) + + clickPref( + title = DSLSettingsText.from(R.string.preferences__internal_fetch_release_channel), + onClick = { + SignalStore.releaseChannelValues().previousManifestMd5 = ByteArray(0) + RetrieveReleaseChannelJob.enqueue(force = true) + } + ) + + clickPref( + title = DSLSettingsText.from(R.string.preferences__internal_release_channel_set_last_version), + onClick = { + SignalStore.releaseChannelValues().highestVersionNoteReceived = max(SignalStore.releaseChannelValues().highestVersionNoteReceived - 10, 0) + } + ) } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2f2fd4ed6..ba1d8db9c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2629,7 +2629,9 @@ Audio processing method Badges Enqueue redemption. - + Release channel + Fetch release channel + Set last version seen back 10 versions All activity