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

Commit a8ad9d9b authored by Evan Laird's avatar Evan Laird Committed by Automerger Merge Worker
Browse files

Merge changes I61f450fa,I4981e641,I8b62ae33 into tm-qpr-dev am: dec282b8 am: afdb8b14

parents ad6d0f29 afdb8b14
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -24,9 +24,11 @@ import android.telephony.TelephonyManager.DATA_HANDOVER_IN_PROGRESS
import android.telephony.TelephonyManager.DATA_SUSPENDED
import android.telephony.TelephonyManager.DATA_UNKNOWN
import android.telephony.TelephonyManager.DataState
import com.android.systemui.log.table.Diffable
import com.android.systemui.log.table.TableRowLogger

/** Internal enum representation of the telephony data connection states */
enum class DataConnectionState {
enum class DataConnectionState : Diffable<DataConnectionState> {
    Connected,
    Connecting,
    Disconnected,
@@ -34,7 +36,17 @@ enum class DataConnectionState {
    Suspended,
    HandoverInProgress,
    Unknown,
    Invalid,
    Invalid;

    override fun logDiffs(prevVal: DataConnectionState, row: TableRowLogger) {
        if (prevVal != this) {
            row.logChange(COL_CONNECTION_STATE, name)
        }
    }

    companion object {
        private const val COL_CONNECTION_STATE = "connectionState"
    }
}

fun @receiver:DataState Int.toDataConnectionType(): DataConnectionState =
+0 −176
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.statusbar.pipeline.mobile.data.model

import android.annotation.IntRange
import android.telephony.CellSignalStrength
import android.telephony.TelephonyCallback.CarrierNetworkListener
import android.telephony.TelephonyCallback.DataActivityListener
import android.telephony.TelephonyCallback.DataConnectionStateListener
import android.telephony.TelephonyCallback.DisplayInfoListener
import android.telephony.TelephonyCallback.ServiceStateListener
import android.telephony.TelephonyCallback.SignalStrengthsListener
import android.telephony.TelephonyDisplayInfo
import android.telephony.TelephonyManager
import androidx.annotation.VisibleForTesting
import com.android.systemui.log.table.Diffable
import com.android.systemui.log.table.TableRowLogger
import com.android.systemui.statusbar.pipeline.mobile.data.model.DataConnectionState.Disconnected
import com.android.systemui.statusbar.pipeline.shared.data.model.DataActivityModel

/**
 * Data class containing all of the relevant information for a particular line of service, known as
 * a Subscription in the telephony world. These models are the result of a single telephony listener
 * which has many callbacks which each modify some particular field on this object.
 *
 * The design goal here is to de-normalize fields from the system into our model fields below. So
 * any new field that needs to be tracked should be copied into this data class rather than
 * threading complex system objects through the pipeline.
 */
data class MobileConnectionModel(
    /** Fields below are from [ServiceStateListener.onServiceStateChanged] */
    val isEmergencyOnly: Boolean = false,
    val isRoaming: Boolean = false,
    /**
     * See [android.telephony.ServiceState.getOperatorAlphaShort], this value is defined as the
     * current registered operator name in short alphanumeric format. In some cases this name might
     * be preferred over other methods of calculating the network name
     */
    val operatorAlphaShort: String? = null,

    /**
     * TODO (b/263167683): Clarify this field
     *
     * This check comes from [com.android.settingslib.Utils.isInService]. It is intended to be a
     * mapping from a ServiceState to a notion of connectivity. Notably, it will consider a
     * connection to be in-service if either the voice registration state is IN_SERVICE or the data
     * registration state is IN_SERVICE and NOT IWLAN.
     */
    val isInService: Boolean = false,

    /** Fields below from [SignalStrengthsListener.onSignalStrengthsChanged] */
    val isGsm: Boolean = false,
    @IntRange(from = 0, to = 4)
    val cdmaLevel: Int = CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN,
    @IntRange(from = 0, to = 4)
    val primaryLevel: Int = CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN,

    /** Fields below from [DataConnectionStateListener.onDataConnectionStateChanged] */
    val dataConnectionState: DataConnectionState = Disconnected,

    /**
     * Fields below from [DataActivityListener.onDataActivity]. See [TelephonyManager] for the
     * values
     */
    val dataActivityDirection: DataActivityModel =
        DataActivityModel(
            hasActivityIn = false,
            hasActivityOut = false,
        ),

    /** Fields below from [CarrierNetworkListener.onCarrierNetworkChange] */
    val carrierNetworkChangeActive: Boolean = false,

    /** Fields below from [DisplayInfoListener.onDisplayInfoChanged]. */

    /**
     * [resolvedNetworkType] is the [TelephonyDisplayInfo.getOverrideNetworkType] if it exists or
     * [TelephonyDisplayInfo.getNetworkType]. This is used to look up the proper network type icon
     */
    val resolvedNetworkType: ResolvedNetworkType = ResolvedNetworkType.UnknownNetworkType,
) : Diffable<MobileConnectionModel> {
    override fun logDiffs(prevVal: MobileConnectionModel, row: TableRowLogger) {
        if (prevVal.dataConnectionState != dataConnectionState) {
            row.logChange(COL_CONNECTION_STATE, dataConnectionState.name)
        }

        if (prevVal.isEmergencyOnly != isEmergencyOnly) {
            row.logChange(COL_EMERGENCY, isEmergencyOnly)
        }

        if (prevVal.isRoaming != isRoaming) {
            row.logChange(COL_ROAMING, isRoaming)
        }

        if (prevVal.operatorAlphaShort != operatorAlphaShort) {
            row.logChange(COL_OPERATOR, operatorAlphaShort)
        }

        if (prevVal.isInService != isInService) {
            row.logChange(COL_IS_IN_SERVICE, isInService)
        }

        if (prevVal.isGsm != isGsm) {
            row.logChange(COL_IS_GSM, isGsm)
        }

        if (prevVal.cdmaLevel != cdmaLevel) {
            row.logChange(COL_CDMA_LEVEL, cdmaLevel)
        }

        if (prevVal.primaryLevel != primaryLevel) {
            row.logChange(COL_PRIMARY_LEVEL, primaryLevel)
        }

        if (prevVal.dataActivityDirection.hasActivityIn != dataActivityDirection.hasActivityIn) {
            row.logChange(COL_ACTIVITY_DIRECTION_IN, dataActivityDirection.hasActivityIn)
        }

        if (prevVal.dataActivityDirection.hasActivityOut != dataActivityDirection.hasActivityOut) {
            row.logChange(COL_ACTIVITY_DIRECTION_OUT, dataActivityDirection.hasActivityOut)
        }

        if (prevVal.carrierNetworkChangeActive != carrierNetworkChangeActive) {
            row.logChange(COL_CARRIER_NETWORK_CHANGE, carrierNetworkChangeActive)
        }

        if (prevVal.resolvedNetworkType != resolvedNetworkType) {
            row.logChange(COL_RESOLVED_NETWORK_TYPE, resolvedNetworkType.toString())
        }
    }

    override fun logFull(row: TableRowLogger) {
        row.logChange(COL_CONNECTION_STATE, dataConnectionState.name)
        row.logChange(COL_EMERGENCY, isEmergencyOnly)
        row.logChange(COL_ROAMING, isRoaming)
        row.logChange(COL_OPERATOR, operatorAlphaShort)
        row.logChange(COL_IS_IN_SERVICE, isInService)
        row.logChange(COL_IS_GSM, isGsm)
        row.logChange(COL_CDMA_LEVEL, cdmaLevel)
        row.logChange(COL_PRIMARY_LEVEL, primaryLevel)
        row.logChange(COL_ACTIVITY_DIRECTION_IN, dataActivityDirection.hasActivityIn)
        row.logChange(COL_ACTIVITY_DIRECTION_OUT, dataActivityDirection.hasActivityOut)
        row.logChange(COL_CARRIER_NETWORK_CHANGE, carrierNetworkChangeActive)
        row.logChange(COL_RESOLVED_NETWORK_TYPE, resolvedNetworkType.toString())
    }

    @VisibleForTesting
    companion object {
        const val COL_EMERGENCY = "EmergencyOnly"
        const val COL_ROAMING = "Roaming"
        const val COL_OPERATOR = "OperatorName"
        const val COL_IS_IN_SERVICE = "IsInService"
        const val COL_IS_GSM = "IsGsm"
        const val COL_CDMA_LEVEL = "CdmaLevel"
        const val COL_PRIMARY_LEVEL = "PrimaryLevel"
        const val COL_CONNECTION_STATE = "ConnectionState"
        const val COL_ACTIVITY_DIRECTION_IN = "DataActivity.In"
        const val COL_ACTIVITY_DIRECTION_OUT = "DataActivity.Out"
        const val COL_CARRIER_NETWORK_CHANGE = "CarrierNetworkChangeActive"
        const val COL_RESOLVED_NETWORK_TYPE = "NetworkType"
    }
}
+20 −2
Original line number Diff line number Diff line
@@ -17,8 +17,12 @@
package com.android.systemui.statusbar.pipeline.mobile.data.model

import android.telephony.Annotation.NetworkType
import android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN
import com.android.settingslib.SignalIcon
import com.android.settingslib.mobile.MobileMappings
import com.android.settingslib.mobile.TelephonyIcons
import com.android.systemui.log.table.Diffable
import com.android.systemui.log.table.TableRowLogger
import com.android.systemui.statusbar.pipeline.mobile.util.MobileMappingsProxy

/**
@@ -26,11 +30,19 @@ import com.android.systemui.statusbar.pipeline.mobile.util.MobileMappingsProxy
 * on whether or not the display info contains an override type, we may have to call different
 * methods on [MobileMappingsProxy] to generate an icon lookup key.
 */
sealed interface ResolvedNetworkType {
sealed interface ResolvedNetworkType : Diffable<ResolvedNetworkType> {
    val lookupKey: String

