kopia lustrzana https://github.com/ryukoposting/Signal-Android
Always use SMS phase 0
rodzic
309271d836
commit
92f10b8a86
|
@ -192,9 +192,9 @@ public final class MiscellaneousValues extends SignalStoreValues {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startSmsPhase1() {
|
public void startSmsPhase1() {
|
||||||
if (!getStore().containsKey(SMS_PHASE_1_START_MS)) {
|
// if (!getStore().containsKey(SMS_PHASE_1_START_MS)) {
|
||||||
putLong(SMS_PHASE_1_START_MS, System.currentTimeMillis());
|
// putLong(SMS_PHASE_1_START_MS, System.currentTimeMillis());
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getStoriesFeatureAvailableTimestamp() {
|
public long getStoriesFeatureAvailableTimestamp() {
|
||||||
|
@ -206,11 +206,6 @@ public final class MiscellaneousValues extends SignalStoreValues {
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NonNull SmsExportPhase getSmsExportPhase() {
|
public @NonNull SmsExportPhase getSmsExportPhase() {
|
||||||
if (getLong(SMS_PHASE_1_START_MS, 0) == 0) {
|
return SmsExportPhase.PHASE_0;
|
||||||
return SmsExportPhase.PHASE_0;
|
|
||||||
}
|
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
|
||||||
return SmsExportPhase.getCurrentPhase(now - getLong(SMS_PHASE_1_START_MS, now));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,29 +11,29 @@ enum class SmsExportPhase(val duration: Long) {
|
||||||
PHASE_3(105.days.inWholeMilliseconds);
|
PHASE_3(105.days.inWholeMilliseconds);
|
||||||
|
|
||||||
fun allowSmsFeatures(): Boolean {
|
fun allowSmsFeatures(): Boolean {
|
||||||
return this == PHASE_0 || (Util.isDefaultSmsProvider(ApplicationDependencies.getApplication()) && SignalStore.misc().smsExportPhase.isSmsSupported())
|
return Util.isDefaultSmsProvider(ApplicationDependencies.getApplication())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isSmsSupported(): Boolean {
|
fun isSmsSupported(): Boolean {
|
||||||
return this != PHASE_3
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isFullscreen(): Boolean {
|
fun isFullscreen(): Boolean {
|
||||||
return this.ordinal > PHASE_1.ordinal
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isBlockingUi(): Boolean {
|
fun isBlockingUi(): Boolean {
|
||||||
return this == PHASE_3
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isAtLeastPhase1(): Boolean {
|
fun isAtLeastPhase1(): Boolean {
|
||||||
return this.ordinal >= PHASE_1.ordinal
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun getCurrentPhase(duration: Long): SmsExportPhase {
|
fun getCurrentPhase(duration: Long): SmsExportPhase {
|
||||||
return values().findLast { duration >= it.duration }!!
|
return PHASE_0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue