/*package*/ public ConnectionBase( Context context, String dialString, CallTracker ct, Call parent, CallDetails moCallDetails) { createWakeLock(context); acquireWakeLock(); owner = ct; h = new MyHandler(owner.getLooper()); this.dialString = dialString; if ((moCallDetails != null) && (moCallDetails.call_domain == CallDetails.RIL_CALL_DOMAIN_PS)) this.address = dialString; else this.address = PhoneNumberUtils.extractNetworkPortionAlt(dialString); this.postDialString = PhoneNumberUtils.extractPostDialPortion(dialString); index = -1; isIncoming = false; cnapName = null; createTime = System.currentTimeMillis(); callDetails = moCallDetails; if (parent != null) { this.parent = parent; // for the cdma three way call case, do not change parent state // pass remote caller id in cdma 3 way call only if (parent.state == Call.State.ACTIVE) { cnapNamePresentation = Connection.PRESENTATION_ALLOWED; numberPresentation = Connection.PRESENTATION_ALLOWED; parent.attachFake(this, Call.State.ACTIVE); } else { // MO call for Gsm & Cdma, set state to dialing parent.attachFake(this, Call.State.DIALING); } } }
/*package*/ public ConnectionBase(Context context, DriverCall dc, CallTracker ct, int index) { createWakeLock(context); acquireWakeLock(); owner = ct; h = new MyHandler(owner.getLooper()); address = dc.number; isIncoming = dc.isMT; createTime = System.currentTimeMillis(); cnapName = dc.name; // TBD if present check cnapNamePresentation = dc.namePresentation; numberPresentation = dc.numberPresentation; if (dc.uusInfo != null) // only for Gsm uusInfo = dc.uusInfo; if (dc.callDetails != null) callDetails = dc.callDetails; if ((callDetails != null) && (callDetails.call_domain == CallDetails.RIL_CALL_DOMAIN_PS)) { parent = imsParentFromDCState(dc.state); // parent = call from ImsPhone } else { parent = parentFromDCState(dc.state); // parent = call from CdmaPhone } this.index = index; if (parent != null) parent.attach(this, dc); else { Log.e(LOG_TAG, "This ConnectionBase does not have a parent call"); } }
/** This is a Call waiting call for cdma */ public ConnectionBase( Context context, CdmaCallWaitingNotification cw, CallTracker ct, Call parent) { createWakeLock(context); acquireWakeLock(); owner = ct; h = new MyHandler(owner.getLooper()); address = cw.number; numberPresentation = cw.numberPresentation; cnapName = cw.name; cnapNamePresentation = cw.namePresentation; index = -1; isIncoming = true; createTime = System.currentTimeMillis(); connectTime = 0; this.parent = parent; parent.attachFake(this, Call.State.WAITING); }