@Override
 public void onLeftRightChoice(int whichHandle) {
   Log.d(THIS_FILE, "Call controls receive info from slider " + whichHandle);
   if (controlMode != MODE_LOCKER) {
     // Oups we are not in locker mode and we get a trigger from
     // locker...
     // Should not happen... but... to be sure
     return;
   }
   switch (whichHandle) {
     case LEFT_HANDLE:
       Log.d(THIS_FILE, "We take the call");
       dispatchTriggerEvent(IOnCallActionTrigger.TAKE_CALL);
       break;
     case RIGHT_HANDLE:
       Log.d(THIS_FILE, "We clear the call");
       dispatchTriggerEvent(IOnCallActionTrigger.DONT_TAKE_CALL);
     default:
       break;
   }
 }
예제 #2
0
 @Override
 public void on_zrtp_show_sas(int callId, pj_str_t sas, int verified) {
   String sasString = PjSipService.pjStrToString(sas);
   Log.d(THIS_FILE, "ZRTP show SAS " + sasString + " verified : " + verified);
   if (verified != 1) {
     SipCallSession callInfo = pjService.getPublicCallInfo(callId);
     Intent zrtpIntent = new Intent(SipManager.ACTION_ZRTP_SHOW_SAS);
     zrtpIntent.putExtra(Intent.EXTRA_SUBJECT, sasString);
     zrtpIntent.putExtra(SipManager.EXTRA_CALL_INFO, callInfo);
     pjService.service.sendBroadcast(zrtpIntent, SipManager.PERMISSION_USE_SIP);
   } else {
     updateZrtpInfos(callId);
   }
 }
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    Log.d(THIS_FILE, "Hey you hit the key : " + keyCode);
    if (controlMode == MODE_LOCKER) {
      switch (keyCode) {
        case KeyEvent.KEYCODE_CALL:
          dispatchTriggerEvent(IOnCallActionTrigger.TAKE_CALL);
          return true;
        case KeyEvent.KEYCODE_ENDCALL:
          // case KeyEvent.KEYCODE_POWER:
          dispatchTriggerEvent(IOnCallActionTrigger.REJECT_CALL);
          return true;
        default:
          break;
      }
    }

    return super.onKeyDown(keyCode, event);
  }