summaryrefslogtreecommitdiff
path: root/src/com/android/phone/PhoneGlobals.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/phone/PhoneGlobals.java')
-rw-r--r--src/com/android/phone/PhoneGlobals.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 46a3c3df0e..cee8cf54d1 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -165,6 +165,7 @@ public class PhoneGlobals extends ContextWrapper {
CarrierConfigLoader configLoader;
private Phone phoneInEcm;
+ private Phone phoneInScbm;
static boolean sVoiceCapable = true;
@@ -818,10 +819,19 @@ public class PhoneGlobals extends ContextWrapper {
Log.w(LOG_TAG, "phoneInEcm is null.");
}
} else if (action.equals(SmsCallbackModeService.ACTION_SMS_CALLBACK_MODE_CHANGED)) {
- if (intent.getBooleanExtra(
- SmsCallbackModeService.EXTRA_PHONE_IN_SCM_STATE, false)) {
- // Start Sms Callback Mode service
- context.startService(new Intent(context, SmsCallbackModeService.class));
+ int phoneId = intent.getIntExtra(PhoneConstants.PHONE_KEY, 0);
+ Log.d(LOG_TAG, "SMS Callback Mode. phoneId:" + phoneId);
+ phoneInScbm = PhoneFactory.getPhone(phoneId);
+ if (phoneInScbm != null) {
+ if (intent.getBooleanExtra(
+ SmsCallbackModeService.EXTRA_PHONE_IN_SCM_STATE, false)) {
+ // Start Sms Callback Mode service
+ context.startService(new Intent(context, SmsCallbackModeService.class));
+ } else {
+ phoneInScbm = null;
+ }
+ } else {
+ Log.w(LOG_TAG, "phoneInScbm is null.");
}
} else if (action.equals(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED)) {
// Roaming status could be overridden by carrier config, so we need to update it.
@@ -1007,6 +1017,10 @@ public class PhoneGlobals extends ContextWrapper {
return phoneInEcm;
}
+ public Phone getPhoneInEmergencyMode() {
+ return phoneInEcm != null ? phoneInEcm: phoneInScbm;
+ }
+
/**
* Triggers a refresh of the message waiting (voicemail) indicator.
*