From e048ba4c93af976d074bf9ca56c23557f9104e04 Mon Sep 17 00:00:00 2001
From: 562935844@qq.com
Date: 星期二, 28 六月 2022 16:58:38 +0800
Subject: [PATCH] 更新账号

---
 HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/HDLLinphoneKit.java |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/HDLLinphoneKit.java b/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/HDLLinphoneKit.java
index 29227e3..248d721 100644
--- a/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/HDLLinphoneKit.java
+++ b/HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/HDLLinphoneKit.java
@@ -144,6 +144,7 @@
             @Override
             public void incomingCall(Call linphoneCall) {
                 super.incomingCall(linphoneCall);
+                Log.d("HDLLinphoneKit","------incomingCall------");
                 if (linphoneCall != null) {
                     String callUsername = linphoneCall.getRemoteAddress().getUsername();
                     HDLLog.I("鏉ョ數鍙风爜锛�" + callUsername);
@@ -162,19 +163,21 @@
             @Override
             public void outgoingInit() {
                 super.outgoingInit();
-
+                Log.d("HDLLinphoneKit","------outgoingInit------");
             }
 
             @Override
             public void callConnected() {
                 super.callConnected();
                 // 瑙嗛閫氳瘽榛樿鍏嶆彁锛岃闊抽�氳瘽榛樿闈炲厤鎻�
+                Log.d("HDLLinphoneKit","------callConnected------");
                 toggleSpeaker(true);
             }
 
             @Override
             public void callEnd() {
                 super.callEnd();
+                Log.d("HDLLinphoneKit","------callEnd------");
 //                context.sendBroadcast(new Intent(HDLLinphoneIntercomActivity.RECEIVE_FINISH_VIDEO_ACTIVITY));
 
             }
@@ -477,8 +480,11 @@
             Call currentCall = HDLLinphoneService.getCore().getCurrentCall();
             CallParams params = HDLLinphoneService.getCore().createCallParams(currentCall);
             params.enableVideo(true);
+            params.enableLowBandwidth(false);
             params.setAudioBandwidthLimit(0); // disable limitation
             currentCall.acceptWithParams(params);
+            Log.d("HDLLinphoneKit","---acceptCall= ");
+
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -541,7 +547,7 @@
      * 璁剧疆澶栨斁璁惧
      */
     private void routeAudioToSpeakerHelper(boolean speakerOn) {
-        org.linphone.core.tools.Log.w("[Audio Manager] Routing audio to " + (speakerOn ? "speaker" : "earpiece"));
+        Log.d("HDLLinphoneKit","璁剧疆澶栨斁璁惧[Audio Manager] Routing audio to " + (speakerOn ? "speaker" : "earpiece"));
         try {
             if (HDLLinphoneService.getCore() == null) return;
             if (HDLLinphoneService.getCore().getCallsNb() == 0) return;
@@ -550,8 +556,14 @@
             if (currentCall == null) return;
 
             for (AudioDevice audioDevice : HDLLinphoneService.getCore().getAudioDevices()) {
+                Log.d("HDLLinphoneKit","audioDevice.getType()= " + audioDevice.getType());
+            }
+
+            for (AudioDevice audioDevice : HDLLinphoneService.getCore().getAudioDevices()) {
+                Log.d("HDLLinphoneKit","璁剧疆澶栨斁璁惧speakerOn=" + speakerOn + " audioDevice.getType()=" + audioDevice.getType());
                 if (speakerOn && audioDevice.getType() == AudioDevice.Type.Speaker) {
                     currentCall.setOutputAudioDevice(audioDevice);
+                    Log.d("HDLLinphoneKit","AudioDevice.Type.Speaker");
                     return;
                 } else if (!speakerOn && audioDevice.getType() == AudioDevice.Type.Earpiece) {
                     currentCall.setOutputAudioDevice(audioDevice);

--
Gitblit v1.8.0