    override fun logDiffs(prevVal: ResolvedNetworkType, row: TableRowLogger) {
        if (prevVal != this) {
            row.logChange(COL_NETWORK_TYPE, this.toString())
        }
    }

    object UnknownNetworkType : ResolvedNetworkType {
        override val lookupKey: String = "unknown"
        override val lookupKey: String = MobileMappings.toIconKey(NETWORK_TYPE_UNKNOWN)

        override fun toString(): String = "Unknown"
    }

    data class DefaultNetworkType(
@@ -47,5 +59,11 @@ sealed interface ResolvedNetworkType {
        override val lookupKey: String = "cwf"

        val iconGroupOverride: SignalIcon.MobileIconGroup = TelephonyIcons.CARRIER_MERGED_WIFI

        override fun toString(): String = "CarrierMerged"
    }

    companion object {
        private const val COL_NETWORK_TYPE = "networkType"
    }
}
+52 −5
Original line number Diff line number Diff line
@@ -17,11 +17,12 @@
package com.android.systemui.statusbar.pipeline.mobile.data.repository

import android.telephony.SubscriptionInfo
import android.telephony.TelephonyCallback
import android.telephony.TelephonyManager
import com.android.systemui.log.table.TableLogBuffer
import com.android.systemui.statusbar.pipeline.mobile.data.model.MobileConnectionModel
import com.android.systemui.statusbar.pipeline.mobile.data.model.DataConnectionState
import com.android.systemui.statusbar.pipeline.mobile.data.model.NetworkNameModel
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType
import com.android.systemui.statusbar.pipeline.shared.data.model.DataActivityModel
import kotlinx.coroutines.flow.StateFlow

/**
@@ -45,11 +46,57 @@ interface MobileConnectionRepository {
     */
    val tableLogBuffer: TableLogBuffer

