diff options
author | 2025-02-20 22:27:18 -0800 | |
---|---|---|
committer | 2025-02-20 22:27:18 -0800 | |
commit | 2fef05b45c373cced71e4920eb7f6f528f4e3347 (patch) | |
tree | 2fdd604b57fae635f45d0dc03241bfff65907631 | |
parent | fed0893118b0f399e1f0e8a2988bf61175f7ddf8 (diff) | |
parent | 38c5d9b9ab0dc00f20643843cb2c8b24f8ce03f5 (diff) |
Merge "Return false for emergency calls for automotive" into main
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt index d3369033942e..2efc0579f333 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt @@ -20,6 +20,7 @@ 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 @@ -192,6 +193,19 @@ 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) |