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

Commit 81b2b708 authored by Arpan Kaphle's avatar Arpan Kaphle
Browse files

[Flag Removal][Remove various credman flags]

This removes the flag that covered the session id bundle passing to the UI codebase,
as well as flags used in metric bugfixes, biometrics workflows, and adding credman instant app support in the past.
This also removes the new settings ui launch flag, as well as the selector ui improvements flag.
Moving forward, this should always be the default use case. All test cases, codebase references, and
aconfig flag values were removed for these flags.

Bug: 409605772
Bug: 409609994
Bug: 409611461
Bug: 409605885
Bug: 409605016
Bug: 409604680
Test: Build test/flag removal
Flag: EXEMPT removing framework_session_id_metric_bundle, credman_biometric_api_enabled, fix_metric_duplication_emits, instant_apps_enabled, new_settings_ui_launch, selector_ui_improvements_enabled
Change-Id: I63d85db0b40bcde89cf619c3328ca5822bedf7ba
parent 2638d5a3
Loading
Loading
Loading
Loading
+0 −48
Original line number Diff line number Diff line
@@ -29,13 +29,6 @@ flag {
    bug: "300014059"
}

flag {
    namespace: "credential_manager"
    name: "instant_apps_enabled"
    description: "Enables Credential Manager to work with Instant Apps"
    bug: "302190269"
}