    /** True if the [android.telephony.ServiceState] says this connection is emergency calls only */
    val isEmergencyOnly: StateFlow<Boolean>

    /** True if [android.telephony.ServiceState] says we are roaming */
    val isRoaming: StateFlow<Boolean>

    /**
     * See [android.telephony.ServiceState.getOperatorAlphaShort], this value is defined as the
     * current registered operator name in short alphanumeric format. In some cases this name might
     * be preferred over other methods of calculating the network name
     */
    val operatorAlphaShort: StateFlow<String?>

    /**
     * TODO (b/263167683): Clarify this field
     *
     * This check comes from [com.android.settingslib.Utils.isInService]. It is intended to be a
     * mapping from a ServiceState to a notion of connectivity. Notably, it will consider a
     * connection to be in-service if either the voice registration state is IN_SERVICE or the data
     * registration state is IN_SERVICE and NOT IWLAN.
     */
    val isInService: StateFlow<Boolean>

    /** True if [android.telephony.SignalStrength] told us that this connection is using GSM */
    val isGsm: StateFlow<Boolean>

    /**
     * There is still specific logic in the pipeline that calls out CDMA level explicitly. This
     * field is not completely orthogonal to [primaryLevel], because CDMA could be primary.
     */
    // @IntRange(from = 0, to = 4)
    val cdmaLevel: StateFlow<Int>

