public void separate() throws CallStateException {
   if (!disconnected) {
     owner.separate(this);
   } else {
     throw new CallStateException("disconnected");
   }
 }
 public void hangup() throws CallStateException {
   if (!disconnected) {
     owner.hangup(this);
   } else {
     throw new CallStateException("disconnected");
   }
 }
  /*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");
    }
  }
示例#5
0
  public DegraderImpl(Config config) {
    _config = new ImmutableConfig(config);
    _name = _config.getName();
    _clock = config.getClock();
    _callTracker = config.getCallTracker();
    _callTrackerStats = _callTracker.getCallStats();
    _maxDropDuration = config.getMaxDropDuration();

    reset();

    // Added cast below for backward compatibilty. Remove when possible
    _callTracker.addStatsRolloverEventListener(
        new CallTracker.StatsRolloverEventListener() {
          public void onStatsRollover(CallTracker.StatsRolloverEvent event) {
            rolloverStats(event.getCallStats());
          }
        });
  }
示例#6
0
 /**
  * checks if the stats that we used to compute drop rate is stale or not. Stale meaning, we use a
  * certain interval (configured to be 5 seconds) to count the number of calls, latency, etc during
  * that 5 seconds. So every 5 seconds we'll want to refresh the window of interval for counting.
  *
  * <p>So if it's stale, we'll call CallTrackerImpl to refresh the window
  *
  * @param now
  */
 private void checkStale(long now) {
   if (_callTrackerStats.stale(now)) {
     // this code is a bit strange at first i.e. why it's not _callTrackerStats =
     // _callTracker.getCallStats();
     // but instead it's just _callTracker.getCallStats(); even though getCallStats returns a new
     // Object.
     // but this is fine because getCallStats() will eventually call Tracker.rolloverStats() which
     // has a listener!
     // the listener is actually {@see DegraderImpl.rollOverStats(CallTracker.CallStats)} which
     // will update
     // _callTrackerStats with the new stats. So we're fine.
     _callTracker.getCallStats();
   }
 }
  /** 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);
  }