Exemplo n.º 1
0
 /**
  * Start ringing announce for a given contact. It will also focus audio for us.
  *
  * @param remoteContact the contact to ring for. May resolve the contact ringtone if any.
  */
 public synchronized void startRing(String remoteContact) {
   saveAudioState();
   if (!ringer.isRinging()) {
     ringer.ring(remoteContact, service.getPrefs().getRingtone());
   } else {
     Log.d(THIS_FILE, "Already ringing ....");
   }
 }
Exemplo n.º 2
0
 public void setSpeakerphoneOn(boolean on) throws SameThreadException {
   if (service != null && restartAudioWhenRoutingChange && !ringer.isRinging()) {
     service.setNoSnd();
     userWantSpeaker = on;
     service.setSnd();
   } else {
     userWantSpeaker = on;
     audioManager.setSpeakerphoneOn(on);
   }
   broadcastMediaChanged();
 }
Exemplo n.º 3
0
 public void setBluetoothOn(boolean on) throws SameThreadException {
   Log.d(THIS_FILE, "Set BT " + on);
   if (service != null && restartAudioWhenRoutingChange && !ringer.isRinging()) {
     service.setNoSnd();
     userWantBluetooth = on;
     service.setSnd();
   } else {
     userWantBluetooth = on;
     bluetoothWrapper.setBluetoothOn(on);
   }
   broadcastMediaChanged();
 }
Exemplo n.º 4
0
 /**
  * Stop all ringing. <br>
  * Warning, this will not unfocus audio.
  */
 public synchronized void stopRing() {
   LogUtils.e("ringring", "stop");
   if (ringer.isRinging()) {
     ringer.stopRing();
   }
 }