Remove old remote configs.

This commit is contained in:
Cody Henthorne
2023-11-14 12:19:57 -05:00
committed by Greyson Parrelli
parent e80b7cf0a2
commit 95fb9ea117
9 changed files with 13 additions and 149 deletions

View File

@@ -51,7 +51,6 @@ import org.thoughtcrime.securesms.keyvalue.SignalStore;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.recipients.RecipientId;
import org.thoughtcrime.securesms.util.CommunicationActions;
import org.thoughtcrime.securesms.util.FeatureFlags;
import org.thoughtcrime.securesms.util.views.SimpleProgressDialog;
import java.io.IOException;
@@ -313,7 +312,7 @@ public class NewConversationActivity extends ContactSelectionActivity
}
private @Nullable ActionItem createRemoveActionItem(@NonNull Recipient recipient) {
if (!FeatureFlags.hideContacts() || recipient.isSelf() || recipient.isGroup()) {
if (recipient.isSelf() || recipient.isGroup()) {
return null;
}

View File

@@ -41,7 +41,6 @@ import org.thoughtcrime.securesms.database.model.MessageRecord;
import org.thoughtcrime.securesms.database.model.ReactionRecord;
import org.thoughtcrime.securesms.keyvalue.SignalStore;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.util.FeatureFlags;
import org.thoughtcrime.securesms.util.ThemeUtil;
import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.util.ViewUtil;
@@ -716,7 +715,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
items.add(new ActionItem(R.drawable.symbol_reply_24, getResources().getString(R.string.conversation_selection__menu_reply), () -> handleActionItemClicked(Action.REPLY)));
}
if (FeatureFlags.editMessageSending() && menuState.shouldShowEditAction()) {
if (menuState.shouldShowEditAction()) {
items.add(new ActionItem(R.drawable.symbol_edit_24, getResources().getString(R.string.conversation_selection__menu_edit), () -> handleActionItemClicked(Action.EDIT)));
}

View File

@@ -36,7 +36,6 @@ import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.conversation.ConversationAdapterBridge
import org.thoughtcrime.securesms.conversation.ConversationAdapterBridge.PulseRequest
import org.thoughtcrime.securesms.conversation.v2.items.InteractiveConversationElement
import org.thoughtcrime.securesms.util.FeatureFlags
import org.thoughtcrime.securesms.util.ThemeUtil
import org.thoughtcrime.securesms.util.ViewUtil
import org.thoughtcrime.securesms.wallpaper.ChatWallpaper
@@ -567,11 +566,7 @@ class MultiselectItemDecoration(
}
private fun RecyclerView.getMultiselectableChildren(): Sequence<Multiselectable> {
return if (FeatureFlags.useTextOnlyConversationItemV2()) {
children.map { getChildViewHolder(it) }.filterIsInstance<Multiselectable>()
} else {
children.filterIsInstance<Multiselectable>()
}
return children.map { getChildViewHolder(it) }.filterIsInstance<Multiselectable>()
}
private fun RecyclerView.getInteractableChildren(): Sequence<InteractiveConversationElement> {

View File

@@ -53,7 +53,6 @@ import org.thoughtcrime.securesms.mms.GlideRequests
import org.thoughtcrime.securesms.phonenumbers.PhoneNumberFormatter
import org.thoughtcrime.securesms.recipients.Recipient
import org.thoughtcrime.securesms.util.CachedInflater
import org.thoughtcrime.securesms.util.FeatureFlags
import org.thoughtcrime.securesms.util.HtmlUtil
import org.thoughtcrime.securesms.util.Projection
import org.thoughtcrime.securesms.util.ProjectionList
@@ -124,26 +123,14 @@ class ConversationAdapterV2(
}
}
if (FeatureFlags.useTextOnlyConversationItemV2()) {
registerFactory(OutgoingTextOnly::class.java) { parent ->
val view = CachedInflater.from(parent.context).inflate<View>(R.layout.v2_conversation_item_text_only_outgoing, parent, false)
V2ConversationItemTextOnlyViewHolder(V2ConversationItemTextOnlyOutgoingBinding.bind(view).bridge(), this)
}
registerFactory(OutgoingTextOnly::class.java) { parent ->
val view = CachedInflater.from(parent.context).inflate<View>(R.layout.v2_conversation_item_text_only_outgoing, parent, false)
V2ConversationItemTextOnlyViewHolder(V2ConversationItemTextOnlyOutgoingBinding.bind(view).bridge(), this)
}
registerFactory(IncomingTextOnly::class.java) { parent ->
val view = CachedInflater.from(parent.context).inflate<View>(R.layout.v2_conversation_item_text_only_incoming, parent, false)
V2ConversationItemTextOnlyViewHolder(V2ConversationItemTextOnlyIncomingBinding.bind(view).bridge(), this)
}
} else {
registerFactory(OutgoingTextOnly::class.java) { parent ->
val view = CachedInflater.from(parent.context).inflate<View>(R.layout.conversation_item_sent_text_only, parent, false)
OutgoingTextOnlyViewHolder(view)
}
registerFactory(IncomingTextOnly::class.java) { parent ->
val view = CachedInflater.from(parent.context).inflate<View>(R.layout.conversation_item_received_text_only, parent, false)
IncomingTextOnlyViewHolder(view)
}
registerFactory(IncomingTextOnly::class.java) { parent ->
val view = CachedInflater.from(parent.context).inflate<View>(R.layout.v2_conversation_item_text_only_incoming, parent, false)
V2ConversationItemTextOnlyViewHolder(V2ConversationItemTextOnlyIncomingBinding.bind(view).bridge(), this)
}
}

View File

@@ -292,7 +292,6 @@ import org.thoughtcrime.securesms.util.Debouncer
import org.thoughtcrime.securesms.util.DeleteDialog
import org.thoughtcrime.securesms.util.Dialogs
import org.thoughtcrime.securesms.util.DrawableUtil
import org.thoughtcrime.securesms.util.FeatureFlags
import org.thoughtcrime.securesms.util.FullscreenHelper
import org.thoughtcrime.securesms.util.MediaUtil
import org.thoughtcrime.securesms.util.MessageConstraintsUtil
@@ -1482,12 +1481,6 @@ class ConversationFragment :
}
private fun handleSendEditMessage() {
if (!FeatureFlags.editMessageSending()) {
Log.w(TAG, "Edit message sending disabled, forcing exit of edit mode")
inputPanel.exitEditMessageMode()
return
}
if (!inputPanel.inEditMessageMode()) {
Log.w(TAG, "Not in edit message mode, unknown state, forcing re-exit")
inputPanel.exitEditMessageMode()
@@ -1969,7 +1962,7 @@ class ConversationFragment :
)
}
if (menuState.shouldShowEditAction() && FeatureFlags.editMessageSending()) {
if (menuState.shouldShowEditAction()) {
items.add(
ActionItem(R.drawable.symbol_edit_24, resources.getString(R.string.conversation_selection__menu_edit)) {
handleEditMessage(getSelectedConversationMessage())
@@ -2142,10 +2135,6 @@ class ConversationFragment :
}
private fun handleEditMessage(conversationMessage: ConversationMessage) {
if (!FeatureFlags.editMessageSending()) {
return
}
if (isSearchRequested) {
searchMenuItem?.collapseActionView()
}

View File

@@ -170,14 +170,12 @@ import org.thoughtcrime.securesms.util.AppStartup;
import org.thoughtcrime.securesms.util.BottomSheetUtil;
import org.thoughtcrime.securesms.util.CachedInflater;
import org.thoughtcrime.securesms.util.ConversationUtil;
import org.thoughtcrime.securesms.util.FeatureFlags;
import org.thoughtcrime.securesms.util.PlayStoreUtil;
import org.thoughtcrime.securesms.util.ServiceUtil;
import org.thoughtcrime.securesms.util.SignalLocalMetrics;
import org.thoughtcrime.securesms.util.SignalProxyUtil;
import org.thoughtcrime.securesms.util.SnapToTopDataObserver;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.util.ViewUtil;
import org.thoughtcrime.securesms.util.WindowUtil;
import org.thoughtcrime.securesms.util.adapter.mapping.PagingMappingAdapter;
@@ -990,13 +988,8 @@ public class ConversationListFragment extends MainFragment implements ActionMode
FrameLayout parent = new FrameLayout(context);
parent.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
if (FeatureFlags.useTextOnlyConversationItemV2()) {
CachedInflater.from(context).cacheUntilLimit(R.layout.v2_conversation_item_text_only_incoming, parent, 25);
CachedInflater.from(context).cacheUntilLimit(R.layout.v2_conversation_item_text_only_outgoing, parent, 25);
} else {
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_received_text_only, parent, 25);
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_sent_text_only, parent, 25);
}
CachedInflater.from(context).cacheUntilLimit(R.layout.v2_conversation_item_text_only_incoming, parent, 25);
CachedInflater.from(context).cacheUntilLimit(R.layout.v2_conversation_item_text_only_outgoing, parent, 25);
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_received_multimedia, parent, 10);
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_sent_multimedia, parent, 10);
CachedInflater.from(context).cacheUntilLimit(R.layout.conversation_item_update, parent, 5);

View File

@@ -17,9 +17,7 @@ import org.signal.core.util.SetUtil;
import org.signal.core.util.TranslationDetection;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.badges.models.Badge;
import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity;
import org.thoughtcrime.securesms.components.settings.app.subscription.InAppDonations;
import org.thoughtcrime.securesms.database.model.MegaphoneRecord;
import org.thoughtcrime.securesms.database.model.RemoteMegaphoneRecord;
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
@@ -38,9 +36,7 @@ import org.thoughtcrime.securesms.profiles.AvatarHelper;
import org.thoughtcrime.securesms.profiles.manage.EditProfileActivity;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.util.FeatureFlags;
import org.thoughtcrime.securesms.util.LocaleFeatureFlags;
import org.thoughtcrime.securesms.util.ServiceUtil;
import org.thoughtcrime.securesms.util.VersionTracker;
import org.thoughtcrime.securesms.util.dynamiclanguage.DynamicLanguageContextWrapper;
import java.util.LinkedHashMap;
@@ -115,7 +111,6 @@ public final class Megaphones {
put(Event.BACKUP_SCHEDULE_PERMISSION, shouldShowBackupSchedulePermissionMegaphone(context) ? RecurringSchedule.every(TimeUnit.DAYS.toMillis(3)) : NEVER);
put(Event.ONBOARDING, shouldShowOnboardingMegaphone(context) ? ALWAYS : NEVER);
put(Event.TURN_OFF_CENSORSHIP_CIRCUMVENTION, shouldShowTurnOffCircumventionMegaphone() ? RecurringSchedule.every(TimeUnit.DAYS.toMillis(7)) : NEVER);
put(Event.DONATE_Q2_2022, shouldShowDonateMegaphone(context, Event.DONATE_Q2_2022, records) ? ShowForDurationSchedule.showForDays(7) : NEVER);
put(Event.REMOTE_MEGAPHONE, shouldShowRemoteMegaphone(records) ? RecurringSchedule.every(TimeUnit.DAYS.toMillis(1)) : NEVER);
put(Event.PIN_REMINDER, new SignalPinReminderSchedule());
put(Event.SET_UP_YOUR_USERNAME, shouldShowSetUpYourUsernameMegaphone(records) ? ALWAYS : NEVER);
@@ -139,10 +134,6 @@ public final class Megaphones {
return buildNotificationsMegaphone(context);
case ADD_A_PROFILE_PHOTO:
return buildAddAProfilePhotoMegaphone(context);
case BECOME_A_SUSTAINER:
return buildBecomeASustainerMegaphone(context);
case DONATE_Q2_2022:
return buildDonateQ2Megaphone(context);
case TURN_OFF_CENSORSHIP_CIRCUMVENTION:
return buildTurnOffCircumventionMegaphone(context);
case REMOTE_MEGAPHONE:
@@ -261,36 +252,6 @@ public final class Megaphones {
.build();
}
private static @NonNull Megaphone buildBecomeASustainerMegaphone(@NonNull Context context) {
return new Megaphone.Builder(Event.BECOME_A_SUSTAINER, Megaphone.Style.BASIC)
.setTitle(R.string.BecomeASustainerMegaphone__become_a_sustainer)
.setImage(R.drawable.ic_become_a_sustainer_megaphone)
.setBody(R.string.BecomeASustainerMegaphone__signal_is_powered_by)
.setActionButton(R.string.BecomeASustainerMegaphone__donate, (megaphone, listener) -> {
listener.onMegaphoneNavigationRequested(AppSettingsActivity.subscriptions(context));
listener.onMegaphoneCompleted(Event.BECOME_A_SUSTAINER);
})
.setSecondaryButton(R.string.BecomeASustainerMegaphone__not_now, (megaphone, listener) -> {
listener.onMegaphoneCompleted(Event.BECOME_A_SUSTAINER);
})
.build();
}
private static @NonNull Megaphone buildDonateQ2Megaphone(@NonNull Context context) {
return new Megaphone.Builder(Event.DONATE_Q2_2022, Megaphone.Style.BASIC)
.setTitle(R.string.Donate2022Q2Megaphone_donate_to_signal)
.setImage(R.drawable.ic_donate_q2_2022)
.setBody(R.string.Donate2022Q2Megaphone_signal_is_powered_by_people_like_you)
.setActionButton(R.string.Donate2022Q2Megaphone_donate, (megaphone, listener) -> {
listener.onMegaphoneNavigationRequested(AppSettingsActivity.subscriptions(context));
listener.onMegaphoneCompleted(Event.DONATE_Q2_2022);
})
.setSecondaryButton(R.string.Donate2022Q2Megaphone_not_now, (megaphone, listener) -> {
listener.onMegaphoneCompleted(Event.DONATE_Q2_2022);
})
.build();
}
private static @NonNull Megaphone buildTurnOffCircumventionMegaphone(@NonNull Context context) {
return new Megaphone.Builder(Event.TURN_OFF_CENSORSHIP_CIRCUMVENTION, Megaphone.Style.BASIC)
.setTitle(R.string.CensorshipCircumventionMegaphone_turn_off_censorship_circumvention)
@@ -405,20 +366,6 @@ public final class Megaphones {
.build();
}
private static boolean shouldShowDonateMegaphone(@NonNull Context context, @NonNull Event event, @NonNull Map<Event, MegaphoneRecord> records) {
long timeSinceLastDonatePrompt = timeSinceLastDonatePrompt(event, records);
return timeSinceLastDonatePrompt > MIN_TIME_BETWEEN_DONATE_MEGAPHONES &&
VersionTracker.getDaysSinceFirstInstalled(context) >= 7 &&
LocaleFeatureFlags.isInDonateMegaphone() &&
InAppDonations.INSTANCE.hasAtLeastOnePaymentMethodAvailable() &&
Recipient.self()
.getBadges()
.stream()
.filter(Objects::nonNull)
.noneMatch(badge -> badge.getCategory() == Badge.Category.Donor);
}
private static boolean shouldShowOnboardingMegaphone(@NonNull Context context) {
return SignalStore.onboarding().hasOnboarding(context);
}

View File

@@ -60,7 +60,6 @@ public final class FeatureFlags {
private static final String INTERNAL_USER = "android.internalUser";
private static final String VERIFY_V2 = "android.verifyV2";
private static final String CLIENT_EXPIRATION = "android.clientExpiration";
public static final String DONATE_MEGAPHONE = "android.donate.2";
private static final String CUSTOM_VIDEO_MUXER = "android.customVideoMuxer";
private static final String CDS_REFRESH_INTERVAL = "cds.syncInterval.seconds";
private static final String AUTOMATIC_SESSION_RESET = "android.automaticSessionReset.2";
@@ -92,7 +91,6 @@ public final class FeatureFlags {
private static final String TELECOM_MODEL_BLOCKLIST = "android.calling.telecomModelBlockList";
private static final String CAMERAX_MODEL_BLOCKLIST = "android.cameraXModelBlockList";
private static final String CAMERAX_MIXED_MODEL_BLOCKLIST = "android.cameraXMixedModelBlockList";
private static final String HIDE_CONTACTS = "android.hide.contacts.2";
private static final String PAYMENTS_REQUEST_ACTIVATE_FLOW = "android.payments.requestActivateFlow";
public static final String GOOGLE_PAY_DISABLED_REGIONS = "global.donations.gpayDisabledRegions";
public static final String CREDIT_CARD_DISABLED_REGIONS = "global.donations.ccDisabledRegions";
@@ -102,7 +100,6 @@ public final class FeatureFlags {
private static final String PAYPAL_RECURRING_DONATIONS = "android.recurringPayPalDonations.3";
private static final String ANY_ADDRESS_PORTS_KILL_SWITCH = "android.calling.fieldTrial.anyAddressPortsKillSwitch";
private static final String AD_HOC_CALLING = "android.calling.ad.hoc.3";
private static final String EDIT_MESSAGE_SEND = "android.editMessage.send.13";
private static final String MAX_ATTACHMENT_COUNT = "android.attachments.maxCount";
private static final String MAX_ATTACHMENT_RECEIVE_SIZE_BYTES = "global.attachments.maxReceiveBytes";
private static final String MAX_ATTACHMENT_SIZE_BYTES = "global.attachments.maxBytes";
@@ -114,7 +111,6 @@ public final class FeatureFlags {
public static final String PROMPT_BATTERY_SAVER = "android.promptBatterySaver";
public static final String USERNAMES = "android.usernames";
public static final String INSTANT_VIDEO_PLAYBACK = "android.instantVideoPlayback";
private static final String CONVERSATION_ITEM_V2_TEXT = "android.conversationItemV2.text.4";
public static final String CRASH_PROMPT_CONFIG = "android.crashPromptConfig";
private static final String SEPA_DEBIT_DONATIONS = "android.sepa.debit.donations.4";
private static final String IDEAL_DONATIONS = "android.ideal.donations.4";
@@ -132,7 +128,6 @@ public final class FeatureFlags {
INTERNAL_USER,
VERIFY_V2,
CLIENT_EXPIRATION,
DONATE_MEGAPHONE,
CUSTOM_VIDEO_MUXER,
CDS_REFRESH_INTERVAL,
GROUP_NAME_MAX_LENGTH,
@@ -163,7 +158,6 @@ public final class FeatureFlags {
TELECOM_MODEL_BLOCKLIST,
CAMERAX_MODEL_BLOCKLIST,
CAMERAX_MIXED_MODEL_BLOCKLIST,
HIDE_CONTACTS,
PAYMENTS_REQUEST_ACTIVATE_FLOW,
GOOGLE_PAY_DISABLED_REGIONS,
CREDIT_CARD_DISABLED_REGIONS,
@@ -172,7 +166,6 @@ public final class FeatureFlags {
PAYPAL_ONE_TIME_DONATIONS,
PAYPAL_RECURRING_DONATIONS,
ANY_ADDRESS_PORTS_KILL_SWITCH,
EDIT_MESSAGE_SEND,
MAX_ATTACHMENT_COUNT,
MAX_ATTACHMENT_RECEIVE_SIZE_BYTES,
MAX_ATTACHMENT_SIZE_BYTES,
@@ -185,7 +178,6 @@ public final class FeatureFlags {
PROMPT_BATTERY_SAVER,
USERNAMES,
INSTANT_VIDEO_PLAYBACK,
CONVERSATION_ITEM_V2_TEXT,
CRASH_PROMPT_CONFIG,
BLOCK_SSE,
SEPA_DEBIT_DONATIONS,
@@ -240,7 +232,6 @@ public final class FeatureFlags {
RETRY_RECEIPTS,
MAX_GROUP_CALL_RING_SIZE,
SENDER_KEY_MAX_AGE,
DONATE_MEGAPHONE,
HARDWARE_AEC_BLOCKLIST_MODELS,
SOFTWARE_AEC_BLOCKLIST_MODELS,
USE_HARDWARE_AEC_IF_OLD,
@@ -251,7 +242,6 @@ public final class FeatureFlags {
CAMERAX_MODEL_BLOCKLIST,
PAYMENTS_REQUEST_ACTIVATE_FLOW,
CDS_HARD_LIMIT,
EDIT_MESSAGE_SEND,
MAX_ATTACHMENT_COUNT,
MAX_ATTACHMENT_RECEIVE_SIZE_BYTES,
MAX_ATTACHMENT_SIZE_BYTES,
@@ -375,11 +365,6 @@ public final class FeatureFlags {
return getString(CLIENT_EXPIRATION, null);
}
/** The raw donate megaphone CSV string */
public static String donateMegaphone() {
return getString(DONATE_MEGAPHONE, "");
}
/**
* Whether phone number privacy is enabled.
* IMPORTANT: This is under active development. Enabling this *will* break your contacts in terrible, irreversible ways.
@@ -535,16 +520,6 @@ public final class FeatureFlags {
return getInteger(STORIES_AUTO_DOWNLOAD_MAXIMUM, 2);
}
/**
* Whether or not users can hide contacts.
*
* WARNING: This feature is intended to be enabled in tandem with other clients, as it modifies contact records.
* Here be dragons.
*/
public static boolean hideContacts() {
return getBoolean(HIDE_CONTACTS, false);
}
/** Whether client supports sending a request to another to activate payments */
public static boolean paymentsRequestActivateFlow() {
return getBoolean(PAYMENTS_REQUEST_ACTIVATE_FLOW, false);
@@ -606,10 +581,6 @@ public final class FeatureFlags {
return getBoolean(FCM_MAY_HAVE_MESSAGES_KILL_SWITCH, false);
}
public static boolean editMessageSending() {
return getBoolean(EDIT_MESSAGE_SEND, false);
}
/**
* Whether or not ad-hoc calling is enabled
*/
@@ -651,15 +622,6 @@ public final class FeatureFlags {
return getBoolean(INSTANT_VIDEO_PLAYBACK, false);
}
/**
* Note: this setting is currently
*
* @return Whether to use TextOnly V2 Conversation Items.
*/
public static boolean useTextOnlyConversationItemV2() {
return getBoolean(CONVERSATION_ITEM_V2_TEXT, false);
}
public static String promptForDelayedNotificationLogs() {
return getString(PROMPT_FOR_NOTIFICATION_LOGS, "*");
}

View File

@@ -29,13 +29,6 @@ public final class LocaleFeatureFlags {
private static final String COUNTRY_WILDCARD = "*";
private static final int NOT_FOUND = -1;
/**
* In donate megaphone group for given country code
*/
public static boolean isInDonateMegaphone() {
return isEnabledPartsPerMillion(FeatureFlags.DONATE_MEGAPHONE, FeatureFlags.donateMegaphone());
}
public static @NonNull Optional<PushMediaConstraints.MediaConfig> getMediaQualityLevel() {
Map<String, Integer> countryValues = parseCountryValues(FeatureFlags.getMediaQualityLevels(), NOT_FOUND);
int level = getCountryValue(countryValues, Recipient.self().getE164().orElse(""), NOT_FOUND);