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

Commit 933c12ef authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes Ie0da0143,I9541a914,I21f3259e,I40a6d5aa,I9c6b9ba3 into tm-qpr-dev

* changes:
  [Sb refactor] Consume isInService in mobile view model
  [Sb refactor] Add Utils.isInService to mobile pipeline
  [Sb refactor] Pull the WifiRepository interface out of the impl file (2/2)
  [Sb refactor] Pull the WifiRepository interface out of the impl file (1/2)
  [Sb refactor] Move WifiRepositoryImpl to prod/ package
parents b4c0f42b eadd94c5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@
-packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ConnectivityPipelineLogger.kt
-packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/model/WifiActivityModel.kt
-packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/model/WifiNetworkModel.kt
-packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepository.kt
-packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImpl.kt
-packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/domain/interactor/WifiInteractor.kt
-packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/shared/WifiConstants.kt
-packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/ui/view/ModernStatusBarWifiView.kt
@@ -752,7 +752,7 @@
-packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/panelstate/ShadeExpansionStateManagerTest.kt
-packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/userswitcher/StatusBarUserSwitcherControllerOldImplTest.kt
-packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/ConnectivityPipelineLoggerTest.kt
-packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/WifiRepositoryImplTest.kt
-packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImplTest.kt
-packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/domain/interactor/WifiInteractorImplTest.kt
-packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/ui/view/ModernStatusBarWifiViewTest.kt
-packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/WifiViewModelTest.kt
+16 −0
Original line number Diff line number Diff line
@@ -51,6 +51,16 @@ data class MobileConnectionModel(
     */
    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)
@@ -99,6 +109,10 @@ data class MobileConnectionModel(
            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)
        }
@@ -129,6 +143,7 @@ data class MobileConnectionModel(
        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)
@@ -141,6 +156,7 @@ data class MobileConnectionModel(
        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"
+1 −0
Original line number Diff line number Diff line
@@ -247,6 +247,7 @@ constructor(
        return MobileConnectionModel(
            isEmergencyOnly = false, // TODO(b/261029387): not yet supported
            isRoaming = roaming,
            isInService = (level ?: 0) > 0,
            isGsm = false, // TODO(b/261029387): not yet supported
            cdmaLevel = level ?: 0,
            primaryLevel = level ?: 0,
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.telephony.TelephonyManager
import android.telephony.TelephonyManager.ERI_OFF
import android.telephony.TelephonyManager.EXTRA_SUBSCRIPTION_ID
import android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN
import com.android.settingslib.Utils
import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow
import com.android.systemui.dagger.qualifiers.Application
@@ -117,6 +118,7 @@ class MobileConnectionRepositoryImpl(
                                    isEmergencyOnly = serviceState.isEmergencyOnly,
                                    isRoaming = serviceState.roaming,
                                    operatorAlphaShort = serviceState.operatorAlphaShort,
                                    isInService = Utils.isInService(serviceState),
                                )
                            trySend(state)
                        }
+8 −0
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@ interface MobileIconInteractor {
    /** True when telephony tells us that the data state is CONNECTED */
    val isDataConnected: StateFlow<Boolean>

    /** True if we consider this connection to be in service, i.e. can make calls */
    val isInService: StateFlow<Boolean>

    // TODO(b/256839546): clarify naming of default vs active
    /** True if we want to consider the data connection enabled */
    val isDefaultDataEnabled: StateFlow<Boolean>
@@ -175,4 +178,9 @@ class MobileIconInteractorImpl(
        connectionInfo
            .mapLatest { connection -> connection.dataConnectionState == Connected }
            .stateIn(scope, SharingStarted.WhileSubscribed(), false)

    override val isInService =
        connectionRepository.connectionInfo
            .mapLatest { it.isInService }
            .stateIn(scope, SharingStarted.WhileSubscribed(), false)
}
Loading