@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; }
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"); } } } }
@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); } } }
@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; } }