gator-增加aidl接口,传输uid
authork.liang <liangkang648253071@126.com>
Tue, 21 Dec 2021 03:08:22 +0000 (11:08 +0800)
committerk.liang <liangkang648253071@126.com>
Tue, 21 Dec 2021 03:08:22 +0000 (11:08 +0800)
app/release/output.json
app/src/main/aidl/com/enqualcomm/support/IFZDCallback.aidl
app/src/main/java/com/ic/protocols/protocolAPIHelper.java
app/src/main/java/com/ic/protocols/protocol_gator.java
app/version_code.properties

index bf69f88..8e65e8e 100644 (file)
@@ -1 +1 @@
-[{"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
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1030,"versionName":"2112201457","enabled":true,"outputFile":"ICSer_V1030_2112201457_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1030_2112201457_release.apk","properties":{}}]
\ No newline at end of file
index 084ef1f..724777c 100644 (file)
@@ -7,6 +7,7 @@ interface IFZDCallback {
     void onCallRequestResult(int result);
     void onAGCallRequestResult(in int result,in String token,in String roomName);
     void onBRIdEmpty();
+    void onGatorRemoteUid(in String remoteUid);
     void onRemoteReject(in String remoteUserId,in int type);
     void onFriendsMakeResult(in int result,String friendName,String id,String phoneNum);
     void onFriendsUnbindResult();
index 4f6123e..a7dabda 100644 (file)
@@ -1330,6 +1330,7 @@ public class protocolAPIHelper {
             case Config.PROTOCOL_S123:
                 break;
             case Config.PROTOCOL_GATOR:
+                //todo 设备拒接,gator客户说不用上报,不是很理解为啥不上报,我不上报他们咋知道我拒接的,意念控制?
                 break;
         }
         return ret;
index b3aebed..0bd5ab5 100644 (file)
@@ -72,6 +72,7 @@ public class protocol_gator {
     public static final String defaultServerIP = "watch.gatorcn.com";
     public static final int defaultServerPort = 27015;
     private boolean hasLogin = false;
+    private boolean isInitiativeVideoCall = false;
 
     public void getServerReady() {
         ICLogger.d("getServerReady...");
@@ -324,6 +325,7 @@ public class protocol_gator {
         sb.append(account);
         String targetResult = addHeader(runtime, sb.toString());
         ICLogger.d("targetResult==> " + targetResult);
+        isInitiativeVideoCall = true;
         return genStringMessage(cmdMap.get(CMD_TYPE.BP50), targetResult);
     }
 
@@ -1627,8 +1629,13 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
                 handleAP34(mRuntime, mConnection, cmd);
                 break;
             case AP50://收到服务器视频请求
-                ICLogger.d("app端发起视频通话到手表...");
-                handleAP50(mRuntime, mConnection, cmd);
+                if(!isInitiativeVideoCall){
+                    isInitiativeVideoCall = true;
+                    ICLogger.d("app端发起视频通话到手表...");
+                    handleAP50(mRuntime, mConnection, cmd);
+                }else {
+                    ICLogger.d("手表主动发起的通话,service返回的AP50...");
+                }
                 break;
             case AP51://收到服务器的通话状态消息
                 ICLogger.d("收到服务器下发的通话状态消息");
@@ -1653,21 +1660,42 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
     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 remoteUid = split[1];
             String status = split[2];
-            String targetId = split[4];
+            String channelId = split[5];
             ICLogger.d("status ==> " + status);
+            dispatchGatorRemoteUid(remoteUid);
+            if(status.equals("2") || status.equals("3") || status.equals("4")){
+                isInitiativeVideoCall = false;
+            }
+            if(!isInitiativeVideoCall) {
+                dispatchAP51(channelId, 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) {
+    private void dispatchGatorRemoteUid(String remoteUid) {
+        //收到服务器时间消息的时候认为服务器已经准备好了
+        RemoteCallbackList<IFZDCallback> fzdCallback = mRuntime.getVideoCallCallback();
+        int i = fzdCallback.beginBroadcast();
+        try {
+            while (i > 0) {
+                i--;
+                fzdCallback.getBroadcastItem(i).onGatorRemoteUid(remoteUid);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            fzdCallback.finishBroadcast();
+        }
+    }
+
+    private void dispatchAP51(String channelId,String status) {
         //收到服务器时间消息的时候认为服务器已经准备好了
         RemoteCallbackList<IFZDCallback> fzdCallback = mRuntime.getVideoCallCallback();
         int i = fzdCallback.beginBroadcast();
@@ -1675,7 +1703,7 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
             while (i > 0) {
                 i--;
                 //1是视频通话,0是语音通话
-                fzdCallback.getBroadcastItem(i).onRemoteReject(targetId,Integer.parseInt(status));
+                fzdCallback.getBroadcastItem(i).onRemoteReject(channelId,Integer.parseInt(status));
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -1690,7 +1718,6 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
      * 17688768961,亲情号
      * tanmingxia0755@gmail.com;357593061269893,频道号
      * 0065ad4f9aed8cf411aaef2e9a5fe4e2b7fIABuMKChZsPEdWZ+5Au/cONiTs7Vd6IoIjqOhXa9yA8Ng5r8vd0NvtUaIgCWg34FMhsCYQQAAQDuyQBhAgDuyQBhAwDuyQBhBADuyQBh
-     *
      * @param mRuntime
      * @param mConnection
      * @param cmd
index 7ccdf43..847e93c 100644 (file)
@@ -1,2 +1,2 @@
-#Wed Dec 08 16:57:24 CST 2021\r
-VERSION_CODE=1018\r
+#Mon Dec 20 14:57:29 CST 2021\r
+VERSION_CODE=1030\r