mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Start mirroring to SVR2.
This commit is contained in:
committed by
Clark Chen
parent
dfb7304626
commit
e1570e9512
@@ -30,8 +30,8 @@ import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.keyvalue.SmsExportPhase;
|
||||
import org.thoughtcrime.securesms.lock.SignalPinReminderDialog;
|
||||
import org.thoughtcrime.securesms.lock.SignalPinReminders;
|
||||
import org.thoughtcrime.securesms.lock.v2.CreateKbsPinActivity;
|
||||
import org.thoughtcrime.securesms.lock.v2.KbsMigrationActivity;
|
||||
import org.thoughtcrime.securesms.lock.v2.CreateSvrPinActivity;
|
||||
import org.thoughtcrime.securesms.lock.v2.SvrMigrationActivity;
|
||||
import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||
import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
||||
@@ -164,7 +164,7 @@ public final class Megaphones {
|
||||
.enableSnooze(null)
|
||||
.setOnVisibleListener((megaphone, listener) -> {
|
||||
if (new NetworkConstraint.Factory(ApplicationDependencies.getApplication()).create().isMet()) {
|
||||
listener.onMegaphoneNavigationRequested(KbsMigrationActivity.createIntent(), KbsMigrationActivity.REQUEST_NEW_PIN);
|
||||
listener.onMegaphoneNavigationRequested(SvrMigrationActivity.createIntent(), SvrMigrationActivity.REQUEST_NEW_PIN);
|
||||
}
|
||||
})
|
||||
.build();
|
||||
@@ -174,9 +174,9 @@ public final class Megaphones {
|
||||
.setTitle(R.string.KbsMegaphone__create_a_pin)
|
||||
.setBody(R.string.KbsMegaphone__pins_keep_information_thats_stored_with_signal_encrytped)
|
||||
.setActionButton(R.string.KbsMegaphone__create_pin, (megaphone, listener) -> {
|
||||
Intent intent = CreateKbsPinActivity.getIntentForPinCreate(ApplicationDependencies.getApplication());
|
||||
Intent intent = CreateSvrPinActivity.getIntentForPinCreate(ApplicationDependencies.getApplication());
|
||||
|
||||
listener.onMegaphoneNavigationRequested(intent, CreateKbsPinActivity.REQUEST_NEW_PIN);
|
||||
listener.onMegaphoneNavigationRequested(intent, CreateSvrPinActivity.REQUEST_NEW_PIN);
|
||||
})
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -43,11 +43,11 @@ class PinsForAllSchedule implements MegaphoneSchedule {
|
||||
}
|
||||
|
||||
private static boolean isEnabled() {
|
||||
if (SignalStore.kbsValues().hasOptedOut()) {
|
||||
if (SignalStore.svr().hasOptedOut()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SignalStore.kbsValues().hasPin()) {
|
||||
if (SignalStore.svr().hasPin()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -55,10 +55,6 @@ class PinsForAllSchedule implements MegaphoneSchedule {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (newlyRegisteredRegistrationLockV1User()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (SignalStore.registrationValues().pinWasRequiredAtRegistration()) {
|
||||
return false;
|
||||
}
|
||||
@@ -68,11 +64,6 @@ class PinsForAllSchedule implements MegaphoneSchedule {
|
||||
|
||||
private static boolean pinCreationFailedDuringRegistration() {
|
||||
return SignalStore.registrationValues().pinWasRequiredAtRegistration() &&
|
||||
!SignalStore.kbsValues().hasPin() &&
|
||||
!TextSecurePreferences.isV1RegistrationLockEnabled(ApplicationDependencies.getApplication());
|
||||
}
|
||||
|
||||
private static boolean newlyRegisteredRegistrationLockV1User() {
|
||||
return SignalStore.registrationValues().pinWasRequiredAtRegistration() && TextSecurePreferences.isV1RegistrationLockEnabled(ApplicationDependencies.getApplication());
|
||||
!SignalStore.svr().hasPin();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ final class SignalPinReminderSchedule implements MegaphoneSchedule {
|
||||
|
||||
@Override
|
||||
public boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime) {
|
||||
if (SignalStore.kbsValues().hasOptedOut()) {
|
||||
if (SignalStore.svr().hasOptedOut()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!SignalStore.kbsValues().hasPin()) {
|
||||
if (!SignalStore.svr().hasPin()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user