summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/phone/SubscriptionInfoHelper.java3
-rw-r--r--src/com/android/services/telephony/TelephonyConnectionService.java16
2 files changed, 10 insertions, 9 deletions
diff --git a/src/com/android/phone/SubscriptionInfoHelper.java b/src/com/android/phone/SubscriptionInfoHelper.java
index 7c373e041..14faebc1e 100644
--- a/src/com/android/phone/SubscriptionInfoHelper.java
+++ b/src/com/android/phone/SubscriptionInfoHelper.java
@@ -91,7 +91,8 @@ public class SubscriptionInfoHelper {
intent.putExtra(SubscriptionInfoHelper.SUB_ID_EXTRA, subscription.getSubscriptionId());
intent.putExtra(
- SubscriptionInfoHelper.SUB_LABEL_EXTRA, subscription.getDisplayName().toString());
+ SubscriptionInfoHelper.SUB_LABEL_EXTRA, subscription.getDisplayName() == null ? null
+ : subscription.getDisplayName().toString());
}
/**
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index 766a75e6c..4f6acc8f2 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -2084,8 +2084,7 @@ public class TelephonyConnectionService extends ConnectionService {
if (phone.getEmergencyNumberTracker() != null) {
if (phone.getEmergencyNumberTracker().isEmergencyNumber(
emergencyNumberAddress, true)) {
- if (phone.getHalVersion().greaterOrEqual(RIL.RADIO_HAL_VERSION_1_4)
- || isAvailableForEmergencyCalls(phone)) {
+ if (isAvailableForEmergencyCalls(phone)) {
// a)
if (phone.getPhoneId() == defaultVoicePhoneId) {
Log.i(this, "getPhoneForEmergencyCall, Phone Id that supports"
@@ -2208,12 +2207,6 @@ public class TelephonyConnectionService extends ConnectionService {
// Only sort if there are enough elements to do so.
if (phoneSlotStatus.size() > 1) {
Collections.sort(phoneSlotStatus, (o1, o2) -> {
- if (!o1.hasDialedEmergencyNumber && o2.hasDialedEmergencyNumber) {
- return -1;
- }
- if (o1.hasDialedEmergencyNumber && !o2.hasDialedEmergencyNumber) {
- return 1;
- }
// Sort by non-absent SIM.
if (o1.simState == TelephonyManager.SIM_STATE_ABSENT
&& o2.simState != TelephonyManager.SIM_STATE_ABSENT) {
@@ -2232,6 +2225,13 @@ public class TelephonyConnectionService extends ConnectionService {
if (o2.isLocked && !o1.isLocked) {
return 1;
}
+ // Prefer slots where the number is considered emergency.
+ if (!o1.hasDialedEmergencyNumber && o2.hasDialedEmergencyNumber) {
+ return -1;
+ }
+ if (o1.hasDialedEmergencyNumber && !o2.hasDialedEmergencyNumber) {
+ return 1;
+ }
// sort by number of RadioAccessFamily Capabilities.
int compare = RadioAccessFamily.compare(o1.capabilities, o2.capabilities);
if (compare == 0) {