Fix missing prompt to save PIN to password manager on Android < 14.

On Android versions older than 14, users were not prompted to save their PIN to their device password manager due to an autofill session conflict.

The `CreateSvrPinFragment.input` field triggered an autofill session, so when `ConfirmSvrPinFragment` later attempted to save the PIN using `CredentialManager`, the system incorrectly assumed the credential had already been saved by autofill and skipped the save prompt.
This commit is contained in:
jeffrey-signal
2025-07-14 12:48:42 -04:00
committed by Jeffrey Starke
parent 24360a41ff
commit 1137bbd8a5

View File

@@ -1,10 +1,12 @@
package org.thoughtcrime.securesms.lock.v2
import android.view.View
import android.view.animation.Animation
import android.view.animation.TranslateAnimation
import android.widget.EditText
import androidx.annotation.PluralsRes
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.Navigation.findNavController
import org.thoughtcrime.securesms.R
@@ -21,8 +23,10 @@ class CreateSvrPinFragment : BaseSvrPinFragment<CreateSvrPinViewModel?>() {
} else {
initializeViewStatesForPinCreate()
}
label.text = getPinLengthRestrictionText(R.plurals.CreateKbsPinFragment__pin_must_be_at_least_digits)
confirm.isEnabled = false
ViewCompat.setImportantForAutofill(input, View.IMPORTANT_FOR_AUTOFILL_NO)
}
private fun initializeViewStatesForPinChange() {