Remove profile name reminder megaphone.

master
Greyson Parrelli 2020-06-26 11:50:33 -04:00
parent bbe003a454
commit db545f43ea
5 changed files with 0 additions and 65 deletions

View File

@ -142,8 +142,6 @@ public class ConversationListFragment extends MainFragment implements ActionMode
MegaphoneActionController
{
public static final short MESSAGE_REQUESTS_REQUEST_CODE_CREATE_NAME = 32562;
public static final short PROFILE_NAMES_REQUEST_CODE_CREATE_NAME = 18473;
public static final short PROFILE_NAMES_REQUEST_CODE_CONFIRM_NAME = 19563;
private static final String TAG = Log.tag(ConversationListFragment.class);
@ -331,20 +329,9 @@ public class ConversationListFragment extends MainFragment implements ActionMode
return;
}
boolean isProfileCreatedRequestCode = requestCode == MESSAGE_REQUESTS_REQUEST_CODE_CREATE_NAME ||
requestCode ==PROFILE_NAMES_REQUEST_CODE_CREATE_NAME;
if (requestCode == CreateKbsPinActivity.REQUEST_NEW_PIN) {
Snackbar.make(fab, R.string.ConfirmKbsPinFragment__pin_created, Snackbar.LENGTH_LONG).show();
viewModel.onMegaphoneCompleted(Megaphones.Event.PINS_FOR_ALL);
} else if (isProfileCreatedRequestCode) {
Snackbar.make(fab, R.string.ConversationListFragment__your_profile_name_has_been_created, Snackbar.LENGTH_LONG).show();
if (requestCode == MESSAGE_REQUESTS_REQUEST_CODE_CREATE_NAME) {
viewModel.onMegaphoneCompleted(Megaphones.Event.MESSAGE_REQUESTS);
}
} else if (requestCode == PROFILE_NAMES_REQUEST_CODE_CONFIRM_NAME) {
Snackbar.make(fab, R.string.ConversationListFragment__your_profile_name_has_been_saved, Snackbar.LENGTH_LONG).show();
}
}

View File

