Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a1dca3e authored by Conley Owens's avatar Conley Owens Committed by android code review
Browse files

Merge "Telephony: Register/Unregister Phones with CallManager"

parents 4b27125d cbca3852
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import com.android.internal.telephony.gsm.GSMPhone;
import com.android.internal.telephony.gsm.UsimServiceTable;
import com.android.internal.telephony.ims.IsimRecords;
import com.android.internal.telephony.test.SimulatedRadioControl;
import com.android.internal.telephony.CallManager;

import java.util.List;

@@ -87,6 +88,7 @@ public class PhoneProxy extends Handler implements Phone {

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

                ((GSMPhone)mActivePhone).dispose();
                Phone oldPhone = mActivePhone;
@@ -99,9 +101,11 @@ public class PhoneProxy extends Handler implements Phone {

                mActivePhone = PhoneFactory.getCdmaPhone();
                ((GSMPhone)oldPhone).removeReferences();
                CallManager.getInstance().registerPhone(mActivePhone);
                oldPhone = null;
            } else {
                logd("Make a new GSMPhone and destroy the old CDMAPhone.");
                CallManager.getInstance().unregisterPhone(mActivePhone);

                ((CDMAPhone)mActivePhone).dispose();
                //mActivePhone = null;
@@ -115,6 +119,7 @@ public class PhoneProxy extends Handler implements Phone {

                mActivePhone = PhoneFactory.getGsmPhone();
                ((CDMAPhone)oldPhone).removeReferences();
                CallManager.getInstance().registerPhone(mActivePhone);
                oldPhone = null;
            }