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

Commit 9484d72f authored by Evan Laird's avatar Evan Laird
Browse files

Revert "[Mobile] Make sure we +1 the reported level if INFLATE_SIGNAL_STRENGTH is true"

This reverts commit ffe84900.

Reason for revert: Pretty sure I ruined everyone's day

Fixes: 332510010
Change-Id: I10c9557f731a28e159d73465f90be8de89afd161
parent ffe84900
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -44,9 +44,6 @@ interface MobileConnectionRepository {
    /** The carrierId for this connection. See [TelephonyManager.getSimCarrierId] */
    val carrierId: StateFlow<Int>

    /** Reflects the value from the carrier config INFLATE_SIGNAL_STRENGTH for this connection */
    val inflateSignalStrength: StateFlow<Boolean>

    /**
     * The table log buffer created for this connection. Will have the name "MobileConnectionLog
     * [subId]"
+4 −23
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ import com.android.systemui.statusbar.pipeline.wifi.data.repository.demo.model.F
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn

/**
@@ -68,17 +67,6 @@ class DemoMobileConnectionRepository(
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), _carrierId.value)

    private val _inflateSignalStrength: MutableStateFlow<Boolean> = MutableStateFlow(false)
    override val inflateSignalStrength =
        _inflateSignalStrength
            .logDiffsForTable(
                tableLogBuffer,
                columnPrefix = "",
                columnName = "inflate",
                _inflateSignalStrength.value
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), _inflateSignalStrength.value)

    private val _isEmergencyOnly = MutableStateFlow(false)
    override val isEmergencyOnly =
        _isEmergencyOnly
@@ -203,16 +191,7 @@ class DemoMobileConnectionRepository(
            .logDiffsForTable(tableLogBuffer, columnPrefix = "", _resolvedNetworkType.value)
            .stateIn(scope, SharingStarted.WhileSubscribed(), _resolvedNetworkType.value)

    override val numberOfLevels =
        _inflateSignalStrength
            .map { shouldInflate ->
                if (shouldInflate) {
                    DEFAULT_NUM_LEVELS + 1
                } else {
                    DEFAULT_NUM_LEVELS
                }
            }
            .stateIn(scope, SharingStarted.WhileSubscribed(), DEFAULT_NUM_LEVELS)
    override val numberOfLevels = MutableStateFlow(MobileConnectionRepository.DEFAULT_NUM_LEVELS)

    override val dataEnabled = MutableStateFlow(true)

@@ -247,7 +226,8 @@ class DemoMobileConnectionRepository(

        _carrierId.value = event.carrierId ?: INVALID_SUBSCRIPTION_ID

        _inflateSignalStrength.value = event.inflateStrength
        numberOfLevels.value =
            if (event.inflateStrength) DEFAULT_NUM_LEVELS + 1 else DEFAULT_NUM_LEVELS

        cdmaRoaming.value = event.roaming
        _isRoaming.value = event.roaming
@@ -278,6 +258,7 @@ class DemoMobileConnectionRepository(
        carrierName.value = NetworkNameModel.SubscriptionDerived(CARRIER_MERGED_NAME)
        // TODO(b/276943904): is carrierId a thing with carrier merged networks?
        _carrierId.value = INVALID_SUBSCRIPTION_ID
        numberOfLevels.value = event.numberOfLevels
        cdmaRoaming.value = false
        _primaryLevel.value = event.level
        _cdmaLevel.value = event.level
+0 −1
Original line number Diff line number Diff line
@@ -165,7 +165,6 @@ class CarrierMergedConnectionRepository(

    override val isRoaming = MutableStateFlow(false).asStateFlow()
    override val carrierId = MutableStateFlow(INVALID_SUBSCRIPTION_ID).asStateFlow()
    override val inflateSignalStrength = MutableStateFlow(false).asStateFlow()
    override val isEmergencyOnly = MutableStateFlow(false).asStateFlow()
    override val operatorAlphaShort = MutableStateFlow(null).asStateFlow()
    override val isInService = MutableStateFlow(true).asStateFlow()
+0 −15
Original line number Diff line number Diff line
@@ -291,21 +291,6 @@ class FullMobileConnectionRepository(
            )
            .stateIn(scope, SharingStarted.WhileSubscribed(), activeRepo.value.dataEnabled.value)

    override val inflateSignalStrength =
        activeRepo
            .flatMapLatest { it.inflateSignalStrength }
            .logDiffsForTable(
                tableLogBuffer,
                columnPrefix = "",
                columnName = "inflate",
                initialValue = activeRepo.value.inflateSignalStrength.value,
            )
            .stateIn(
                scope,
                SharingStarted.WhileSubscribed(),
                activeRepo.value.inflateSignalStrength.value
            )

    override val numberOfLevels =
        activeRepo
            .flatMapLatest { it.numberOfLevels }
+1 −3
Original line number Diff line number Diff line
@@ -302,10 +302,8 @@ class MobileConnectionRepositoryImpl(
            }
            .stateIn(scope, SharingStarted.WhileSubscribed(), UnknownNetworkType)

    override val inflateSignalStrength = systemUiCarrierConfig.shouldInflateSignalStrength

    override val numberOfLevels =
        inflateSignalStrength
        systemUiCarrierConfig.shouldInflateSignalStrength
            .map { shouldInflate ->
                if (shouldInflate) {
                    DEFAULT_NUM_LEVELS + 1
Loading