From fefb9a945a9e00e0cc441416a0aa5722e2cdeb94 Mon Sep 17 00:00:00 2001 From: Evan Laird Date: Wed, 10 May 2023 16:37:13 +0000 Subject: [PATCH] Revert^2 "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: Idd766a5378d8deebe50bafe1d564635187ab30ee --- .../pipeline/mobile/data/repository/MobileRepositorySwitcher.kt | 2 ++ .../pipeline/wifi/data/repository/WifiRepositorySwitcher.kt | 2 ++ 2 files changed, 4 insertions(+) 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 eb20bba0d21f0..991ff56e683ca 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 b1296179d7f76..e96288ab9ef9f 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(