Always create CdmaPhoneCallState object in PhoneGlobals.
The CdmaPhoneCallState object used to be created on detection
of a new RAT but that code as removed in ag/703176. So now
CDMA provisioning would crash as a null object would be dereferenced.
The lowest risk fix is to create the CdmaPhoneCallState object
on PhoneGlobals creation to guarantee that it is always there.
The worst case is that it goes unused.
Bug: 22634609
Change-Id: Ia686584476db9ce3f07fc54f3e849ad22ff7654b
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 1faf0ee..2223466 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -344,12 +344,8 @@
startService(intent);
mCM = CallManager.getInstance();
- boolean hasCdmaPhoneType = false;
for (Phone phone : PhoneFactory.getPhones()) {
mCM.registerPhone(phone);
- if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
- hasCdmaPhoneType = true;
- }
}
// Create the NotificationMgr singleton, which is used to display
@@ -358,11 +354,9 @@
mHandler.sendEmptyMessage(EVENT_START_SIP_SERVICE);
- if (hasCdmaPhoneType) {
- // Create an instance of CdmaPhoneCallState and initialize it to IDLE
- cdmaPhoneCallState = new CdmaPhoneCallState();
- cdmaPhoneCallState.CdmaPhoneCallStateInit();
- }
+ // Create an instance of CdmaPhoneCallState and initialize it to IDLE
+ cdmaPhoneCallState = new CdmaPhoneCallState();
+ cdmaPhoneCallState.CdmaPhoneCallStateInit();
// before registering for phone state changes
mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);