Remove unnecessary mock-numberless config.

This commit is contained in:
Greyson Parrelli
2026-09-02 16:11:23 -03:00
committed by Alex Hart
parent d069ffb6d5
commit b0297bd035
3 changed files with 0 additions and 30 deletions
@@ -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()
}
}