コード例 #1
0
  public Connection dial(String dialString, UUSInfo uusInfo) throws CallStateException {
    // Need to make sure dialString gets parsed properly
    String newDialString = PhoneNumberUtils.stripSeparators(dialString);

    // handle in-call MMI first if applicable
    if (handleInCallMmiCommands(newDialString)) {
      return null;
    }

    // Only look at the Network portion for mmi
    String networkPortion = PhoneNumberUtils.extractNetworkPortionAlt(newDialString);
    GsmMmiCode mmi = GsmMmiCode.newFromDialString(networkPortion, this);
    if (LOCAL_DEBUG) Log.d(LOG_TAG, "dialing w/ mmi '" + mmi + "'...");

    if (mmi == null) {
      return mCT.dial(newDialString, uusInfo);
    } else if (mmi.isTemporaryModeCLIR()) {
      return mCT.dial(mmi.dialingNumber, mmi.getCLIRMode(), uusInfo);
    } else {
      mPendingMMIs.add(mmi);
      mMmiRegistrants.notifyRegistrants(new AsyncResult(null, mmi, null));
      mmi.processCode();

      // FIXME should this return null or something else?
      return null;
    }
  }
コード例 #2
0
  public void dispose() {
    synchronized (PhoneProxy.lockForRadioTechnologyChange) {
      super.dispose();

      // Unregister from all former registered events
      mCM.unregisterForAvailable(this); // EVENT_RADIO_AVAILABLE
      mSIMRecords.unregisterForRecordsLoaded(this); // EVENT_SIM_RECORDS_LOADED
      mCM.unregisterForOffOrNotAvailable(this); // EVENT_RADIO_OFF_OR_NOT_AVAILABLE
      mCM.unregisterForOn(this); // EVENT_RADIO_ON
      mSST.unregisterForNetworkAttach(this); // EVENT_REGISTERED_TO_NETWORK
      mCM.unSetOnUSSD(this);
      mCM.unSetOnSuppServiceNotification(this);

      mPendingMMIs.clear();

      // Force all referenced classes to unregister their former registered events
      mStkService.dispose();
      mCT.dispose();
      mDataConnection.dispose();
      mSST.dispose();
      mIccFileHandler.dispose(); // instance of SimFileHandler
      mSIMRecords.dispose();
      mSimCard.dispose();
      mSimPhoneBookIntManager.dispose();
      mSimSmsIntManager.dispose();
      mSubInfo.dispose();
    }
  }
コード例 #3
0
  private boolean handleCallHoldIncallSupplementaryService(String dialString)
      throws CallStateException {
    int len = dialString.length();

    if (len > 2) {
      return false;
    }

    GsmCall call = (GsmCall) getForegroundCall();

    if (len > 1) {
      try {
        char ch = dialString.charAt(1);
        int callIndex = ch - '0';
        GsmConnection conn = mCT.getConnectionByIndex(call, callIndex);

        // gsm index starts at 1, up to 5 connections in a call,
        if (conn != null && callIndex >= 1 && callIndex <= GsmCallTracker.MAX_CONNECTIONS) {
          if (LOCAL_DEBUG) Log.d(LOG_TAG, "MmiCode 2: separate call " + callIndex);
          mCT.separate(conn);
        } else {
          if (LOCAL_DEBUG) Log.d(LOG_TAG, "separate: invalid call index " + callIndex);
          notifySuppServiceFailed(Phone.SuppService.SEPARATE);
        }
      } catch (CallStateException e) {
        if (LOCAL_DEBUG) Log.d(LOG_TAG, "separate failed", e);
        notifySuppServiceFailed(Phone.SuppService.SEPARATE);
      }
    } else {
      try {
        if (getRingingCall().getState() != GsmCall.State.IDLE) {
          if (LOCAL_DEBUG) Log.d(LOG_TAG, "MmiCode 2: accept ringing call");
          mCT.acceptCall();
        } else {
          if (LOCAL_DEBUG) Log.d(LOG_TAG, "MmiCode 2: switchWaitingOrHoldingAndActive");
          mCT.switchWaitingOrHoldingAndActive();
        }
      } catch (CallStateException e) {
        if (LOCAL_DEBUG) Log.d(LOG_TAG, "switch failed", e);
        notifySuppServiceFailed(Phone.SuppService.SWITCH);
      }
    }

    return true;
  }
