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

Commit b5681d5d authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

Revert "Return false for emergency calls for automotive"

This reverts commit 38c5d9b9.

Reason for revert: b/398045526 (cleanup)
Test: would fail for sure (fix-forward submitted together)

Change-Id: I3b5ef470043abde8f3820c0b53234ca177763390
parent 34070be4
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.PackageManager
import android.telephony.CarrierConfigManager
import android.telephony.SubscriptionInfo
import android.telephony.SubscriptionManager
@@ -193,19 +192,6 @@ constructor(
        serviceStateChangedEvent
            .mapLatest {
                val modems = telephonyManager.activeModemCount

                // Assume false for automotive devices which don't have the calling feature.
                // TODO: b/398045526 to revisit the below.
                val isAutomotive: Boolean =
                    context.packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
                val hasFeatureCalling: Boolean =
                    context.packageManager.hasSystemFeature(
                        PackageManager.FEATURE_TELEPHONY_CALLING
                    )
                if (isAutomotive && !hasFeatureCalling) {
                    return@mapLatest false
                }

                // Check the service state for every modem. If any state reports emergency calling
                // capable, then consider the device to have emergency call capabilities
                (0..<modems)