Add the ability to opt out of PINs.

This commit is contained in:
Greyson Parrelli
2020-07-09 16:04:30 -07:00
parent c26dcc2618
commit 04a8996348
24 changed files with 550 additions and 101 deletions

View File

@@ -44,6 +44,10 @@ class PinsForAllSchedule implements MegaphoneSchedule {
}
private static boolean isEnabled() {
if (SignalStore.kbsValues().hasOptedOut()) {
return false;
}
if (SignalStore.kbsValues().hasPin()) {
return false;
}

View File

@@ -9,6 +9,10 @@ final class SignalPinReminderSchedule implements MegaphoneSchedule {
@Override
public boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime) {
if (SignalStore.kbsValues().hasOptedOut()) {
return false;
}
if (!SignalStore.kbsValues().hasPin()) {
return false;
}