コード例 #4
0
  private boolean handleCallDeflectionIncallSupplementaryService(String dialString)
      throws CallStateException {
    if (dialString.length() > 1) {
      return false;
    }

    if (getRingingCall().getState() != GsmCall.State.IDLE) {
      if (LOCAL_DEBUG) Log.d(LOG_TAG, "MmiCode 0: rejectCall");
      try {
        mCT.rejectCall();
      } catch (CallStateException e) {
        if (LOCAL_DEBUG) Log.d(LOG_TAG, "reject failed", e);
        notifySuppServiceFailed(Phone.SuppService.REJECT);
      }
    } else if (getBackgroundCall().getState() != GsmCall.State.IDLE) {
      if (LOCAL_DEBUG) Log.d(LOG_TAG, "MmiCode 0: hangupWaitingOrBackground");
      mCT.hangupWaitingOrBackground();
    }

    return true;
  }
コード例 #5
0
  private boolean handleCallWaitingIncallSupplementaryService(String dialString)
      throws CallStateException {
    int len = dialString.length();

    if (len > 2) {
      return false;
    }

    GsmCall call = (GsmCall) getForegroundCall();

    try {
      if (len > 1) {
        char ch = dialString.charAt(1);
        int callIndex = ch - '0';

        if (callIndex >= 1 && callIndex <= GsmCallTracker.MAX_CONNECTIONS) {
          if (LOCAL_DEBUG) Log.d(LOG_TAG, "MmiCode 1: hangupConnectionByIndex " + callIndex);
          mCT.hangupConnectionByIndex(call, callIndex);
        }
      } else {
        if (call.getState() != GsmCall.State.IDLE) {
          if (LOCAL_DEBUG) Log.d(LOG_TAG, "MmiCode 1: hangup foreground");
          // mCT.hangupForegroundResumeBackground();
          mCT.hangup(call);
        } else {
          if (LOCAL_DEBUG) Log.d(LOG_TAG, "MmiCode 1: switchWaitingOrHoldingAndActive");
          mCT.switchWaitingOrHoldingAndActive();
        }
      }
    } catch (CallStateException e) {
      if (LOCAL_DEBUG) Log.d(LOG_TAG, "hangup failed", e);
      notifySuppServiceFailed(Phone.SuppService.HANGUP);
    }

    return true;
  }
コード例 #6
0
 public void setMute(boolean muted) {
   mCT.setMute(muted);
 }
コード例 #7
0
 public void explicitCallTransfer() throws CallStateException {
   mCT.explicitCallTransfer();
 }
コード例 #8
0
 public void acceptCall() throws CallStateException {
   mCT.acceptCall();
 }
コード例 #9
0
 public void clearDisconnected() {
   mCT.clearDisconnected();
 }
コード例 #10
0
 public void conference() throws CallStateException {
   mCT.conference();
 }
コード例 #11
0
 public boolean canDial() {
   return mCT.canDial();
 }
コード例 #12
0
 public boolean canConference() {
   return mCT.canConference();
 }
コード例 #13
0
 public void switchHoldingAndActive() throws CallStateException {
   mCT.switchWaitingOrHoldingAndActive();
 }
コード例 #14
0
 public void rejectCall() throws CallStateException {
   mCT.rejectCall();
 }
コード例 #15
0
 public boolean getMute() {
   return mCT.getMute();
 }
コード例 #16
0
 /**
  * Please note: if this is the foreground call and a background call exists, the background call
  * will be resumed because an AT+CHLD=1 will be sent
  */
 public void hangup() throws CallStateException {
   owner.hangup(this);
 }
コード例 #17
0
 public boolean canTransfer() {
   return mCT.canTransfer();
 }