-[{"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
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1034,"versionName":"2112291124","enabled":true,"outputFile":"ICSer_V1034_2112291124_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1034_2112291124_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;
+ private static boolean isInitiativeVideoCall = false;
public void getServerReady() {
ICLogger.d("getServerReady...");
if(!isInitiativeVideoCall){
isInitiativeVideoCall = true;
ICLogger.d("app端发起视频通话到手表...");
- handleAP50(mRuntime, mConnection, cmd);
+ handleAP50(true,cmd);
}else {
ICLogger.d("手表主动发起的通话,service返回的AP50...");
+ handleAP50(false,cmd);
}
break;
case AP51://收到服务器的通话状态消息
if(status.equals("2") || status.equals("3") || status.equals("4")){
isInitiativeVideoCall = false;
}
- if(!isInitiativeVideoCall) {
- dispatchAP51(channelId, status);
- }
+ dispatchAP51(channelId, status);
//TODO:回复服务器
ICLogger.d("send broadcast...to video call...");
} else {
* 17688768961,亲情号
* tanmingxia0755@gmail.com;357593061269893,频道号
* 0065ad4f9aed8cf411aaef2e9a5fe4e2b7fIABuMKChZsPEdWZ+5Au/cONiTs7Vd6IoIjqOhXa9yA8Ng5r8vd0NvtUaIgCWg34FMhsCYQQAAQDuyQBhAgDuyQBhAwDuyQBhBADuyQBh
- * @param mRuntime
- * @param mConnection
* @param cmd
*/
- private void handleAP50(Runtime mRuntime, Connection mConnection, String cmd) {
+ private void handleAP50(boolean isComeIn,String cmd) {
ICLogger.d("handleAP50 ==> " + cmd);
String[] split = cmd.split(CMDSPLIT);
//服务器下发AP50,频道创建的秒为单位的时间戳,亲情号,频道ID,加入频道所需的token凭证
if (split.length == 5) {
//调用声网SDK 加入频道的uid参数 手表端暂时固定为2
- String targetId = split[2];
+ String targetId = split[2]; //gator 亲情号
String channel = split[3];
String token = split[4];
ICLogger.d("targetId ==> " + targetId);
ICLogger.d("token ==> " + token);
//TODO:回复服务器
ICLogger.d("send broadcast...to video call...");
- dispatchAP50(targetId, channel, token);
+ dispatchAP50(isComeIn,targetId, channel, token);
} else {
ICLogger.d("parse cmd error == > " + split.length);
}
}
- private void dispatchAP50(String userName, String channel, String token) {
+ private void dispatchAP50(boolean isComeIn,String userName, String channel, String token) {
//收到服务器时间消息的时候认为服务器已经准备好了
RemoteCallbackList<IFZDCallback> fzdCallback = mRuntime.getVideoCallCallback();
int i = fzdCallback.beginBroadcast();
while (i > 0) {
i--;
//1是视频通话,0是语音通话
- fzdCallback.getBroadcastItem(i).onCallingByUserName(userName, channel, "1", token);
+ if(isComeIn){
+ fzdCallback.getBroadcastItem(i).onCallingByUserName(userName, channel, "1", token);
+ }else {
+ fzdCallback.getBroadcastItem(i).onResultServerMsg(userName, channel, token);
+ }
}
} catch (Exception e) {
e.printStackTrace();
}
}
+ public static void takeCallEnd(Runtime runtime){
+ isInitiativeVideoCall = false;
+ }
+
private void serverReady() {
//收到服务器时间消息的时候认为服务器已经准备好了
RemoteCallbackList<IFZDCallback> fzdCallback = mRuntime.getVideoCallCallback();