From 9982ffcdba830b003bf4ad810e06c918a42cd4f0 Mon Sep 17 00:00:00 2001 From: Matthew Robertson Date: Mon, 26 Jun 2023 11:37:43 -0400 Subject: [PATCH] Comments --- .../sessions/settings/LocalOverrideSettings.kt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/firebase-sessions/src/main/kotlin/com/google/firebase/sessions/settings/LocalOverrideSettings.kt b/firebase-sessions/src/main/kotlin/com/google/firebase/sessions/settings/LocalOverrideSettings.kt index 23b650a54f2..e82950a6893 100644 --- a/firebase-sessions/src/main/kotlin/com/google/firebase/sessions/settings/LocalOverrideSettings.kt +++ b/firebase-sessions/src/main/kotlin/com/google/firebase/sessions/settings/LocalOverrideSettings.kt @@ -27,19 +27,23 @@ import kotlin.time.toDuration internal class LocalOverrideSettings(context: Context) : SettingsProvider { private val metadata = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - context.packageManager.getApplicationInfo( + context.packageManager + .getApplicationInfo( context.packageName, PackageManager.ApplicationInfoFlags.of(PackageManager.GET_META_DATA.toLong()), ) - } else { - @Suppress("DEPRECATION") // For older API levels. - context.packageManager.getApplicationInfo( + .metaData + } else { + @Suppress("DEPRECATION") // For older API levels. + context.packageManager + .getApplicationInfo( context.packageName, PackageManager.GET_META_DATA, ) - } - .metaData - ?: Bundle.EMPTY + .metaData + } + // Default to an empty bundle, meaning no cached values. + ?: Bundle.EMPTY override val sessionEnabled: Boolean? get() =