Esempio n. 1
0
  private synchronized void terminate() {
    Log.w("RedPhoneService", "termination stack", new Exception());
    lockManager.updatePhoneState(LockManager.PhoneState.PROCESSING);
    NotificationBarManager.setCallEnded(this);

    incomingRinger.stop();
    outgoingRinger.stop();

    if (currentCallRecord != null) {
      currentCallRecord.finishCall();
      currentCallRecord = null;
    }

    if (currentCallManager != null) {
      currentCallManager.terminate();
      currentCallManager = null;
    }

    shutdownAudio();

    state = RedPhone.STATE_IDLE;
    lockManager.updatePhoneState(LockManager.PhoneState.IDLE);
    // XXX [email protected] -- Do we still need to stop the Service?
    //    Log.d("RedPhoneService", "STOP SELF" );
    //    this.stopSelf();
  }
Esempio n. 2
0
 @Override
 public void onDestroy() {
   super.onDestroy();
   unregisterReceiver(pstnCallListener);
   NotificationBarManager.setCallEnded(this);
   uncaughtExceptionHandlerManager.unregister();
 }
Esempio n. 3
0
  public void notifyCallFresh() {
    Log.w("RedPhoneService", "Good call, time to ring and display call card...");
    sendMessage(RedPhone.HANDLE_INCOMING_CALL, remoteNumber);

    lockManager.updatePhoneState(LockManager.PhoneState.INTERACTIVE);

    startCallCardActivity();
    incomingRinger.start();

    NotificationBarManager.setCallInProgress(this);
  }
Esempio n. 4
0
  private void handleOutgoingCall(Intent intent) {
    remoteNumber = extractRemoteNumber(intent);

    if (remoteNumber == null || remoteNumber.length() == 0) return;

    sendMessage(RedPhone.HANDLE_OUTGOING_CALL, remoteNumber);

    state = RedPhone.STATE_DIALING;
    lockManager.updatePhoneState(LockManager.PhoneState.INTERACTIVE);
    this.currentCallManager =
        new InitiatingCallManager(this, this, localNumber, password, remoteNumber, zid);
    this.currentCallManager.start();

    NotificationBarManager.setCallInProgress(this);

    currentCallRecord = CallLogger.logOutgoingCall(this, remoteNumber);
  }
Esempio n. 5
0
 private void handleMissedCall(String remoteNumber) {
   CallLogger.logMissedCall(this, remoteNumber, System.currentTimeMillis());
   NotificationBarManager.notifyMissedCall(this, remoteNumber);
 }