gator-增加AP51,获取服务器的通话状态
authork.liang <liangkang648253071@126.com>
Wed, 8 Dec 2021 11:50:53 +0000 (19:50 +0800)
committerk.liang <liangkang648253071@126.com>
Wed, 8 Dec 2021 11:50:53 +0000 (19:50 +0800)
app/release/output.json
app/src/main/java/com/ic/protocols/protocol_gator.java
app/version_code.properties
local.properties

index a14d97d..bf69f88 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1017,"versionName":"2112071047","enabled":true,"outputFile":"ICSer_V1017_2112071047_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1017_2112071047_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1018,"versionName":"2112081657","enabled":true,"outputFile":"ICSer_V1018_2112081657_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1018_2112081657_release.apk","properties":{}}]
\ No newline at end of file
index f39a69c..b3aebed 100644 (file)
@@ -117,6 +117,7 @@ public class protocol_gator {
         AP34,//BP34回复
         AP50,//app端发起视频通话到手表
         BP50,//手表端发起请求到手机
+        AP51,//获取服务器下发的通话状态
         /*终端发起*/
         BP00,//开机对时
         BP01,//AP01返回
@@ -212,6 +213,7 @@ public class protocol_gator {
         cmdMap.put(CMD_TYPE.BP35, "BP35");
         cmdMap.put(CMD_TYPE.AP50, "AP50");
         cmdMap.put(CMD_TYPE.BP50, "BP50");
+        cmdMap.put(CMD_TYPE.AP51, "AP51");
     }
 
 
@@ -1628,11 +1630,60 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
                 ICLogger.d("app端发起视频通话到手表...");
                 handleAP50(mRuntime, mConnection, cmd);
                 break;
-
+            case AP51://收到服务器的通话状态消息
+                ICLogger.d("收到服务器下发的通话状态消息");
+                handleAP51(mRuntime, mConnection, cmd);
+                break;
         }
         return ret;
     }
 
+    /**
+     * 视频通话状态
+     * 0066357593061269893AP51,
+     * 3911379387,远端uid
+     * 1,状态
+     * 1633610697,时间戳
+     * 17688768961,亲情号
+     * tanmingxia0755@gmail.com;357593061269893,频道号
+     * @param mRuntime
+     * @param mConnection
+     * @param cmd
+     */
+    private void handleAP51(Runtime mRuntime, Connection mConnection, String cmd) {
+        ICLogger.d("handleAP51 ==> " + cmd);
+        String[] split = cmd.split(CMDSPLIT);
+        //服务器下发AP50,频道创建的秒为单位的时间戳,亲情号,频道ID,加入频道所需的token凭证
+        if (split.length == 6) {
+            //调用声网SDK 加入频道的uid参数 手表端暂时固定为2
+            String status = split[2];
+            String targetId = split[4];
+            ICLogger.d("status ==> " + status);
+            //TODO:回复服务器
+            ICLogger.d("send broadcast...to video call...");
+            dispatchAP51(targetId,status);
+        } else {
+            ICLogger.d("parse cmd error == > " + split.length);
+        }
+    }
+
+    private void dispatchAP51(String targetId,String status) {
+        //收到服务器时间消息的时候认为服务器已经准备好了
+        RemoteCallbackList<IFZDCallback> fzdCallback = mRuntime.getVideoCallCallback();
+        int i = fzdCallback.beginBroadcast();
+        try {
+            while (i > 0) {
+                i--;
+                //1是视频通话,0是语音通话
+                fzdCallback.getBroadcastItem(i).onRemoteReject(targetId,Integer.parseInt(status));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            fzdCallback.finishBroadcast();
+        }
+    }
+
     /**
      * 处理视频通话
      * 00DA357593061269893AP50,
index 65be329..7ccdf43 100644 (file)
@@ -1,2 +1,2 @@
-#Tue Dec 07 10:47:17 CST 2021\r
-VERSION_CODE=1017\r
+#Wed Dec 08 16:57:24 CST 2021\r
+VERSION_CODE=1018\r
index 2b1fa1d..55611eb 100644 (file)
@@ -4,5 +4,5 @@
 # Location of the SDK. This is only used by Gradle.\r
 # For customization when using a Version Control System, please read the\r
 # header note.\r
-#Fri Oct 15 10:40:33 CST 2021\r
-sdk.dir=E\:\\Android\\Sdk
\ No newline at end of file
+#Tue Nov 23 16:39:34 CST 2021\r
+sdk.dir=D\:\\android\\Android\\sdk\r