app/src/main/java/org/appspot/apprtc/CallActivity.java
// Disconnect from remote resources, dispose of local resources, and exit.
Disconnect from remote resources, dispose of local resources, and exit.
Disconnect from remote resources dispose of local resources and exit .
private void disconnect() {
        activityRunning = false;
        if (appRtcClient != null) {
            appRtcClient.disconnectFromRoom();
            appRtcClient = null;
        }
        if (peerConnectionClient != null) {
            peerConnectionClient.close();
            peerConnectionClient = null;
        }
        if (localRender != null) {
            localRender.release();
            localRender = null;
        }
        if (remoteRender != null) {
            remoteRender.release();
            remoteRender = null;
        }
        if (audioManager != null) {
            audioManager.close();
            audioManager = null;
        }
        if (iceConnected && !isError) {
            setResult(RESULT_OK);
        } else {
            setResult(RESULT_CANCELED);
        }
        finish();
    }
private void disconnect ( ) { activityRunning = false ; if ( appRtcClient != null ) { appRtcClient . disconnectFromRoom ( ) ; appRtcClient = null ; } if ( peerConnectionClient != null ) { peerConnectionClient . close ( ) ; peerConnectionClient = null ; } if ( localRender != null ) { localRender . release ( ) ; localRender = null ; } if ( remoteRender != null ) { remoteRender . release ( ) ; remoteRender = null ; } if ( audioManager != null ) { audioManager . close ( ) ; audioManager = null ; } if ( iceConnected && ! isError ) { setResult ( RESULT_OK ) ; } else { setResult ( RESULT_CANCELED ) ; } finish ( ) ; }
Disconnect from remote resources, dispose of local resources, and exit.
Disconnect from remote resources dispose of local resources and exit .