Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 029d5d34 authored by Julia Tuttle's avatar Julia Tuttle Committed by Android (Google) Code Review
Browse files

Merge "MobileConnectionsRepository: register KeyguardUpdateMonitor callback on...

Merge "MobileConnectionsRepository: register KeyguardUpdateMonitor callback on main thread" into main
parents 6c632855 e9cc8d16
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.DumpManager
import com.android.systemui.log.table.TableLogBuffer
import com.android.systemui.log.table.logDiffsForTable
@@ -99,6 +100,7 @@ constructor(
    private val context: Context,
    @Background private val bgDispatcher: CoroutineDispatcher,
    @Application private val scope: CoroutineScope,
    @Main private val mainDispatcher: CoroutineDispatcher,
    airplaneModeRepository: AirplaneModeRepository,
    // Some "wifi networks" should be rendered as a mobile connection, which is why the wifi
    // repository is an input to the mobile repository.
@@ -315,6 +317,7 @@ constructor(
                trySend(false)
                awaitClose { keyguardUpdateMonitor.removeCallback(callback) }
            }
            .flowOn(mainDispatcher)
            .logDiffsForTable(
                tableLogger,
                LOGGING_PREFIX,
+2 −1
Original line number Diff line number Diff line
@@ -131,8 +131,9 @@ class MobileRepositorySwitcherTest : SysuiTestCase() {
                mobileMappings,
                fakeBroadcastDispatcher,
                context,
                IMMEDIATE,
                /* bgDispatcher = */ IMMEDIATE,
                scope,
                /* mainDispatcher = */ IMMEDIATE,
                FakeAirplaneModeRepository(),
                wifiRepository,
                mock(),
+8 −6
Original line number Diff line number Diff line
@@ -141,8 +141,8 @@ class MobileConnectionsRepositoryTest : SysuiTestCase() {
    private val wifiPickerTrackerCallback =
        argumentCaptor<WifiPickerTracker.WifiPickerTrackerCallback>()

    private val dispatcher = StandardTestDispatcher()
    private val testScope = TestScope(dispatcher)
    private val testDispatcher = StandardTestDispatcher()
    private val testScope = TestScope(testDispatcher)

    private lateinit var underTest: MobileConnectionsRepositoryImpl

@@ -194,7 +194,7 @@ class MobileConnectionsRepositoryTest : SysuiTestCase() {
                flags,
                testScope.backgroundScope,
                mainExecutor,
                dispatcher,
                testDispatcher,
                wifiPickerTrackerFactory,
                wifiManager,
                wifiLogBuffer,
@@ -216,7 +216,7 @@ class MobileConnectionsRepositoryTest : SysuiTestCase() {
                fakeBroadcastDispatcher,
                connectivityManager,
                telephonyManager = telephonyManager,
                bgDispatcher = dispatcher,
                bgDispatcher = testDispatcher,
                logger = logger,
                mobileMappingsProxy = mobileMappings,
                scope = testScope.backgroundScope,
@@ -249,8 +249,9 @@ class MobileConnectionsRepositoryTest : SysuiTestCase() {
                mobileMappings,
                fakeBroadcastDispatcher,
                context,
                dispatcher,
                /* bgDispatcher = */ testDispatcher,
                testScope.backgroundScope,
                /* mainDispatcher = */ testDispatcher,
                airplaneModeRepository,
                wifiRepository,
                fullConnectionFactory,
@@ -1225,8 +1226,9 @@ class MobileConnectionsRepositoryTest : SysuiTestCase() {
                    mobileMappings,
                    fakeBroadcastDispatcher,
                    context,
                    dispatcher,
                    testDispatcher,
                    testScope.backgroundScope,
                    testDispatcher,
                    airplaneModeRepository,
                    wifiRepository,
                    fullConnectionFactory,