Retrieve phone object properly.
getPhone() method in PhoneGlobals accepts subscription id
as argument, but in current implementation its called with
phone id as argument and hence it always returns default phone
object which is not correct.
Hence use PhoneFactory.getPhone() which accepts phoneid as
argument.
Test: manual - tested ECBM on both slots
Bug: 34919091
Change-Id: Icfed0957cfd89f04c5c1c1e81079edfbfc45864d
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index cec5a76..fae712a 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -767,7 +767,7 @@
handleServiceStateChanged(intent);
} else if (action.equals(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED)) {
int phoneId = intent.getIntExtra(PhoneConstants.PHONE_KEY, 0);
- phoneInEcm = getPhone(phoneId);
+ phoneInEcm = PhoneFactory.getPhone(phoneId);
Log.d(LOG_TAG, "Emergency Callback Mode. phoneId:" + phoneId);
if (phoneInEcm != null) {
if (TelephonyCapabilities.supportsEcm(phoneInEcm)) {