예제 #1
0
  /** Reset the audio mode */
  private synchronized void actualUnsetAudioInCall() {

    if (!prefs.getBoolean("isSavedAudioState", false) || !isSetAudioMode) {
      return;
    }

    Log.d(THIS_FILE, "Unset Audio In call");

    int inCallStream = Compatibility.getInCallStream(userWantBluetooth);
    if (bluetoothWrapper != null) {
      // This fixes the BT activation but... but... seems to introduce a
      // lot of other issues
      // bluetoothWrapper.setBluetoothOn(true);
      Log.d(THIS_FILE, "Unset bt");
      bluetoothWrapper.setBluetoothOn(false);
    }
    audioManager.setMicrophoneMute(false);
    if (doFocusAudio) {
      audioManager.setStreamSolo(inCallStream, false);
      audioFocusWrapper.unFocus();
    }
    restoreAudioState();

    if (wifiLock != null && wifiLock.isHeld()) {
      wifiLock.release();
    }
    if (screenLock != null && screenLock.isHeld()) {
      Log.d(THIS_FILE, "Release screen lock");
      screenLock.release();
    }

    isSetAudioMode = false;
  }
예제 #2
0
 /** Stop call announcement. */
 public void stopRingAndUnfocus() {
   stopRing();
   audioFocusWrapper.unFocus();
 }