    /** [android.telephony.SignalStrength]'s concept of the overall signal level */
    // @IntRange(from = 0, to = 4)
    val primaryLevel: StateFlow<Int>

    /** The current data connection state. See [DataConnectionState] */
    val dataConnectionState: StateFlow<DataConnectionState>

    /** The current data activity direction. See [DataActivityModel] */
    val dataActivityDirection: StateFlow<DataActivityModel>

    /** True if there is currently a carrier network change in process */
    val carrierNetworkChangeActive: StateFlow<Boolean>

    /**
     * A flow that aggregates all necessary callbacks from [TelephonyCallback] into a single
     * listener + model.
     * [resolvedNetworkType] is the [TelephonyDisplayInfo.getOverrideNetworkType] if it exists or
     * [TelephonyDisplayInfo.getNetworkType]. This is used to look up the proper network type icon
     */
    val connectionInfo: StateFlow<MobileConnectionModel>
    val resolvedNetworkType: StateFlow<ResolvedNetworkType>

    /** The total number of levels. Used with [SignalDrawable]. */
    val numberOfLevels: StateFlow<Int>
+231 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.statusbar.pipeline.mobile.data.repository.demo

import android.telephony.CellSignalStrength
import android.telephony.TelephonyManager
import com.android.systemui.log.table.TableLogBuffer
import com.android.systemui.log.table.logDiffsForTable
import com.android.systemui.statusbar.pipeline.mobile.data.model.DataConnectionState
import com.android.systemui.statusbar.pipeline.mobile.data.model.NetworkNameModel
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType
import com.android.systemui.statusbar.pipeline.mobile.data.repository.MobileConnectionRepository
import com.android.systemui.statusbar.pipeline.mobile.data.repository.demo.model.FakeNetworkEventModel
import com.android.systemui.statusbar.pipeline.mobile.data.repository.prod.FullMobileConnectionRepository.Companion.COL_CARRIER_NETWORK_CHANGE
import com.android.systemui.statusbar.pipeline.mobile.data.repository.prod.FullMobileConnectionRepository.Companion.COL_CDMA_LEVEL
import com.android.systemui.statusbar.pipeline.mobile.data.repository.prod.FullMobileConnectionRepository.Companion.COL_EMERGENCY
import com.android.systemui.statusbar.pipeline.mobile.data.repository.prod.FullMobileConnectionRepository.Companion.COL_IS_GSM
import com.android.systemui.statusbar.pipeline.mobile.data.repository.prod.FullMobileConnectionRepository.Companion.COL_IS_IN_SERVICE
import com.android.systemui.statusbar.pipeline.mobile.data.repository.prod.FullMobileConnectionRepository.Companion.COL_OPERATOR
import com.android.systemui.statusbar.pipeline.mobile.data.repository.prod.FullMobileConnectionRepository.Companion.COL_PRIMARY_LEVEL
import com.android.systemui.statusbar.pipeline.mobile.data.repository.prod.FullMobileConnectionRepository.Companion.COL_ROAMING
import com.android.systemui.statusbar.pipeline.shared.data.model.DataActivityModel
import com.android.systemui.statusbar.pipeline.shared.data.model.toMobileDataActivityModel
import com.android.systemui.statusbar.pipeline.wifi.data.repository.demo.model.FakeWifiEventModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.stateIn

/**
 * Demo version of [MobileConnectionRepository]. Note that this class shares all of its flows using
 * [SharingStarted.WhileSubscribed()] to give the same semantics as using a regular
 * [MutableStateFlow] while still logging all of the inputs in the same manor as the production
 * repos.
 */
class DemoMobileConnectionRepository(
    override val subId: Int,
    override val tableLogBuffer: TableLogBuffer,
    val scope: CoroutineScope,
) : MobileConnectionRepository {
    private val _isEmergencyOnly = MutableStateFlow(false)
    override val isEmergencyOnly =
        _isEmergencyOnly
            .logDiffsForTable(
                tableLogBuffer,
                columnPrefix = "",
                columnName = COL_EMERGENCY,
                _isEmergencyOnly.value
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), _isEmergencyOnly.value)