flag {
    namespace: "credential_manager"
    name: "clear_session_enabled"
@@ -51,20 +44,6 @@ flag {
    bug: "307587989"
}

flag {
    namespace: "credential_manager"
    name: "new_settings_ui"
    description: "Enables new settings UI for VIC"
    bug: "315209085"
}

flag {
    namespace: "credential_manager"
    name: "selector_ui_improvements_enabled"
    description: "Enables Credential Selector UI improvements for VIC"
    bug: "319448437"
}

flag {
    namespace: "credential_manager"
    name: "configurable_selector_ui_enabled"
@@ -74,13 +53,6 @@ flag {
    is_exported: true
}

flag {
    namespace: "credential_manager"
    name: "credman_biometric_api_enabled"
    description: "Enables Credential Manager to work with the Biometric Authenticate API"
    bug: "323211850"
}

flag {
    namespace: "wear_frameworks"
    name: "wear_credential_manager_enabled"
@@ -95,16 +67,6 @@ flag {
    bug: "324291187"
}

flag {
    namespace: "credential_manager"
    name: "framework_session_id_metric_bundle"
    description: "Enables the session_id to be passed across to the UI logs"
    bug: "379880133"
    metadata {
            purpose: PURPOSE_BUGFIX
        }
}

flag {
    namespace: "credential_manager"
    name: "clear_credentials_fix_enabled"
@@ -146,16 +108,6 @@ flag {
    }
}

flag {
    namespace: "credential_manager"
    name: "fix_metric_duplication_emits"
    description: "Fixes duplicate emits in the original metric emit system."
    bug: "362994633"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    namespace: "credential_manager"
    name: "safeguard_candidate_credentials_api_caller"
+2 −17
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.content.Context
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.credentials.Credential
import android.credentials.flags.Flags
import android.credentials.selection.AuthenticationEntry
import android.credentials.selection.Entry
import android.credentials.selection.GetCredentialProviderData
@@ -362,14 +361,7 @@ private fun getServiceLabelAndIcon(
        // Test data has only package name not component name.
        // For test data usage only.
        try {
            val pkgInfo = if (Flags.instantAppsEnabled()) {
                getPackageInfo(pm, providerFlattenedComponentName)
            } else {
                pm.getPackageInfo(
                    providerFlattenedComponentName,
                    PackageManager.PackageInfoFlags.of(0)
                )
            }
            val pkgInfo = getPackageInfo(pm, providerFlattenedComponentName)
            val applicationInfo = checkNotNull(pkgInfo.applicationInfo)
            providerLabel =
                applicationInfo.loadSafeLabel(
@@ -393,14 +385,7 @@ private fun getServiceLabelAndIcon(
            // Added for mdoc use case where the provider may not need to register a service and
            // instead only relies on the registration api.
            try {
                val pkgInfo = if (Flags.instantAppsEnabled()) {
                    getPackageInfo(pm, providerFlattenedComponentName)
                } else {
                    pm.getPackageInfo(
                        component.packageName,
                        PackageManager.PackageInfoFlags.of(0)
                    )
                }
                val pkgInfo = getPackageInfo(pm, providerFlattenedComponentName)
                val applicationInfo = checkNotNull(pkgInfo.applicationInfo)
                providerLabel =
                    applicationInfo.loadSafeLabel(
+3 −22
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ import androidx.credentials.PublicKeyCredential
import androidx.credentials.provider.CreateEntry
import androidx.credentials.provider.RemoteEntry
import org.json.JSONObject
import android.credentials.flags.Flags
import com.android.credentialmanager.createflow.isBiometricFlow
import com.android.credentialmanager.createflow.isFlowAutoSelectable
import com.android.credentialmanager.getflow.TopBrandingContent
@@ -63,11 +62,7 @@ fun getAppLabel(
    appPackageName: String
): String? {
    return try {
        val pkgInfo = if (Flags.instantAppsEnabled()) {
            getPackageInfo(pm, appPackageName)
        } else {
            pm.getPackageInfo(appPackageName, PackageManager.PackageInfoFlags.of(0))
        }
        val pkgInfo = getPackageInfo(pm, appPackageName)
        val applicationInfo = checkNotNull(pkgInfo.applicationInfo)
        applicationInfo.loadSafeLabel(
            pm, 0f,
@@ -90,14 +85,7 @@ private fun getServiceLabelAndIcon(
        // Test data has only package name not component name.
        // For test data usage only.
        try {
            val pkgInfo = if (Flags.instantAppsEnabled()) {
                getPackageInfo(pm, providerFlattenedComponentName)
            } else {
                pm.getPackageInfo(
                        providerFlattenedComponentName,
                        PackageManager.PackageInfoFlags.of(0)
                )
            }
            val pkgInfo = getPackageInfo(pm, providerFlattenedComponentName)
            val applicationInfo = checkNotNull(pkgInfo.applicationInfo)
            providerLabel =
                applicationInfo.loadSafeLabel(
@@ -121,14 +109,7 @@ private fun getServiceLabelAndIcon(
            // Added for mdoc use case where the provider may not need to register a service and
            // instead only relies on the registration api.
            try {
                val pkgInfo = if (Flags.instantAppsEnabled()) {
                    getPackageInfo(pm, providerFlattenedComponentName)
                } else {
                    pm.getPackageInfo(
                            component.packageName,
                            PackageManager.PackageInfoFlags.of(0)
                    )
                }
                val pkgInfo = getPackageInfo(pm, providerFlattenedComponentName)
                val applicationInfo = checkNotNull(pkgInfo.applicationInfo)
                providerLabel =
                    applicationInfo.loadSafeLabel(
+24 −66
Original line number Diff line number Diff line
@@ -16,9 +16,7 @@

package com.android.credentialmanager.common.ui

import android.credentials.flags.Flags
import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxWidth
@@ -28,17 +26,10 @@ import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import com.android.compose.rememberSystemUiController
import androidx.compose.ui.unit.dp
import com.android.credentialmanager.common.material.ModalBottomSheetLayout
import com.android.credentialmanager.common.material.ModalBottomSheetValue
import com.android.credentialmanager.common.material.rememberModalBottomSheetState
import com.android.credentialmanager.ui.theme.EntryShape
import kotlinx.coroutines.launch

/** Draws a modal bottom sheet with the same styles and effects shared by various flows. */
@Composable
@@ -50,7 +41,6 @@ fun ModalBottomSheet(
        onInitialRenderComplete: () -> Unit,
        isAutoSelectFlow: Boolean,
) {
    if (Flags.selectorUiImprovementsEnabled()) {
    val state = androidx.compose.material3.rememberModalBottomSheetState(
            skipPartiallyExpanded = true
    )
@@ -76,36 +66,4 @@ fun ModalBottomSheet(
            // for exiting and viewing the underlying app to help a user gain context.
            modifier = Modifier.padding(top = 72.dp),
    )
    } else {
        val scope = rememberCoroutineScope()
        val state = rememberModalBottomSheetState(
                initialValue = if (isAutoSelectFlow) ModalBottomSheetValue.Expanded
                else ModalBottomSheetValue.Hidden,
                skipHalfExpanded = true
        )
        val sysUiController = rememberSystemUiController()
        if (state.targetValue == ModalBottomSheetValue.Hidden || isAutoSelectFlow) {
            setTransparentSystemBarsColor(sysUiController)
        } else {
            setBottomSheetSystemBarsColor(sysUiController)
        }
        ModalBottomSheetLayout(
                sheetBackgroundColor = MaterialTheme.colorScheme.surfaceBright,
                modifier = Modifier.background(Color.Transparent),
                sheetState = state,
                sheetContent = { sheetContent() },
                sheetShape = EntryShape.TopRoundedCorner,
        ) {}
        LaunchedEffect(state.currentValue, state.targetValue) {
            if (state.currentValue == ModalBottomSheetValue.Hidden) {
                if (isInitialRender) {
                    onInitialRenderComplete()
                    scope.launch { state.show() }
                } else if (state.targetValue == ModalBottomSheetValue.Hidden) {
                    // Only dismiss ui when the motion is downwards
                    onDismiss()
                }
            }
        }
    }
}
+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.credentialmanager.common.ui

import android.credentials.flags.Flags
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.WindowInsets
@@ -64,7 +63,7 @@ fun SheetContainerCard(
            modifier = Modifier.padding(
                start = 24.dp,
                end = 24.dp,
                bottom = if (Flags.selectorUiImprovementsEnabled()) 8.dp else 18.dp,
                bottom = 8.dp,
                top = if (topAppBar == null) 24.dp else 0.dp
            ).fillMaxWidth().wrapContentHeight(),
            horizontalAlignment = Alignment.CenterHorizontally,
Loading