File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
android/src/main/java/com/zxcpoiu/incallmanager Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1207,6 +1207,17 @@ public void run() {
12071207 synchronized (this ) {
12081208 if (!playing ) {
12091209 playing = true ;
1210+
1211+ // --- make sure audio routing, or it will be wired when switch suddenly
1212+ if (caller .equals ("mBusytone" )) {
1213+ audioManager .setMode (AudioManager .MODE_IN_COMMUNICATION );
1214+ } else if (caller .equals ("mRingback" )) {
1215+ audioManager .setMode (AudioManager .MODE_IN_COMMUNICATION );
1216+ } else if (caller .equals ("mRingtone" )) {
1217+ audioManager .setMode (AudioManager .MODE_RINGTONE );
1218+ }
1219+ InCallManagerModule .this .updateAudioRoute ();
1220+
12101221 tg .startTone (toneType );
12111222 try {
12121223 wait (toneWaitTimeMs + loadBufferWaitTimeMs );
You can’t perform that action at this time.
0 commit comments