Skip to content

Commit cbca385

Browse files
author
Jaime Lopez
committed
Telephony: Register/Unregister Phones with CallManager
Unregister the outgoing phone and register the new one when Technology change is detected. Otherwise, CallManager keeps trying to use an already dead phone, which causes a crash Change-Id: I2a04c76ce882d034d1a2073d2a9f9739d4dd9a38
1 parent 7d234fa commit cbca385

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

telephony/java/com/android/internal/telephony/PhoneProxy.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.android.internal.telephony.gsm.NetworkInfo;
3737
import com.android.internal.telephony.gsm.GsmDataConnection;
3838
import com.android.internal.telephony.test.SimulatedRadioControl;
39+
import com.android.internal.telephony.CallManager;
3940

4041
import java.util.List;
4142

@@ -88,6 +89,7 @@ public void handleMessage(Message msg) {
8889

8990
if(mOutgoingPhone.equals("GSM")) {
9091
logd("Make a new CDMAPhone and destroy the old GSMPhone.");
92+
CallManager.getInstance().unregisterPhone(mActivePhone);
9193

9294
((GSMPhone)mActivePhone).dispose();
9395
Phone oldPhone = mActivePhone;
@@ -100,9 +102,11 @@ public void handleMessage(Message msg) {
100102

101103
mActivePhone = PhoneFactory.getCdmaPhone();
102104
((GSMPhone)oldPhone).removeReferences();
105+
CallManager.getInstance().registerPhone(mActivePhone);
103106
oldPhone = null;
104107
} else {
105108
logd("Make a new GSMPhone and destroy the old CDMAPhone.");
109+
CallManager.getInstance().unregisterPhone(mActivePhone);
106110

107111
((CDMAPhone)mActivePhone).dispose();
108112
//mActivePhone = null;
@@ -116,6 +120,7 @@ public void handleMessage(Message msg) {
116120

117121
mActivePhone = PhoneFactory.getGsmPhone();
118122
((CDMAPhone)oldPhone).removeReferences();
123+
CallManager.getInstance().registerPhone(mActivePhone);
119124
oldPhone = null;
120125
}
121126

0 commit comments

Comments
 (0)