-[{"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
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...");
sb.append(account);
String targetResult = addHeader(runtime, sb.toString());
ICLogger.d("targetResult==> " + targetResult);
+ isInitiativeVideoCall = true;
return genStringMessage(cmdMap.get(CMD_TYPE.BP50), targetResult);
}
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("收到服务器下发的通话状态消息");
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();
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();
* 17688768961,亲情号
* tanmingxia0755@gmail.com;357593061269893,频道号
* 0065ad4f9aed8cf411aaef2e9a5fe4e2b7fIABuMKChZsPEdWZ+5Au/cONiTs7Vd6IoIjqOhXa9yA8Ng5r8vd0NvtUaIgCWg34FMhsCYQQAAQDuyQBhAgDuyQBhAwDuyQBhBADuyQBh
- *
* @param mRuntime
* @param mConnection
* @param cmd