/*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);
      }
    }
  }
 public void updateParent(Call oldParent, Call newParent) {
   if (newParent != oldParent) {
     if (oldParent != null) {
       oldParent.detach(this);
     }
     newParent.attachFake(this, Call.State.ACTIVE);
     parent = newParent;
   }
 }
  public void fakeHoldBeforeDialIms() {
    if (parent != null) {
      parent.detach(this);
    }

    parent = owner.backgroundCallIms;
    parent.attachFake(this, Call.State.HOLDING);

    onStartedHolding();
  }
  /** 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);
  }