    private val _isRoaming = MutableStateFlow(false)
    override val isRoaming =
        _isRoaming
            .logDiffsForTable(
                tableLogBuffer,
                columnPrefix = "",
                columnName = COL_ROAMING,
                _isRoaming.value
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), _isRoaming.value)

    private val _operatorAlphaShort: MutableStateFlow<String?> = MutableStateFlow(null)
    override val operatorAlphaShort =
        _operatorAlphaShort
            .logDiffsForTable(
                tableLogBuffer,
                columnPrefix = "",
                columnName = COL_OPERATOR,
                _operatorAlphaShort.value
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), _operatorAlphaShort.value)

    private val _isInService = MutableStateFlow(false)
    override val isInService =
        _isInService
            .logDiffsForTable(
                tableLogBuffer,
                columnPrefix = "",
                columnName = COL_IS_IN_SERVICE,
                _isInService.value
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), _isInService.value)

    private val _isGsm = MutableStateFlow(false)
    override val isGsm =
        _isGsm
            .logDiffsForTable(
                tableLogBuffer,
                columnPrefix = "",
                columnName = COL_IS_GSM,
                _isGsm.value
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), _isGsm.value)

    private val _cdmaLevel = MutableStateFlow(CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN)
    override val cdmaLevel =
        _cdmaLevel
            .logDiffsForTable(
                tableLogBuffer,
                columnPrefix = "",
                columnName = COL_CDMA_LEVEL,
                _cdmaLevel.value
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), _cdmaLevel.value)

    private val _primaryLevel = MutableStateFlow(CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN)
    override val primaryLevel =
        _primaryLevel
            .logDiffsForTable(
                tableLogBuffer,
                columnPrefix = "",
                columnName = COL_PRIMARY_LEVEL,
                _primaryLevel.value
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), _primaryLevel.value)

    private val _dataConnectionState = MutableStateFlow(DataConnectionState.Disconnected)
    override val dataConnectionState =
        _dataConnectionState
            .logDiffsForTable(tableLogBuffer, columnPrefix = "", _dataConnectionState.value)
            .stateIn(scope, SharingStarted.WhileSubscribed(), _dataConnectionState.value)

    private val _dataActivityDirection =
        MutableStateFlow(
            DataActivityModel(
                hasActivityIn = false,
                hasActivityOut = false,
            )
        )
    override val dataActivityDirection =
        _dataActivityDirection
            .logDiffsForTable(tableLogBuffer, columnPrefix = "", _dataActivityDirection.value)
            .stateIn(scope, SharingStarted.WhileSubscribed(), _dataActivityDirection.value)

    private val _carrierNetworkChangeActive = MutableStateFlow(false)
    override val carrierNetworkChangeActive =
        _carrierNetworkChangeActive
            .logDiffsForTable(
                tableLogBuffer,
                columnPrefix = "",
                columnName = COL_CARRIER_NETWORK_CHANGE,
                _carrierNetworkChangeActive.value
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), _carrierNetworkChangeActive.value)

    private val _resolvedNetworkType: MutableStateFlow<ResolvedNetworkType> =
        MutableStateFlow(ResolvedNetworkType.UnknownNetworkType)
    override val resolvedNetworkType =
        _resolvedNetworkType
            .logDiffsForTable(tableLogBuffer, columnPrefix = "", _resolvedNetworkType.value)
            .stateIn(scope, SharingStarted.WhileSubscribed(), _resolvedNetworkType.value)

    override val numberOfLevels = MutableStateFlow(MobileConnectionRepository.DEFAULT_NUM_LEVELS)

    override val dataEnabled = MutableStateFlow(true)

    override val cdmaRoaming = MutableStateFlow(false)

    override val networkName = MutableStateFlow(NetworkNameModel.IntentDerived("demo network"))

    /**
     * Process a new demo mobile event. Note that [resolvedNetworkType] must be passed in separately
     * from the event, due to the requirement to reverse the mobile mappings lookup in the top-level
     * repository.
     */
    fun processDemoMobileEvent(
        event: FakeNetworkEventModel.Mobile,
        resolvedNetworkType: ResolvedNetworkType,
    ) {
        // This is always true here, because we split out disabled states at the data-source level
        dataEnabled.value = true
        networkName.value = NetworkNameModel.IntentDerived(event.name)

        cdmaRoaming.value = event.roaming
        _isRoaming.value = event.roaming
        // TODO(b/261029387): not yet supported
        _isEmergencyOnly.value = false
        _operatorAlphaShort.value = event.name
        _isInService.value = (event.level ?: 0) > 0
        // TODO(b/261029387): not yet supported
        _isGsm.value = false
        _cdmaLevel.value = event.level ?: 0
        _primaryLevel.value = event.level ?: 0
        // TODO(b/261029387): not yet supported
        _dataConnectionState.value = DataConnectionState.Connected
        _dataActivityDirection.value =
            (event.activity ?: TelephonyManager.DATA_ACTIVITY_NONE).toMobileDataActivityModel()
        _carrierNetworkChangeActive.value = event.carrierNetworkChange
        _resolvedNetworkType.value = resolvedNetworkType
    }

    fun processCarrierMergedEvent(event: FakeWifiEventModel.CarrierMerged) {
        // This is always true here, because we split out disabled states at the data-source level
        dataEnabled.value = true
        networkName.value = NetworkNameModel.IntentDerived(CARRIER_MERGED_NAME)
        numberOfLevels.value = event.numberOfLevels
        cdmaRoaming.value = false
        _primaryLevel.value = event.level
        _cdmaLevel.value = event.level
        _dataActivityDirection.value = event.activity.toMobileDataActivityModel()

        // These fields are always the same for carrier-merged networks
        _resolvedNetworkType.value = ResolvedNetworkType.CarrierMergedNetworkType
        _dataConnectionState.value = DataConnectionState.Connected
        _isRoaming.value = false
        _isEmergencyOnly.value = false
        _operatorAlphaShort.value = null
        _isInService.value = true
        _isGsm.value = false
        _carrierNetworkChangeActive.value = false
    }

    companion object {
        private const val CARRIER_MERGED_NAME = "Carrier Merged Network"
    }
}
Loading