Merge "Initialize preference key before use." into androidx-main
diff --git a/core/core-performance-play-services/src/main/java/androidx/core/performance/play/services/PlayServicesDevicePerformance.kt b/core/core-performance-play-services/src/main/java/androidx/core/performance/play/services/PlayServicesDevicePerformance.kt
index 83977dd..72c5cb2 100644
--- a/core/core-performance-play-services/src/main/java/androidx/core/performance/play/services/PlayServicesDevicePerformance.kt
+++ b/core/core-performance-play-services/src/main/java/androidx/core/performance/play/services/PlayServicesDevicePerformance.kt
@@ -52,6 +52,7 @@
     private val tag = "PlayServicesDevicePerformance"
 
     private val defaultMpc = DefaultDevicePerformance()
+    private val mpcKey = intPreferencesKey(MPC_PREFERENCE_KEY)
 
     override val mediaPerformanceClass get() = lazyMpc.value
     private val lazyMpc =
@@ -87,8 +88,6 @@
             produceFile = { context.preferencesDataStoreFile("media_performance_class") })
     )
 
-    private val mpcKey = intPreferencesKey(MPC_PREFERENCE_KEY)
-
     private fun getPerformanceClass(): Flow<Int?> {
         return performanceStore.data.map { values ->
             // No type safety.