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

Commit 947f0047 authored by Helen Qin's avatar Helen Qin Committed by Automerger Merge Worker
Browse files

Merge "Updated the CredentialManager UI style." into udc-dev am: 97a4d91c

parents 14d968bf 97a4d91c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@
  <string name="accessibility_back_arrow_button">"Go back to the previous page"</string>
  <!-- Spoken content description of the close "X" icon button. -->
  <string name="accessibility_close_button">Close</string>
  <!-- Spoken content description of the close "X" icon button. [CHAR LIMIT=NONE] -->
  <string name="accessibility_snackbar_dismiss">Dismiss</string>

  <!-- Strings for the get flow. -->
  <!-- This appears as the title of the modal bottom sheet asking for user confirmation to use the single previously saved passkey to sign in to the app. [CHAR LIMIT=200] -->
+2 −4
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<resources>

  <style name="Theme.CredentialSelector" parent="@android:style/ThemeOverlay.Material">
    <item name="android:statusBarColor">@android:color/transparent</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:colorBackgroundCacheHint">@null</item>
    <item name="fontFamily">google-sans</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
    <item name="android:navigationBarColor">@android:color/transparent</item>
  </style>
</resources>
 No newline at end of file
+15 −31
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.credentialmanager

import android.app.slice.Slice
import android.app.slice.SliceSpec
import android.content.Context
import android.content.Intent
import android.credentials.CreateCredentialRequest
@@ -35,7 +33,6 @@ import android.credentials.ui.RequestInfo
import android.credentials.ui.BaseDialogResult
import android.credentials.ui.ProviderPendingIntentResponse
import android.credentials.ui.UserSelectionDialogResult
import android.net.Uri
import android.os.IBinder
import android.os.Binder
import android.os.Bundle
@@ -230,7 +227,8 @@ class CredentialManagerRepo(
                            context,
                            "key1", "subkey-1", "elisa.beckett@gmail.com",
                            20, 7, 27, Instant.ofEpochSecond(10L),
                            "Legal note"
                            "You can use your passkey on this or other devices. It is saved to " +
                                "the Password Manager for elisa.beckett@gmail.com."
                        ),
                        CreateTestUtils.newCreateEntry(
                            context,
@@ -239,11 +237,9 @@ class CredentialManagerRepo(
                            null
                        ),
                    )
                )
                .setRemoteEntry(
                    newRemoteEntry("key2", "subkey-1")
                )
                .build(),
                ).setRemoteEntry(
                    CreateTestUtils.newRemoteCreateEntry(context, "key2", "subkey-1")
                ).build(),
            CreateCredentialProviderData
                .Builder("com.dashlane")
                .setSaveEntries(
@@ -258,11 +254,11 @@ class CredentialManagerRepo(
                            context,
                            "key1", "subkey-4", "elisa.work@dashlane.com",
                            20, 7, 27, Instant.ofEpochSecond(14L),
                            null
                            "You can use your passkey on this or other devices. It is saved to " +
                                "the Password Manager for elisa.work@dashlane.com"
                        ),
                    )
                )
                .build(),
                ).build(),
        )
    }

@@ -318,7 +314,7 @@ class CredentialManagerRepo(
                        ),
                    )
                ).setRemoteEntry(
                    newRemoteEntry("key4", "subkey-1")
                    GetTestUtils.newRemoteCredentialEntry(context, "key4", "subkey-1")
                ).build(),
            GetCredentialProviderData.Builder("com.dashlane")
                .setCredentialEntries(
@@ -333,10 +329,12 @@ class CredentialManagerRepo(
                        ),
                    )
                ).setAuthenticationEntries(
                     listOf(GetTestUtils.newAuthenticationEntry(
                     listOf(
                         GetTestUtils.newAuthenticationEntry(
                             context, "key2", "subkey-1", "foo@email.com",
                         AuthenticationEntry.STATUS_UNLOCKED_BUT_EMPTY_LESS_RECENT
                     ))
                             AuthenticationEntry.STATUS_UNLOCKED_BUT_EMPTY_LESS_RECENT,
                         )
                     )
                ).setActionChips(
                    listOf(
                        GetTestUtils.newActionEntry(
@@ -348,20 +346,6 @@ class CredentialManagerRepo(
        )
    }


    private fun newRemoteEntry(
        key: String,
        subkey: String,
    ): Entry {
        return Entry(
            key,
            subkey,
            Slice.Builder(
                Uri.EMPTY, SliceSpec("type", 1)
            ).build()
        )
    }

    private fun testCreatePasskeyRequestInfo(): RequestInfo {
        val request = CreatePublicKeyCredentialRequest(
            "{\"extensions\": {\n" +
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ import com.android.credentialmanager.createflow.CreateCredentialScreen
import com.android.credentialmanager.createflow.hasContentToDisplay
import com.android.credentialmanager.getflow.GetCredentialScreen
import com.android.credentialmanager.getflow.hasContentToDisplay
import com.android.credentialmanager.ui.theme.CredentialSelectorTheme
import com.android.credentialmanager.ui.theme.PlatformTheme

@ExperimentalMaterialApi
class CredentialSelectorActivity : ComponentActivity() {
@@ -50,7 +50,7 @@ class CredentialSelectorActivity : ComponentActivity() {
            val userConfigRepo = UserConfigRepo(this)
            val credManRepo = CredentialManagerRepo(this, intent, userConfigRepo)
            setContent {
                CredentialSelectorTheme {
                PlatformTheme {
                    CredentialManagerBottomSheet(
                        credManRepo,
                        userConfigRepo
+1 −0
Original line number Diff line number Diff line
@@ -287,6 +287,7 @@ class GetFlowUtils {
                    pendingIntent = structuredAuthEntry.pendingIntent,
                    fillInIntent = entry.frameworkExtrasIntent,
                    title = title,
                    providerDisplayName = providerDisplayName,
                    icon = providerIcon,
                    isUnlockedAndEmpty = entry.status != AuthenticationEntry.STATUS_LOCKED,
                    isLastUnlocked =
Loading