Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8638e6d8 authored by Austin Delgado's avatar Austin Delgado
Browse files

Use device credential owner as effective user in Credential Interactor

Test: CredentialInteractorImplTest
Bug: 377656342
Flag: EXEMPT bugfix
Change-Id: I5ad11b9aa6b8d9892e561089fe60c9e43d034b5a
parent 02bf9ff7
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import org.mockito.junit.MockitoJUnit

private const val USER_ID = 22
private const val OWNER_ID = 10
private const val PASSWORD_ID = 30
private const val OPERATION_ID = 100L
private const val MAX_ATTEMPTS = 5

@@ -247,7 +248,11 @@ class CredentialInteractorImplTest : SysuiTestCase() {
private fun pinRequest(credentialOwner: Int = USER_ID): BiometricPromptRequest.Credential.Pin =
    BiometricPromptRequest.Credential.Pin(
        promptInfo(),
        BiometricUserInfo(userId = USER_ID, deviceCredentialOwnerId = credentialOwner),
        BiometricUserInfo(
            userId = USER_ID,
            deviceCredentialOwnerId = credentialOwner,
            userIdForPasswordEntry = PASSWORD_ID,
        ),
        BiometricOperationInfo(OPERATION_ID),
    )

+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ constructor(
        // Request LockSettingsService to return the Gatekeeper Password in the
        // VerifyCredentialResponse so that we can request a Gatekeeper HAT with the
        // Gatekeeper Password and operationId.
        var effectiveUserId = request.userInfo.userIdForPasswordEntry
        var effectiveUserId = request.userInfo.deviceCredentialOwnerId
        val response =
            if (Flags.privateSpaceBp() && effectiveUserId != request.userInfo.userId) {
                effectiveUserId = request.userInfo.userId