Merge "Add temporary system property checks in addition in addition to flag checks." into main

This commit is contained in:
Jakob Schneider
2023-12-18 13:27:15 +00:00
committed by Android (Google) Code Review
3 changed files with 6 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ private class AppButtonsPresenter(
@Composable
private fun getActionButtons(app: ApplicationInfo): List<ActionButton> = listOfNotNull(
if (featureFlags.archiving()) {
if (isArchivingEnabled(featureFlags)) {
if (app.isArchived) {
appRestoreButton.getActionButton(app)
} else {

View File

@@ -125,7 +125,7 @@ private fun AppInfoSettings(packageInfoPresenter: PackageInfoPresenter) {
title = stringResource(R.string.application_info_label),
actions = {
packageInfoState.value?.applicationInfo?.let { app ->
if (featureFlags.archiving()) TopBarAppLaunchButton(packageInfoPresenter, app)
if (isArchivingEnabled(featureFlags)) TopBarAppLaunchButton(packageInfoPresenter, app)
AppInfoSettingsMoreOptions(packageInfoPresenter, app)
}
}
@@ -174,3 +174,6 @@ private fun AppInfoSettings(packageInfoPresenter: PackageInfoPresenter) {
appInfoProvider.FooterAppVersion()
}
}
fun isArchivingEnabled(featureFlags: FeatureFlags) =
featureFlags.archiving() || "true" == System.getProperty("pm.archiving.enabled")

View File

@@ -166,7 +166,7 @@ class PackageInfoPresenter(
flags = PackageManager.MATCH_ANY_USER.toLong() or
PackageManager.MATCH_DISABLED_COMPONENTS.toLong() or
PackageManager.GET_PERMISSIONS.toLong() or
if (featureFlags.archiving()) PackageManager.MATCH_ARCHIVED_PACKAGES else 0,
if (isArchivingEnabled(featureFlags)) PackageManager.MATCH_ARCHIVED_PACKAGES else 0,
userId = userId,
)
}