mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-20 00:35:47 +01:00
Remove unnecessary mock-numberless config.
This commit is contained in:
committed by
Alex Hart
parent
d069ffb6d5
commit
b0297bd035
-19
@@ -100,7 +100,6 @@ import org.thoughtcrime.securesms.service.DirectoryRefreshListener
|
||||
import org.thoughtcrime.securesms.service.LocalBackupListener
|
||||
import org.thoughtcrime.securesms.service.RotateSignedPreKeyListener
|
||||
import org.thoughtcrime.securesms.util.BackupUtil
|
||||
import org.thoughtcrime.securesms.util.Environment
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||
import org.whispersystems.signalservice.api.link.TransferArchiveResponse
|
||||
import org.whispersystems.signalservice.api.push.UsernameLinkComponents
|
||||
@@ -291,24 +290,6 @@ class AppRegistrationStorageController(private val context: Context) : StorageCo
|
||||
Log.i(TAG, "[onRegistrationFlowFinished] Username reclaim is still pending. Enqueuing a job to handle it.")
|
||||
AppDependencies.jobManager.add(ReclaimUsernameAndLinkJob())
|
||||
}
|
||||
|
||||
if (Environment.MOCK_PHONE_NUMBERLESS_REGISTRATION) {
|
||||
Log.w(TAG, "[onRegistrationFlowFinished] Mocking a phone-number-less account. Wiping all local knowledge of the E164 and PNI.")
|
||||
|
||||
val pni = SignalStore.account.pni
|
||||
|
||||
SignalStore.account.clearE164AndPni()
|
||||
SignalDatabase.recipients.clearSelfE164AndPni(Recipient.self().id)
|
||||
AppDependencies.recipientCache.clearSelf()
|
||||
|
||||
if (pni != null) {
|
||||
SignalDatabase.oneTimePreKeys.deleteAll(pni)
|
||||
SignalDatabase.signedPreKeys.deleteAll(pni)
|
||||
SignalDatabase.kyberPreKeys.deleteAll(pni)
|
||||
}
|
||||
|
||||
AppDependencies.resetProtocolStores()
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun saveUsername(username: String, usernameLink: UsernameLinkComponents) = withContext(Dispatchers.IO) {
|
||||
|
||||
@@ -30,12 +30,6 @@ object Environment {
|
||||
|
||||
const val PHONENUMBERLESS_REGISTRATION: Boolean = false
|
||||
|
||||
/**
|
||||
* When true, all local knowledge of the user's phone number (E164 and PNI) is wiped once registration completes,
|
||||
* mimicking the experience of an account that has no phone number. Flip manually for local testing.
|
||||
*/
|
||||
const val MOCK_PHONE_NUMBERLESS_REGISTRATION: Boolean = false
|
||||
|
||||
object Backups {
|
||||
@JvmStatic
|
||||
fun supportsGooglePlayBilling(): Boolean {
|
||||
|
||||
@@ -22,9 +22,4 @@ class EnvironmentTest {
|
||||
fun `phone-numberless registration is disabled`() {
|
||||
assertThat(Environment.PHONENUMBERLESS_REGISTRATION).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `MOCK_PHONE_NUMBERLESS_REGISTRATION is disabled`() {
|
||||
assertThat(Environment.MOCK_PHONE_NUMBERLESS_REGISTRATION).isFalse()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user