Skip to content

Commit 3fc6c55

Browse files
added function documenttation
1 parent 49d984f commit 3fc6c55

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,11 @@ public void setMutedCall(String uuid, boolean shouldMute) {
417417
}
418418
conn.onCallAudioStateChanged(newAudioState);
419419
}
420-
420+
/**
421+
* toggle audio route for speaker via connection service function
422+
* @param uuid
423+
* @param useSpeaker
424+
*/
421425
@ReactMethod
422426
public void toggleAudioRouteSpeaker(String uuid, boolean useSpeaker) {
423427
VoiceConnection conn = (VoiceConnection) VoiceConnectionService.getConnection(uuid);

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,13 @@ class RNCallKeep {
164164
};
165165

166166
sendDTMF = (uuid, key) => RNCallKeepModule.sendDTMF(uuid, key);
167-
167+
/**
168+
* when Phone call is active, Android control the audio service via connection service.
169+
* so this function help to toggle the audio to Speaker or wired/ear-piece or vice-versa
170+
* @param {*} uuid
171+
* @param {*} useSpeaker
172+
* @returns toggle the Audio state to Speaker and vice-versa
173+
*/
168174
toggleAudioRouteSpeaker = (uuid, useSpeaker) => isIOS ? null : RNCallKeepModule.toggleAudioRouteSpeaker(uuid, useSpeaker);
169175

170176
checkIfBusy = () =>

0 commit comments

Comments
 (0)