Skip to content

Commit b8e6e76

Browse files
committed
Inline the definition of metadata to avoid needing an empty block
1 parent f222f38 commit b8e6e76

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/settings/LocalOverrideSettings.kt

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,21 @@ import kotlin.time.DurationUnit
2525
import kotlin.time.toDuration
2626

2727
internal class LocalOverrideSettings(context: Context) : SettingsProvider {
28-
private val metadata: Bundle
29-
30-
init {
31-
metadata =
32-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
33-
context.packageManager.getApplicationInfo(
34-
context.packageName,
35-
PackageManager.ApplicationInfoFlags.of(PackageManager.GET_META_DATA.toLong()),
36-
)
37-
} else {
38-
@Suppress("DEPRECATION") // For older API levels.
39-
context.packageManager.getApplicationInfo(
40-
context.packageName,
41-
PackageManager.GET_META_DATA,
42-
)
43-
}
44-
.metaData
45-
?: Bundle.EMPTY
46-
}
28+
private val metadata =
29+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
30+
context.packageManager.getApplicationInfo(
31+
context.packageName,
32+
PackageManager.ApplicationInfoFlags.of(PackageManager.GET_META_DATA.toLong()),
33+
)
34+
} else {
35+
@Suppress("DEPRECATION") // For older API levels.
36+
context.packageManager.getApplicationInfo(
37+
context.packageName,
38+
PackageManager.GET_META_DATA,
39+
)
40+
}
41+
.metaData
42+
?: Bundle.EMPTY
4743

4844
override val sessionEnabled: Boolean?
4945
get() =

firebase-sessions/src/main/kotlin/com/google/firebase/sessions/settings/SessionsSettings.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ internal class SessionsSettings(
5151
),
5252
dataStore = context.dataStore,
5353
),
54-
) {
55-
// This is a load-bearing empty block.
56-
// See go/load-bearing-empty-block for more details.
57-
}
54+
)
5855

5956
// Order of preference for all the configs below:
6057
// 1. Honor local overrides

0 commit comments

Comments
 (0)