Add temporary system property checks in addition in addition to flag checks.

This was agreed on to enable dogfood testing on P9 without enabling the full
feature in QPR3. https://docs.google.com/document/d/1ZItkXfyKO2e235-EdisHASE6Dcl2hqATnieo6aJrsbY/edit?tab=t.0#bookmark=id.64wdrt989i3r

Test: manual
Bug: 315461548
Change-Id: I2ef71fd40d4afb83b9b73a977856e2912a5c87be
This commit is contained in:
Jakob Schneider
2023-12-15 13:23:10 +00:00
parent 007ef134b6
commit e06d787e2a
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,
)
}