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

Commit d5a73038 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge remote-tracking branch 'origin/lineage-23.2' into a16.2

parents 4d5d6576 fad7515a
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -67,7 +67,16 @@ class MobileNetworkMainSwitchPreference(
    override val disableWidgetOnCheckedChanged: Boolean
        get() = false

    override fun isAvailable(context: Context): Boolean = true
    override fun isAvailable(context: Context): Boolean {
        val subInfo =
            subscriptionRepository.getSelectableSubscriptionInfoList().firstOrNull {
                it.subscriptionId == subId
            } ?: return false
        // For eSIM, we always want the toggle. If telephony stack support disabling a pSIM
        // directly, we show the toggle.
        return subInfo.isEmbedded ||
            context.requireSubscriptionManager().canDisablePhysicalSubscription()
    }

    override fun tags(context: Context) = arrayOf(KEY_MOBILE_DATA)