summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Evan Laird <evanlaird@google.com> 2023-05-03 19:10:55 -0400
committer Evan Laird <evanlaird@google.com> 2023-05-08 12:53:41 -0400
commit27617f810f675ab351869bbcbbfeb881be2b35fd (patch)
treee98b897e3b25b3c1e341769c30a1f7027c315825
parent13edac415d4f99db37359145fecd0146df092d5d (diff)
Add @SysUISingleton to repository switcher classes
The Mobile and WiFi repository switcher classes never got the annotation to be created as a SysUISingleton. This is probably a mistake caused by the way we had been providing them; By using a @Binds method on the StatusBarPipelineModule, it was not immediately obvious that the classes were not singletons. But believe me, they should be singletons. Test: manually determined that there is only 1 Mobile and Wifi switcher instantiated Test: CarrierTextManagerLog gets current info when airplane mode switches Test: manually verified that the "Wi-Fi Calling" text shows when in airplane mode Fixes: 278254374 Change-Id: Ifdb5c4b2977020f6ab349b97cfe286c7acbedaa9 Change-Id: If2d87039042fb0a2d3bec42efb1d2d45fa015c04
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcher.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepositorySwitcher.kt2
2 files changed, 4 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcher.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcher.kt
index eb20bba0d21f..991ff56e683c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcher.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcher.kt
@@ -21,6 +21,7 @@ import androidx.annotation.VisibleForTesting
import com.android.settingslib.SignalIcon
import com.android.settingslib.mobile.MobileMappings
import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow
+import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.demomode.DemoMode
import com.android.systemui.demomode.DemoModeController
@@ -62,6 +63,7 @@ import kotlinx.coroutines.flow.stateIn
*/
@Suppress("EXPERIMENTAL_IS_NOT_ENABLED")
@OptIn(ExperimentalCoroutinesApi::class)
+@SysUISingleton
class MobileRepositorySwitcher
@Inject
constructor(
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepositorySwitcher.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepositorySwitcher.kt
index b1296179d7f7..e96288ab9ef9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepositorySwitcher.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepositorySwitcher.kt
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.pipeline.wifi.data.repository
import android.os.Bundle
import androidx.annotation.VisibleForTesting
import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow
+import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.demomode.DemoMode
import com.android.systemui.demomode.DemoModeController
@@ -54,6 +55,7 @@ import kotlinx.coroutines.flow.stateIn
*/
@Suppress("EXPERIMENTAL_IS_NOT_ENABLED")
@OptIn(ExperimentalCoroutinesApi::class)
+@SysUISingleton
class WifiRepositorySwitcher
@Inject
constructor(