/
patch-002-enable-sms-6.5.0.diff
84 lines (72 loc) · 3.07 KB
/
patch-002-enable-sms-6.5.0.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
diff --git a/app/src/main/java/org/thoughtcrime/securesms/keyvalue/SmsExportPhase.kt b/app/src/main/java/org/thoughtcrime/securesms/keyvalue/SmsExportPhase.kt
index 7d60b7c46..b7ca4a28a 100644
--- a/app/src/main/java/org/thoughtcrime/securesms/keyvalue/SmsExportPhase.kt
+++ b/app/src/main/java/org/thoughtcrime/securesms/keyvalue/SmsExportPhase.kt
@@ -6,34 +6,34 @@ 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);
+ PHASE_2(40000.days.inWholeMilliseconds),
+ PHASE_3(40001.days.inWholeMilliseconds);
fun allowSmsFeatures(): Boolean {
return this == PHASE_0 || (Util.isDefaultSmsProvider(ApplicationDependencies.getApplication()) && SignalStore.misc().smsExportPhase.isSmsSupported())
}
fun isSmsSupported(): Boolean {
- return this != PHASE_3
+ return true
}
fun isFullscreen(): Boolean {
- return this.ordinal > PHASE_1.ordinal
+ return false
}
fun isBlockingUi(): Boolean {
- return this == PHASE_3
+ return false
}
fun isAtLeastPhase1(): Boolean {
- return this.ordinal >= PHASE_1.ordinal
+ return false
}
companion object {
@JvmStatic
fun getCurrentPhase(duration: Long): SmsExportPhase {
- return values().findLast { duration >= it.duration }!!
+ return PHASE_1
}
}
}
diff --git a/app/src/main/java/org/thoughtcrime/securesms/megaphone/SmsExportReminderSchedule.kt b/app/src/main/java/org/thoughtcrime/securesms/megaphone/SmsExportReminderSchedule.kt
index 17426e73c..d4afdd083 100644
--- a/app/src/main/java/org/thoughtcrime/securesms/megaphone/SmsExportReminderSchedule.kt
+++ b/app/src/main/java/org/thoughtcrime/securesms/megaphone/SmsExportReminderSchedule.kt
@@ -2,31 +2,16 @@ package org.thoughtcrime.securesms.megaphone
import android.content.Context
import androidx.annotation.WorkerThread
-import org.thoughtcrime.securesms.keyvalue.SignalStore
-import org.thoughtcrime.securesms.keyvalue.SmsExportPhase
-import kotlin.time.Duration.Companion.days
class SmsExportReminderSchedule(private val context: Context) : MegaphoneSchedule {
companion object {
@JvmStatic
- var showPhase3Megaphone = true
+ var showPhase3Megaphone = false
}
- private val basicMegaphoneSchedule = RecurringSchedule(3.days.inWholeMilliseconds)
- private val fullScreenSchedule = RecurringSchedule(1.days.inWholeMilliseconds)
-
@WorkerThread
override fun shouldDisplay(seenCount: Int, lastSeen: Long, firstVisible: Long, currentTime: Long): Boolean {
- return if (shouldShowMegaphone()) {
- when (SignalStore.misc().smsExportPhase) {
- SmsExportPhase.PHASE_0 -> false
- SmsExportPhase.PHASE_1 -> basicMegaphoneSchedule.shouldDisplay(seenCount, lastSeen, firstVisible, currentTime)
- SmsExportPhase.PHASE_2 -> fullScreenSchedule.shouldDisplay(seenCount, lastSeen, firstVisible, currentTime)
- SmsExportPhase.PHASE_3 -> showPhase3Megaphone
- }
- } else {
- false
- }
+ return false
}