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

Commit e2ccdcbe authored by Evan Laird's avatar Evan Laird Committed by Android (Google) Code Review
Browse files

Merge changes from topic "wifi-data-activity-model" into tm-qpr-dev

* changes:
  [Sb refactor] Move WifiActivityModel to shared
  [Status bar refactor] Add Roaming to the mobile pipeline
parents 6cb72a51 d4c86b4e
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -41,6 +41,7 @@ import com.android.systemui.statusbar.pipeline.mobile.data.model.DataConnectionS
data class MobileConnectionModel(
data class MobileConnectionModel(
    /** From [ServiceStateListener.onServiceStateChanged] */
    /** From [ServiceStateListener.onServiceStateChanged] */
    val isEmergencyOnly: Boolean = false,
    val isEmergencyOnly: Boolean = false,
    val isRoaming: Boolean = false,


    /** From [SignalStrengthsListener.onSignalStrengthsChanged] */
    /** From [SignalStrengthsListener.onSignalStrengthsChanged] */
    val isGsm: Boolean = false,
    val isGsm: Boolean = false,
+8 −0
Original line number Original line Diff line number Diff line
@@ -50,4 +50,12 @@ interface MobileConnectionRepository {
     * [SubscriptionManager.getDefaultDataSubscriptionId]
     * [SubscriptionManager.getDefaultDataSubscriptionId]
     */
     */
    val isDefaultDataSubscription: StateFlow<Boolean>
    val isDefaultDataSubscription: StateFlow<Boolean>

    /**
     * See [TelephonyManager.getCdmaEnhancedRoamingIndicatorDisplayNumber]. This bit only matters if
     * the connection type is CDMA.
     *
     * True if the Enhanced Roaming Indicator (ERI) display number is not [TelephonyManager.ERI_OFF]
     */
    val cdmaRoaming: StateFlow<Boolean>
}
}
+4 −0
Original line number Original line Diff line number Diff line
@@ -186,6 +186,7 @@ constructor(
        connection.dataEnabled.value = true
        connection.dataEnabled.value = true
        connection.isDefaultDataSubscription.value = state.dataType != null
        connection.isDefaultDataSubscription.value = state.dataType != null


        connection.cdmaRoaming.value = state.roaming
        connection.connectionInfo.value = state.toMobileConnectionModel()
        connection.connectionInfo.value = state.toMobileConnectionModel()
    }
    }


@@ -229,6 +230,7 @@ constructor(
    private fun Mobile.toMobileConnectionModel(): MobileConnectionModel {
    private fun Mobile.toMobileConnectionModel(): MobileConnectionModel {
        return MobileConnectionModel(
        return MobileConnectionModel(
            isEmergencyOnly = false, // TODO(b/261029387): not yet supported
            isEmergencyOnly = false, // TODO(b/261029387): not yet supported
            isRoaming = roaming,
            isGsm = false, // TODO(b/261029387): not yet supported
            isGsm = false, // TODO(b/261029387): not yet supported
            cdmaLevel = level ?: 0,
            cdmaLevel = level ?: 0,
            primaryLevel = level ?: 0,
            primaryLevel = level ?: 0,
@@ -260,4 +262,6 @@ class DemoMobileConnectionRepository(override val subId: Int) : MobileConnection
    override val dataEnabled = MutableStateFlow(true)
    override val dataEnabled = MutableStateFlow(true)


    override val isDefaultDataSubscription = MutableStateFlow(true)
    override val isDefaultDataSubscription = MutableStateFlow(true)

    override val cdmaRoaming = MutableStateFlow(false)
}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -98,6 +98,7 @@ constructor(
        val inflateStrength = getString("inflate")?.toBoolean()
        val inflateStrength = getString("inflate")?.toBoolean()
        val activity = getString("activity")?.toActivity()
        val activity = getString("activity")?.toActivity()
        val carrierNetworkChange = getString("carriernetworkchange") == "show"
        val carrierNetworkChange = getString("carriernetworkchange") == "show"
        val roaming = getString("roam") == "show"


        return Mobile(
        return Mobile(
            level = level,
            level = level,
@@ -107,6 +108,7 @@ constructor(
            inflateStrength = inflateStrength,
            inflateStrength = inflateStrength,
            activity = activity,
            activity = activity,
            carrierNetworkChange = carrierNetworkChange,
            carrierNetworkChange = carrierNetworkChange,
            roaming = roaming,
        )
        )
    }
    }
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,7 @@ sealed interface FakeNetworkEventModel {
        val inflateStrength: Boolean?,
        val inflateStrength: Boolean?,
        @DataActivityType val activity: Int?,
        @DataActivityType val activity: Int?,
        val carrierNetworkChange: Boolean,
        val carrierNetworkChange: Boolean,
        val roaming: Boolean,
    ) : FakeNetworkEventModel
    ) : FakeNetworkEventModel


    data class MobileDisabled(
    data class MobileDisabled(
Loading