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

Commit e56123b6 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB Refactor] Cleanups in the carrier merged connection repo.

I verified that all the hard-coded values match the old pipeline
implementation, so removed that TODO and made one source of truth for
roaming.

Bug: 264684296
Bug: 238425913
Test: atest CarrierMergedConnectionRepositoryTest
Change-Id: Ia7fdd0c89f947544b9e53e01ca6558bc282b89d6
parent f57212f0
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -96,8 +96,7 @@ class CarrierMergedConnectionRepository(
            }
            .stateIn(scope, SharingStarted.WhileSubscribed(), MobileConnectionModel())

    // Carrier merged is never roaming.
    override val cdmaRoaming: StateFlow<Boolean> = MutableStateFlow(false).asStateFlow()
    override val cdmaRoaming: StateFlow<Boolean> = MutableStateFlow(ROAMING).asStateFlow()

    // TODO(b/238425913): Fetch the carrier merged network name.
    override val networkName: StateFlow<NetworkNameModel> =
@@ -129,15 +128,12 @@ class CarrierMergedConnectionRepository(
            return MobileConnectionModel(
                primaryLevel = level,
                cdmaLevel = level,
                // A [WifiNetworkModel.CarrierMerged] instance is always connected.
                // (A [WifiNetworkModel.Inactive] represents a disconnected network.)
                dataConnectionState = DataConnectionState.Connected,
                dataActivityDirection = activity,
                // Here and below: These values are always the same for every carrier-merged
                // connection.
                resolvedNetworkType = ResolvedNetworkType.CarrierMergedNetworkType,
                // Carrier merged is never roaming
                isRoaming = false,

                // TODO(b/238425913): Verify that these fields never change for carrier merged.
                dataConnectionState = DataConnectionState.Connected,
                isRoaming = ROAMING,
                isEmergencyOnly = false,
                operatorAlphaShort = null,
                isInService = true,
@@ -145,6 +141,9 @@ class CarrierMergedConnectionRepository(
                carrierNetworkChangeActive = false,
            )
        }

        // Carrier merged is never roaming
        private const val ROAMING = false
    }

    @SysUISingleton