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

Commit 6d6440c1 authored by Helen Qin's avatar Helen Qin Committed by Automerger Merge Worker
Browse files

Merge "Fix potential IllegalArgumentException from the auto-select flow." into...

Merge "Fix potential IllegalArgumentException from the auto-select flow." into udc-dev am: 1b1fe073 am: 4711e5f3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23128346



Change-Id: Ie193a6ae6e2b2a9bb701d0a6a3c76d90f6b5e5be
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 00190e3f 4711e5f3
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.core.graphics.drawable.toBitmap
import com.android.credentialmanager.CredentialSelectorViewModel
@@ -50,6 +51,7 @@ import com.android.credentialmanager.R
import com.android.credentialmanager.common.BaseEntry
import com.android.credentialmanager.common.CredentialType
import com.android.credentialmanager.common.ProviderActivityState
import com.android.credentialmanager.common.material.ModalBottomSheetDefaults
import com.android.credentialmanager.common.ui.ActionButton
import com.android.credentialmanager.common.ui.BodyMediumText
import com.android.credentialmanager.common.ui.BodySmallText
@@ -148,6 +150,13 @@ fun CreateCredentialScreen(
                    }
                }
                ProviderActivityState.READY_TO_LAUNCH -> {
                    // This is a native bug from ModalBottomSheet. For now, use the temporary
                    // solution of not having an empty state.
                    if (viewModel.uiState.isAutoSelectFlow) {
                        Divider(
                            thickness = Dp.Hairline, color = ModalBottomSheetDefaults.scrimColor
                        )
                    }
                    // Launch only once per providerActivityState change so that the provider
                    // UI will not be accidentally launched twice.
                    LaunchedEffect(viewModel.uiState.providerActivityState) {
@@ -158,6 +167,11 @@ fun CreateCredentialScreen(
                                    .CREDMAN_CREATE_CRED_PROVIDER_ACTIVITY_READY_TO_LAUNCH)
                }
                ProviderActivityState.PENDING -> {
                    if (viewModel.uiState.isAutoSelectFlow) {
                        Divider(
                            thickness = Dp.Hairline, color = ModalBottomSheetDefaults.scrimColor
                        )
                    }
                    // Hide our content when the provider activity is active.
                    viewModel.uiMetrics.log(
                            CreateCredentialEvent.CREDMAN_CREATE_CRED_PROVIDER_ACTIVITY_PENDING)
+14 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextLayoutResult
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.core.graphics.drawable.toBitmap
import com.android.credentialmanager.CredentialSelectorViewModel
@@ -50,6 +51,7 @@ import com.android.credentialmanager.R
import com.android.credentialmanager.common.BaseEntry
import com.android.credentialmanager.common.CredentialType
import com.android.credentialmanager.common.ProviderActivityState
import com.android.credentialmanager.common.material.ModalBottomSheetDefaults
import com.android.credentialmanager.common.ui.ActionButton
import com.android.credentialmanager.common.ui.ActionEntry
import com.android.credentialmanager.common.ui.ConfirmButton
@@ -132,6 +134,13 @@ fun GetCredentialScreen(
                        }
                    }
                    ProviderActivityState.READY_TO_LAUNCH -> {
                        // This is a native bug from ModalBottomSheet. For now, use the temporary
                        // solution of not having an empty state.
                        if (viewModel.uiState.isAutoSelectFlow) {
                            Divider(
                                thickness = Dp.Hairline, color = ModalBottomSheetDefaults.scrimColor
                            )
                        }
                        // Launch only once per providerActivityState change so that the provider
                        // UI will not be accidentally launched twice.
                        LaunchedEffect(viewModel.uiState.providerActivityState) {
@@ -141,6 +150,11 @@ fun GetCredentialScreen(
                                .CREDMAN_GET_CRED_PROVIDER_ACTIVITY_READY_TO_LAUNCH)
                    }
                    ProviderActivityState.PENDING -> {
                        if (viewModel.uiState.isAutoSelectFlow) {
                            Divider(
                                thickness = Dp.Hairline, color = ModalBottomSheetDefaults.scrimColor
                            )
                        }
                        // Hide our content when the provider activity is active.
                        viewModel.uiMetrics.log(GetCredentialEvent
                                .CREDMAN_GET_CRED_PROVIDER_ACTIVITY_PENDING)