commit 69d30dc2c0e0ab04cbb71bcc5cd445ed388726eb
parent f79b88ab020ae4759ff5deb65171a16dbd006438
Author: Titouan Thibaud <tthibaud@mozilla.com>
Date: Thu, 4 Dec 2025 00:09:25 +0000
Bug 2002287 - Create a IS_BENCHMARK_BUILD build config, initially for disabling CFRs on Macrobenchmark and Baseline Profile generation context. r=android-reviewers,Roger,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D274325
Diffstat:
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/mobile/android/fenix/app/build.gradle b/mobile/android/fenix/app/build.gradle
@@ -100,6 +100,7 @@ android {
]
buildConfigField "String[]", "SUPPORTED_LOCALE_ARRAY", getSupportedLocales()
+ buildConfigField "boolean", "IS_BENCHMARK_BUILD", "false"
}
def releaseTemplate = {
@@ -184,6 +185,7 @@ android {
applicationIdSuffix ".fenix"
signingConfig = signingConfigs.debug
debuggable false
+ buildConfigField "boolean", "IS_BENCHMARK_BUILD", "true"
}
}
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
@@ -85,12 +85,14 @@ private const val AUTOPLAY_USER_SETTING = "AUTOPLAY_USER_SETTING"
* @param appContext Reference to application context.
* @param packageName Package name of the application.
* @param packageManagerCompatHelper Helper for accessing [android.content.pm.PackageManager] methods.
+ * @param isBenchmarkBuild Boolean that will be true only when the app is built for Baseline Profile or Macrobenchmark.
*/
@Suppress("LargeClass", "TooManyFunctions")
class Settings(
private val appContext: Context,
private val packageName: String = appContext.packageName,
private val packageManagerCompatHelper: PackageManagerCompatHelper = appContext.packageManagerCompatHelper,
+ private val isBenchmarkBuild: Boolean = BuildConfig.IS_BENCHMARK_BUILD,
) : PreferencesHolder {
companion object {
const val FENIX_PREFERENCES = "fenix_preferences"