@ -93,7 +93,6 @@ public final class Megaphones {
return new LinkedHashMap<Event, MegaphoneSchedule>() {{
put(Event.REACTIONS, ALWAYS);
put(Event.PINS_FOR_ALL, new PinsForAllSchedule());
put(Event.PROFILE_NAMES_FOR_ALL, FeatureFlags.profileNamesMegaphone() ? EVERY_TWO_DAYS : NEVER);
put(Event.PIN_REMINDER, new SignalPinReminderSchedule());
put(Event.MESSAGE_REQUESTS, shouldShowMessageRequestsMegaphone() ? ALWAYS : NEVER);
}};
@ -107,8 +106,6 @@ public final class Megaphones {
return buildPinsForAllMegaphone(record);
case PIN_REMINDER:
return buildPinReminderMegaphone(context);
case PROFILE_NAMES_FOR_ALL:
return buildProfileNamesMegaphone(context);
case MESSAGE_REQUESTS:
return buildMessageRequestsMegaphone(context);
default:
@ -180,34 +177,6 @@ public final class Megaphones {
.build();
}
private static @NonNull Megaphone buildProfileNamesMegaphone(@NonNull Context context) {
short requestCode = Recipient.self().getProfileName() != ProfileName.EMPTY
? ConversationListFragment.PROFILE_NAMES_REQUEST_CODE_CONFIRM_NAME
: ConversationListFragment.PROFILE_NAMES_REQUEST_CODE_CREATE_NAME;
Megaphone.Builder builder = new Megaphone.Builder(Event.PROFILE_NAMES_FOR_ALL, Megaphone.Style.BASIC)
.enableSnooze(null)
.setImageRequest(AvatarUtil.getSelfAvatarOrFallbackIcon(context, R.drawable.ic_profilename_64));
if (Recipient.self().getProfileName() == ProfileName.EMPTY) {
return builder.setTitle(R.string.ProfileNamesMegaphone__add_a_profile_name)
.setBody(R.string.ProfileNamesMegaphone__this_will_be_displayed_when_you_start)
.setActionButton(R.string.ProfileNamesMegaphone__add_profile_name, (megaphone, listener) -> {
listener.onMegaphoneSnooze(Event.PROFILE_NAMES_FOR_ALL);
listener.onMegaphoneNavigationRequested(new Intent(context, EditProfileActivity.class), requestCode);
})
.build();
} else {
return builder.setTitle(R.string.ProfileNamesMegaphone__confirm_your_profile_name)
.setBody(R.string.ProfileNamesMegaphone__your_profile_can_now_include)
.setActionButton(R.string.ProfileNamesMegaphone__confirm_name, (megaphone, listener) -> {
listener.onMegaphoneCompleted(Event.PROFILE_NAMES_FOR_ALL);
listener.onMegaphoneNavigationRequested(new Intent(context, EditProfileActivity.class), requestCode);
})
.build();
}
}
private static @NonNull Megaphone buildMessageRequestsMegaphone(@NonNull Context context) {
return new Megaphone.Builder(Event.MESSAGE_REQUESTS, Megaphone.Style.FULLSCREEN)
.disableSnooze()
@ -227,7 +196,6 @@ public final class Megaphones {
REACTIONS("reactions"),
PINS_FOR_ALL("pins_for_all"),
PIN_REMINDER("pin_reminder"),
PROFILE_NAMES_FOR_ALL("profile_names"),
MESSAGE_REQUESTS("message_requests");
private final String key;

View File

@ -338,8 +338,6 @@ public class EditProfileFragment extends LoggingFragment {
if (uploadResult == EditProfileRepository.UploadResult.SUCCESS) {
RegistrationUtil.markRegistrationPossiblyComplete();
ApplicationDependencies.getMegaphoneRepository().markFinished(Megaphones.Event.PROFILE_NAMES_FOR_ALL);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) handleFinishedLollipop();
else handleFinishedLegacy();
} else {

View File

@ -53,7 +53,6 @@ public final class FeatureFlags {
private static final String USERNAMES = "android.usernames";
private static final String PINS_FOR_ALL_MANDATORY = "android.pinsForAllMandatory";
private static final String PINS_MEGAPHONE_KILL_SWITCH = "android.pinsMegaphoneKillSwitch";
private static final String PROFILE_NAMES_MEGAPHONE = "android.profileNamesMegaphone";
private static final String ATTACHMENTS_V3 = "android.attachmentsV3";
private static final String REMOTE_DELETE = "android.remoteDelete";
private static final String PROFILE_FOR_CALLING = "android.profileForCalling";
@ -73,7 +72,6 @@ public final class FeatureFlags {
private static final Set<String> REMOTE_CAPABLE = Sets.newHashSet(
PINS_FOR_ALL_MANDATORY,
PINS_MEGAPHONE_KILL_SWITCH,
PROFILE_NAMES_MEGAPHONE,
ATTACHMENTS_V3,
REMOTE_DELETE,
PROFILE_FOR_CALLING,
@ -210,12 +208,6 @@ public final class FeatureFlags {
return getBoolean(PINS_MEGAPHONE_KILL_SWITCH, false);
}
/** Safety switch for disabling profile names megaphone */
public static boolean profileNamesMegaphone() {
return getBoolean(PROFILE_NAMES_MEGAPHONE, false) &&
TextSecurePreferences.getFirstInstallVersion(ApplicationDependencies.getApplication()) < 600;
}
/** Whether or not we use the attachments v3 form. */
public static boolean attachmentsV3() {
return getBoolean(ATTACHMENTS_V3, false);

View File

@ -346,8 +346,6 @@
<item quantity="one">Moved conversation to inbox</item>
<item quantity="other">Moved %d conversations to inbox</item>
</plurals>
<string name="ConversationListFragment__your_profile_name_has_been_created">Your profile name has been created.</string>
<string name="ConversationListFragment__your_profile_name_has_been_saved">Your profile name has been saved.</string>
<!-- ConversationListItem -->
<string name="ConversationListItem_key_exchange_message">Key exchange message</string>
@ -2198,14 +2196,6 @@
<string name="KbsMegaphone__well_remind_you_later_creating_a_pin">We\'ll remind you later. Creating a PIN will become mandatory in %1$d days.</string>
<string name="KbsMegaphone__well_remind_you_later_confirming_your_pin">We\'ll remind you later. Confirming your PIN will become mandatory in %1$d days.</string>
<!-- Profile Names Megaphone -->
<string name="ProfileNamesMegaphone__add_a_profile_name">Add a profile name</string>
<string name="ProfileNamesMegaphone__this_will_be_displayed_when_you_start">This will be displayed when you start a new conversation or share it.</string>
<string name="ProfileNamesMegaphone__add_profile_name">Add Profile Name</string>
<string name="ProfileNamesMegaphone__confirm_your_profile_name">Confirm your Profile Name</string>
<string name="ProfileNamesMegaphone__your_profile_can_now_include">Your profile can now include an optional last name.</string>
<string name="ProfileNamesMegaphone__confirm_name">Confirm Name</string>
<!-- transport_selection_list_item -->
<string name="transport_selection_list_item__transport_icon">Transport icon</string>
<string name="ConversationListFragment_loading">Loading…</string>