mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Update copy and behavior of SMS phased removal flow.
This commit is contained in:
@@ -232,6 +232,8 @@ public final class MiscellaneousValues extends SignalStoreValues {
|
||||
}
|
||||
|
||||
public @NonNull SmsExportPhase getSmsExportPhase() {
|
||||
return SmsExportPhase.PHASE_0;
|
||||
long now = System.currentTimeMillis();
|
||||
long phase1StartMs = getLong(SMS_PHASE_1_START_MS, now);
|
||||
return SmsExportPhase.getCurrentPhase(now - phase1StartMs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,12 @@ import org.thoughtcrime.securesms.util.Util
|
||||
import kotlin.time.Duration.Companion.days
|
||||
|
||||
enum class SmsExportPhase(val duration: Long) {
|
||||
PHASE_0(-1),
|
||||
PHASE_1(0.days.inWholeMilliseconds),
|
||||
PHASE_2(45.days.inWholeMilliseconds),
|
||||
PHASE_3(105.days.inWholeMilliseconds);
|
||||
|
||||
fun allowSmsFeatures(): Boolean {
|
||||
return this == PHASE_0 || (Util.isDefaultSmsProvider(ApplicationDependencies.getApplication()) && SignalStore.misc().smsExportPhase.isSmsSupported())
|
||||
return Util.isDefaultSmsProvider(ApplicationDependencies.getApplication()) && SignalStore.misc().smsExportPhase.isSmsSupported()
|
||||
}
|
||||
|
||||
fun isSmsSupported(): Boolean {
|
||||
@@ -26,10 +25,6 @@ enum class SmsExportPhase(val duration: Long) {
|
||||
return this == PHASE_3
|
||||
}
|
||||
|
||||
fun isAtLeastPhase1(): Boolean {
|
||||
return this.ordinal >= PHASE_1.ordinal
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun getCurrentPhase(duration: Long): SmsExportPhase {
|
||||
|
||||
Reference in New Issue
Block a user