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

Commit 550349ab authored by Arpan Kaphle's avatar Arpan Kaphle Committed by Android (Google) Code Review
Browse files

Merge "Provider Activity Interruption Fix" into main

parents e1f2ecd3 d44799fc
Loading
Loading
Loading
Loading
+12 −6
Original line number Original line Diff line number Diff line
@@ -175,10 +175,7 @@ class CredentialSelectorViewModel(
            } else {
            } else {
                Log.d(Constants.LOG_TAG, "The provider activity was cancelled," +
                Log.d(Constants.LOG_TAG, "The provider activity was cancelled," +
                            " re-displaying our UI.")
                            " re-displaying our UI.")
                uiState = uiState.copy(
                resetUiStateForReLaunch()
                    selectedEntry = null,
                    providerActivityState = ProviderActivityState.NOT_APPLICABLE,
                )
            }
            }
        } else {
        } else {
            if (entry != null) {
            if (entry != null) {
@@ -202,6 +199,15 @@ class CredentialSelectorViewModel(
        }
        }
    }
    }


    // Resets UI states for any situation that re-launches the UI
    private fun resetUiStateForReLaunch() {
        onBiometricPromptStateChange(BiometricPromptState.INACTIVE)
        uiState = uiState.copy(
            selectedEntry = null,
            providerActivityState = ProviderActivityState.NOT_APPLICABLE,
        )
    }

    fun onLastLockedAuthEntryNotFoundError() {
    fun onLastLockedAuthEntryNotFoundError() {
        Log.d(Constants.LOG_TAG, "Unable to find the last unlocked entry")
        Log.d(Constants.LOG_TAG, "Unable to find the last unlocked entry")
        onInternalError()
        onInternalError()