Exemplo n.º 1
0
 @Override
 public void onServiceDisconnected(ComponentName arg0) {
   if (service != null) {
     try {
       service.stopLoopbackTest();
     } catch (RemoteException e) {
       Log.e(THIS_FILE, "Error in test", e);
     }
   }
   service = null;
 }
Exemplo n.º 2
0
 private void sendMessage() {
   if (service != null) {
     SipProfile acc = accountChooserButton.getSelectedAccount();
     if (acc != null && acc.id != SipProfile.INVALID_ID) {
       try {
         String textToSend = bodyInput.getText().toString();
         if (!TextUtils.isEmpty(textToSend)) {
           service.sendMessage(textToSend, remoteFrom, (int) acc.id);
           bodyInput.getText().clear();
         }
       } catch (RemoteException e) {
         Log.e(THIS_FILE, "Not able to send message");
       }
     }
   }
 }
Exemplo n.º 3
0
 @Override
 public void onServiceConnected(ComponentName arg0, IBinder arg1) {
   service = ISipService.Stub.asInterface(arg1);
   if (service != null) {
     try {
       int res = service.startLoopbackTest();
       if (res == SipManager.SUCCESS) {
         currentStatus = R.string.test_audio_ongoing;
       } else {
         currentStatus = R.string.test_audio_network_failure;
       }
       updateStatusDisplay();
     } catch (RemoteException e) {
       Log.e(THIS_FILE, "Error in test", e);
     }
   }
 }
Exemplo n.º 4
0
  @Override
  protected void onPause() {
    super.onPause();
    if (service != null) {
      try {
        service.stopLoopbackTest();
      } catch (RemoteException e) {
        Log.e(THIS_FILE, "Error in test", e);
      }
    }

    if (connection != null) {
      unbindService(connection);
    }
    if (monitorThread != null) {
      monitorThread.markFinished();
      monitorThread = null;
    }
  }