示例#1
0
 @Override
 public void onSessionAborted(ContactId contact, TerminationReason reason) {
   if (sLogger.isActivated()) {
     sLogger.debug("Session aborted, reason=".concat(String.valueOf(reason)));
   }
   synchronized (mLock) {
     mVideoSharingService.removeVideoSharing(mSharingId);
     switch (reason) {
       case TERMINATION_BY_SYSTEM:
       case TERMINATION_BY_TIMEOUT:
         setStateAndReasonCode(contact, State.ABORTED, ReasonCode.ABORTED_BY_SYSTEM);
         break;
       case TERMINATION_BY_CONNECTION_LOST:
         setStateAndReasonCode(contact, State.FAILED, ReasonCode.FAILED_SHARING);
         break;
       case TERMINATION_BY_USER:
         setStateAndReasonCode(contact, State.ABORTED, ReasonCode.ABORTED_BY_USER);
         break;
       case TERMINATION_BY_REMOTE:
         setStateAndReasonCode(contact, State.ABORTED, ReasonCode.ABORTED_BY_REMOTE);
         break;
       default:
         throw new IllegalArgumentException(
             "Unknown imsServiceSessionError=".concat(String.valueOf(reason)));
     }
   }
 }
示例#2
0
 private void handleSessionRejected(ReasonCode reasonCode, ContactId contact) {
   if (sLogger.isActivated()) {
     sLogger.debug("Session rejected; reasonCode=".concat(String.valueOf(reasonCode)));
   }
   synchronized (mLock) {
     mVideoSharingService.removeVideoSharing(mSharingId);
     setStateAndReasonCode(contact, State.REJECTED, reasonCode);
   }
 }
示例#3
0
 @Override
 public void onSharingError(ContactId contact, ContentSharingError error) {
   if (sLogger.isActivated()) {
     sLogger.debug("Sharing error ".concat(String.valueOf(error.getErrorCode())));
   }
   VideoSharingStateAndReasonCode stateAndReasonCode = toStateAndReasonCode(error);
   State state = stateAndReasonCode.getState();
   ReasonCode reasonCode = stateAndReasonCode.getReasonCode();
   synchronized (mLock) {
     mVideoSharingService.removeVideoSharing(mSharingId);
     setStateAndReasonCode(contact, state, reasonCode);
   }
 }