Parcourir la source

适配A33分机,还需要调试语音通话功能

weizhengliang il y a 3 ans
Parent
commit
d14fd82a9c

+ 10 - 2
app/build.gradle

@@ -18,12 +18,20 @@ android {
             keyAlias "rk3128"
             keyPassword "111111"
         }
+
         debug {
             storeFile file("keystore_wuyuqing_3128/rk3128.jks")
             storePassword "111111"
             keyAlias "rk3128"
             keyPassword "111111"
         }
+
+        debugA33 {
+            storeFile file("keystore_a33/wdkl_bed.jks")
+            storePassword "111111"
+            keyAlias "wdkl_bed"
+            keyPassword "111111"
+        }
     }
     // wuyq add for sign end
 
@@ -53,12 +61,12 @@ android {
 
     buildTypes {
         release {
-            signingConfig signingConfigs.release
+            signingConfig signingConfigs.debugA33
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
         debug {
-            signingConfig signingConfigs.debug
+            signingConfig signingConfigs.debugA33
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }

BIN
app/keystore_a33/wdkl_bed.jks


+ 3 - 3
build.gradle

@@ -29,7 +29,7 @@ buildscript {
      * 19--android 4.4
      * 24--android 7.0
      */
-    ext.min_sdk_version = 24
+    ext.min_sdk_version = 16
 
     /**
      * SDK目标支持版本
@@ -49,12 +49,12 @@ buildscript {
     /**
      * APP版本码
      */
-    ext.app_version_code = 12
+    ext.app_version_code = 1
 
     /**
      * APP版本号
      */
-    ext.app_version = "1.1.6"
+    ext.app_version = "1.1.1"
 
     /**
      * 项目依赖库

+ 2 - 2
callingbed/build.gradle

@@ -82,7 +82,7 @@ dependencies {
      */
     compile project(':welcome')
     compile project(':middleware')
-    //compile project(':sip2')
+    compile project(':sip2')
     //compile project(':bedlib')
 
     //web rtc
@@ -91,7 +91,7 @@ dependencies {
     //compile project(':rtc-chat')
 
     //janus信令
-    compile project(':janus')
+    //compile project(':janus')
     //implementation 'org.webrtc:google-webrtc:1.0.32006'
 
     if(componentTag){

+ 5 - 37
callingbed/src/main/java/com/wdkl/app/ncs/callingbed/activity/CallingbedActivity.kt

@@ -28,7 +28,7 @@ import com.wdkl.app.ncs.callingbed.helper.*
 import com.wdkl.app.ncs.callingbed.launch.CallingbedLaunch
 import com.wdkl.app.ncs.callingbed.settings.SettingConfig
 import com.wdkl.app.ncs.callingbed.agreement.CallingbedAgreement
-import com.wdkl.app.ncs.callingbed.fragment.SkyCallFragment
+//import com.wdkl.app.ncs.callingbed.fragment.SkyCallFragment
 import com.wdkl.app.ncs.callingbed.helper.ScreenManagerUtil
 import com.wdkl.ncs.android.lib.base.BaseActivity
 import com.wdkl.ncs.android.lib.base.BaseApplication
@@ -700,7 +700,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
     override fun serialPortBedOnclickString(str: String) {
         try {
             val newStr = str.substring(str.indexOf("$") + 1, str.indexOf("#"))
-            Log.d("serialPortBedOnclickString", "newStr==$newStr")
+            Log.d("serialPort", "newStr==$newStr")
             if (newStr.startsWith("V")) {
                 Constant.MCU_VERSION_NUMBER = newStr.substring(newStr.indexOf(",") + 1, 16)
             }
@@ -886,7 +886,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
             //去电界面
             Constant.CALL_TYPE = type
             Constant.CALL_STATE = Constant.CALL_OUTGOING
-            var fragment = SkyCallFragment()
+            var fragment = SipCallFragment()
             var bundle = Bundle()
             bundle.putInt("call_state", 0)
             fragment.arguments = bundle
@@ -964,7 +964,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
                                 //通话之前先判断webrtc socket是否连接上,否则不能建立通话
                                 if (Constant.TCP_CONNECTED && !TextUtils.isEmpty(Constant.SIP_ID)) {
                                     //来电界面
-                                    var fragment = SkyCallFragment()
+                                    var fragment = SipCallFragment()
                                     var bundle = Bundle()
                                     bundle.putInt("call_state", 1)
                                     bundle.putSerializable("tcp_model", tcpModel)
@@ -1034,38 +1034,6 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
                             }
                         }
                     }
-
-                    //探视
-                    /*if (tcpModel.type == TcpType.VIDEO) {
-                        val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
-                        if (tcpModel.action == TcpAction.VideoAction.VIDEO_INVITE_JOIN) {
-                            if (Constant.CALL_STATE != Constant.CALL_STANDBY) {
-                                VideoUtil.videoInCalling(Constant.DEVICE_ID, tcpModel.fromId, interactionVO.id)
-                            } else {
-                                //收到探视请求,向探视机发起视频通话
-                                Constant.interactionId = interactionVO.id
-                                Constant.fromId = tcpModel.fromId
-                                Constant.CALL_STATE = Constant.CALL_OUTGOING
-
-                                //通话之前先判断webrtc socket是否连接上,否则不能建立通话
-                                if (Constant.TCP_CONNECTED) {
-                                    //探视界面
-                                    var fragment = SkyCallFragment()
-                                    var bundle = Bundle()
-                                    bundle.putInt("call_state", 2)
-                                    bundle.putSerializable("tcp_model", tcpModel)
-                                    fragment.arguments = bundle
-                                    addCallFragment(fragment)
-                                } else {
-                                    showMessage("服务未连接,请稍后")
-                                    Constant.CALL_STATE = Constant.CALL_STANDBY
-                                    VoiceUtil.rejectAudioCall(Constant.DEVICE_ID, Constant.fromId, Constant.interactionId)
-                                }
-                            }
-                        } else if (tcpModel.action == TcpAction.VideoAction.HANDOFF) {
-                            Constant.CALL_STATE = Constant.CALL_STANDBY
-                        }
-                    }*/
                 }
             }
         }
@@ -1114,7 +1082,7 @@ class CallingbedActivity :BaseActivity<CallingbedActivityPresenter, CallingbedMa
         * 检查网络情况,若tcp断开连接多次且IP也是空的则网络异常,重启设备
         * 仅对3128设备有效
          */
-        if (Build.MODEL.equals("rk3128")) {
+        if (Build.MODEL.equals("rk3128") || "WDFJ-I".equals(Build.MODEL)) {
             var count = SettingConfig.getNetErrResetCount(this)
             if (!Constant.TCP_CONNECTED && TextUtils.isEmpty(NetHelper.getInstance().localIP)) {
                 netErrCount++

+ 380 - 0
callingbed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/SipCallFragment.kt

@@ -0,0 +1,380 @@
+package com.wdkl.app.ncs.callingbed.fragment
+
+import android.os.Handler
+import android.os.Looper
+import android.os.SystemClock
+import android.text.TextUtils
+import android.util.Log
+import android.view.View
+import com.google.gson.Gson
+import com.wdkl.app.ncs.callingbed.R
+import com.wdkl.app.ncs.callingbed.helper.RingPlayHelper
+import com.wdkl.ncs.android.lib.utils.AppTool
+import com.wdkl.ncs.android.lib.utils.showMessage
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.common.MessageEvent
+import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
+import com.wdkl.ncs.android.middleware.tcp.channel.VoiceUtil
+import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
+import com.wdkl.ncs.android.middleware.tcp.enums.TcpAction
+import com.wdkl.ncs.android.middleware.tcp.enums.TcpType
+import kotlinx.android.synthetic.main.sip_voice_call_layout.*
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+
+class SipCallFragment: BaseCallFragment() {
+    private val TAG = "SipCallFragment"
+
+    //来电设备id
+    var fromId: Int = -1
+
+    private var interactionVO: InteractionVO? = null
+
+    private val handler = Handler(Looper.getMainLooper())
+
+    private var callEnded: Boolean = false
+
+    private var outGoing: Boolean = false
+
+    private var callSuccess: Boolean = false
+
+    override fun getLayId(): Int {
+        return R.layout.sip_voice_call_layout
+    }
+
+    override fun init() {
+        //初始化计时器
+        initCountDownTimer(sip_voice_call_timeout)
+        //tcp参数
+        if (tcpModel != null) {
+            fromId = tcpModel!!.fromId
+            interactionVO = Gson().fromJson(tcpModel!!.data.toString(), InteractionVO::class.java)
+        }
+
+        when (callState) {
+            0 -> {
+                //去电
+                outGoing = true
+                startOutgoing()
+                RingPlayHelper.playRingTone(baseActivity, R.raw.ring_back2, true)
+            }
+
+            1 -> {
+                //来电
+                outGoing = false
+                showIncomingCall()
+                RingPlayHelper.playRingTone(baseActivity, R.raw.ring_tone, true)
+            }
+
+        }
+    }
+
+    override fun bindEvent() {
+        //去电取消或通话挂断
+        sip_voice_call_hangup.setOnClickListener {
+            RingPlayHelper.stopRingTone()
+            if (Constant.CALL_STATE == Constant.CALL_CALLING) {
+                //结束sip通话
+                Constant.CALL_STATE = Constant.CALL_STANDBY
+                if (sip_voice_call_timer != null) {
+                    sip_voice_call_timer.stop()
+                }
+
+                VoiceUtil.handoffAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
+                callEnd()
+            } else {
+                Constant.CALL_STATE = Constant.CALL_STANDBY
+                VoiceUtil.cancelAudioCall(Constant.DEVICE_ID)
+                cancelCall()
+            }
+        }
+
+        //来电拒绝
+        sip_voice_call_ring_reject.setOnClickListener {
+            RingPlayHelper.stopRingTone()
+            Constant.CALL_STATE = Constant.CALL_STANDBY
+            VoiceUtil.rejectAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
+            callEnd()
+        }
+
+        //来电接听
+        sip_voice_call_ring_pickup_audio.setOnClickListener {
+            RingPlayHelper.stopRingTone()
+            Constant.CALL_STATE = Constant.CALL_INCOMING
+            VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
+            acceptCall()
+        }
+    }
+
+    override fun destroy() {
+        cancelTimer()
+        Constant.CALL_STATE = Constant.CALL_STANDBY
+        if (sip_voice_call_timer != null) {
+            sip_voice_call_timer.stop()
+        }
+        RingPlayHelper.stopRingTone()
+    }
+
+    private fun startOutgoing() {
+        callSuccess = false
+        sip_voice_call_hangup.isEnabled = false
+        VoiceUtil.startAudioCall(Constant.DEVICE_ID)
+        Constant.CALL_STATE = Constant.CALL_OUTGOING
+        sip_voice_call_timeout.visibility = View.VISIBLE
+        sip_voice_call_timer.visibility = View.GONE
+        startTimer()
+
+        AppTool.Time.delay(3000) {
+            Log.d("tcp", "call success: $callSuccess")
+            if (!callSuccess) {
+                //呼叫失败
+                showMessage("呼叫失败,服务器无响应或网络故障!")
+                RingPlayHelper.stopRingTone()
+                cancelCall()
+            }
+        }
+    }
+
+    //去电界面
+    private fun showOutgoingCall() {
+        Constant.CALL_STATE = Constant.CALL_OUTGOING
+        sip_voice_call_calling_text.text = "呼叫成功,等待接听..."
+        ll_sip_voice_call_outgoing.visibility = View.VISIBLE
+        ll_sip_voice_call_incoming.visibility = View.GONE
+        sip_voice_call_timeout.visibility = View.VISIBLE
+        sip_voice_call_timer.visibility = View.GONE
+        startTimer()
+    }
+
+    //来电界面
+    private fun showIncomingCall() {
+        Constant.CALL_STATE = Constant.CALL_INCOMING
+        sip_voice_call_calling_text.text = "有新来电..."
+        ll_sip_voice_call_outgoing.visibility = View.GONE
+        ll_sip_voice_call_incoming.visibility = View.GONE
+        sip_voice_call_timeout.visibility = View.GONE
+        sip_voice_call_timer.visibility = View.GONE
+        cancelTimer()
+    }
+
+    //开始接听
+    private fun acceptCall() {
+        sip_voice_call_calling_text.text = "连接中..."
+        ll_sip_voice_call_outgoing.visibility = View.VISIBLE
+        ll_sip_voice_call_incoming.visibility = View.GONE
+        sip_voice_call_timeout.visibility = View.GONE
+        sip_voice_call_timer.visibility = View.GONE
+        cancelTimer()
+    }
+
+    //呼叫取消
+    private fun cancelCall() {
+        cancelTimer()
+        Constant.CALL_STATE = Constant.CALL_STANDBY
+        callEnd()
+    }
+
+    private fun showCalling() {
+        if (callEnded) {
+            return
+        }
+
+        Constant.CALL_STATE = Constant.CALL_CALLING
+        sip_voice_call_calling_text.text = "通话中..."
+        sip_voice_call_timeout.visibility = View.GONE
+        cancelTimer()
+        sip_voice_call_timer.visibility = View.VISIBLE
+        sip_voice_call_timer.base = SystemClock.elapsedRealtime()
+        sip_voice_call_timer.start()
+    }
+
+    //通话结束
+    override fun callEnd() {
+        synchronized(this) {
+            if (callEnded) {
+                return
+            }
+            callEnded = true
+            Constant.CALL_STATE = Constant.CALL_STANDBY
+            if (sip_voice_call_timer != null) {
+                sip_voice_call_timer.stop()
+            }
+
+            Log.e(TAG, "call end !!!!!!!!!!!!!!!!!!")
+
+            backToMain()
+        }
+    }
+
+
+    /********************************************************
+     ********************* 通话回调 ********************
+     * 注意: 如涉及到UI更新的需要在主线程处理,务必注意
+     ********************************************************/
+    /*override fun didChangeState(var1: EnumType.CallState?) {
+        if (var1 == EnumType.CallState.Connected) {
+            handler.post {
+                RingPlayHelper.stopRingTone()
+                //更新界面显示
+                showCalling()
+            }
+        }
+    }
+
+    override fun didDisconnected(userId: String?) {
+        Log.i(TAG, "disconnected user:" + userId + ",call user:" + Constant.TARGET_SIP)
+        if (userId.equals(Constant.TARGET_SIP)) {
+            Log.w(TAG, "didDisconnected: $userId")
+            handler.post {
+                showMessage("$userId 失去连接")
+                callEnd()
+            }
+        }
+    }
+
+    override fun didCreateLocalVideoTrack() {
+
+    }
+
+    override fun didError(error: String?) {
+        Log.e(TAG, "didError: $error")
+        handler.post {
+            showMessage("通话错误")
+            callEnd()
+        }
+    }
+
+    override fun didHangUp(handlerId: BigInteger) {
+        Log.e("hangup", "socket hangup")
+        handler.post {
+            callEnd()
+        }
+    }
+
+    override fun didReceiveRemoteVideoTrack(userId: BigInteger?) {
+        // TODO("Not yet implemented")
+    }
+
+
+    override fun didCallEndWithReason(var1: EnumType.CallEndReason?) {
+        handler.post {
+            callEnd()
+        }
+    }
+
+    override fun didChangeMode(isAudioOnly: Boolean) {
+
+    }
+
+    override fun didUserLeave(userId: BigInteger?) {
+        Log.w(TAG, "didUserLeave:"+userId)
+        handler.post {
+            callEnd()
+        }
+    }*/
+
+
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMoonEvent(messageEvent: MessageEvent) {
+        when (messageEvent.type) {
+            Constant.EVENT_TCP_MSG -> {
+                if (messageEvent.message is TcpModel) {
+                    val curTcpModel = messageEvent.message as TcpModel
+                    if (curTcpModel.getType() == TcpType.VOICE) {
+                        if (curTcpModel.action == TcpAction.VoiceAction.CANCEL_BY_DOOR) {
+                            Constant.CALL_STATE = Constant.CALL_STANDBY
+                            VoiceUtil.cancelAudioCall(Constant.DEVICE_ID)
+                            cancelCall()
+                            return
+                        }
+
+                        if (curTcpModel.data != null) {
+                            val curInteractionVO = Gson().fromJson(curTcpModel.data.toString(), InteractionVO::class.java)
+                            if (curTcpModel.getAction() == TcpAction.VoiceAction.ACCEPT) {
+                                //我方呼出,对方接受
+                                RingPlayHelper.stopRingTone()
+                                Constant.interactionId = curInteractionVO.id
+                                fromId = curTcpModel.fromId
+                                acceptCall()
+                                if (TextUtils.isEmpty(curInteractionVO.toSipId)) {
+                                    //通话失败,重置并返回主界面
+                                    showMessage("targetSipId为空!")
+                                    Constant.CALL_STATE = Constant.CALL_STANDBY
+                                    VoiceUtil.handoffAudioCall(Constant.DEVICE_ID, fromId, Constant.interactionId)
+                                    callEnd()
+                                }
+                            } else if (curTcpModel.getAction() == TcpAction.VoiceAction.REJECT) {
+                                //我方呼出,对方拒绝
+                                showMessage("对方已拒绝!")
+                                RingPlayHelper.stopRingTone()
+                                cancelCall()
+                            } else if (curTcpModel.getAction() == TcpAction.VoiceAction.CALLING) {
+                                //我方呼出,对方通话中
+                                showMessage("对方正在忙线中,暂时无法接听!")
+                                /*AppTool.Time.delay(1000) {
+                                RingPlayHelper.stopRingTone()
+                                cancelCall()
+                            }*/
+                            } else if (curTcpModel.getAction() == TcpAction.VoiceAction.SUCCESS) {
+                                //呼叫成功
+                                //本机呼叫的时候tcpModel为空,只有呼叫成功的时候才能获得对应tcp相关数据
+                                callSuccess = true
+                                sip_voice_call_hangup.isEnabled = true
+                                interactionVO = curInteractionVO
+                                Constant.interactionId = curInteractionVO.id
+                                showOutgoingCall()
+                            } else if (curTcpModel.getAction() == TcpAction.VoiceAction.FAILED) {
+                                //我方呼出,对方不在线,设备离线或其它错误
+                                callSuccess = true
+                                showMessage("呼叫失败,找不到设备或对方不在线!")
+                                RingPlayHelper.stopRingTone()
+                                cancelCall()
+                            } else if (curTcpModel.getAction() == TcpAction.VoiceAction.HANDOFF) {
+                                //对方挂断,不论我方呼出或呼入
+                                if (Constant.interactionId == curInteractionVO.id) {
+                                    RingPlayHelper.stopRingTone()
+                                    cancelCall()
+                                }
+                            } else if (curTcpModel.getAction() == TcpAction.VoiceAction.CANCEL) {
+                                //对方呼叫时取消
+                                if (Constant.interactionId == curInteractionVO.id) {
+                                    RingPlayHelper.stopRingTone()
+                                    cancelCall()
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            //外部呼叫按键
+            Constant.EVENT_SERIAL_EVENT -> {
+                if (messageEvent.message is String) {
+                    val serialAction = messageEvent.message as String
+                    if (serialAction.equals("cancel")) {
+                        RingPlayHelper.stopRingTone()
+                        Constant.CALL_STATE = Constant.CALL_STANDBY
+                        VoiceUtil.cancelAudioCall(Constant.DEVICE_ID)
+                        cancelCall()
+                    } else if (serialAction.equals("accept")) {
+                        RingPlayHelper.stopRingTone()
+                        Constant.CALL_STATE = Constant.CALL_CALLING
+                        VoiceUtil.acceptAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
+                        acceptCall()
+                    } else if (serialAction.equals("handoff")) {
+                        Constant.CALL_STATE = Constant.CALL_STANDBY
+                        VoiceUtil.handoffAudioCall(Constant.DEVICE_ID, fromId, Constant.interactionId)
+                        callEnd()
+                    } else if (serialAction.equals("reject")) {
+                        RingPlayHelper.stopRingTone()
+                        Constant.CALL_STATE = Constant.CALL_STANDBY
+                        VoiceUtil.rejectAudioCall(Constant.DEVICE_ID, fromId, interactionVO?.id)
+                        callEnd()
+                    }
+                }
+            }
+        }
+    }
+
+}

callingbed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/SkyCallFragment.kt → callingbed/src/main/java/com/wdkl/app/ncs/callingbed/fragment/SkyCallFragment.kt.bak


+ 5 - 5
callingbed/src/main/java/com/wdkl/app/ncs/callingbed/sip/SipHelper.java.bak

@@ -29,11 +29,11 @@ import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.List;
 
-import static com.wdkl.app.ncs.callingbed.sip.SipStatus.REGISTERCOM;
-import static com.wdkl.app.ncs.callingbed.sip.SipStatus.REGISTERFAIL;
-import static com.wdkl.app.ncs.callingbed.sip.SipStatus.REGISTERING;
 import static com.vvsip.ansip.VvsipTask.EXOSIP_CALL_CLOSED;
 import static com.wdkl.ncs.android.middleware.common.Constant.EVENT_SIP_REGISTER_STATUS;
+import static com.wdkl.ncs.android.middleware.common.SipStatus.REGISTERCOM;
+import static com.wdkl.ncs.android.middleware.common.SipStatus.REGISTERFAIL;
+import static com.wdkl.ncs.android.middleware.common.SipStatus.REGISTERING;
 
 
 public class SipHelper {
@@ -124,8 +124,8 @@ public class SipHelper {
         sipPWD = pwd;
     }
 
-    public void setSipListner(IVvsipServiceListener listner) {
-        sipListner = listner;
+    public void setSipListner(IVvsipServiceListener listener) {
+        sipListner = listener;
     }
 
     /*public void addSipListner(IVvsipServiceListener listner) {

+ 120 - 0
callingbed/src/main/res/layout/sip_voice_call_layout.xml

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout>
+    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/gray_deep">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <!--语音呼叫layout-->
+            <LinearLayout
+                android:id="@+id/ll_sip_voice_call"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center_horizontal"
+                android:orientation="vertical">
+
+                <ImageView
+                    android:id="@+id/sip_voice_call_head_img"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:layout_marginTop="100dp"
+                    android:scaleType="centerInside"
+                    android:src="@drawable/ic_nurse" />
+
+                <TextView
+                    android:id="@+id/sip_voice_call_calling_text"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="20dp"
+                    android:gravity="center"
+                    android:text="正在呼叫..."
+                    android:textColor="#9E9E9F"
+                    android:textSize="32sp" />
+
+                <TextView
+                    android:id="@+id/sip_voice_call_timeout"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="20dp"
+                    android:gravity="center"
+                    android:text="倒计时: 00"
+                    android:textColor="#9E9E9F"
+                    android:textSize="24sp" />
+            </LinearLayout>
+
+            <!--呼出-->
+            <LinearLayout
+                android:id="@+id/ll_sip_voice_call_outgoing"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignParentBottom="true"
+                android:layout_centerHorizontal="true"
+                android:layout_marginBottom="40dp"
+                android:gravity="center_horizontal"
+                android:orientation="vertical"
+                android:visibility="visible">
+
+                <Chronometer
+                    android:id="@+id/sip_voice_call_timer"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:text="00:00"
+                    android:textColor="@color/white"
+                    android:textSize="24sp" />
+
+                <ImageView
+                    android:id="@+id/sip_voice_call_hangup"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:layout_marginTop="20dp"
+                    android:src="@drawable/selector_call_hangup"
+                    android:visibility="gone"/>
+            </LinearLayout>
+
+            <!--来电-->
+            <LinearLayout
+                android:id="@+id/ll_sip_voice_call_incoming"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_alignParentBottom="true"
+                android:layout_centerHorizontal="true"
+                android:layout_marginBottom="40dp"
+                android:gravity="bottom"
+                android:orientation="horizontal"
+                android:visibility="gone">
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="2" />
+
+                <ImageView
+                    android:id="@+id/sip_voice_call_ring_reject"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:src="@drawable/selector_call_hangup" />
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="1" />
+
+                <ImageView
+                    android:id="@+id/sip_voice_call_ring_pickup_audio"
+                    android:layout_width="100dp"
+                    android:layout_height="100dp"
+                    android:src="@drawable/selector_call_answer" />
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="1dp"
+                    android:layout_weight="2" />
+            </LinearLayout>
+        </RelativeLayout>
+    </FrameLayout>
+</layout>

+ 1 - 1
common/build.gradle

@@ -173,7 +173,7 @@ dependencies {
     /**
      * google
      */
-    compile 'com.google.guava:guava:23.0'
+    //compile 'com.google.guava:guava:23.0'
 
     /**
      *  七巧板框架

+ 19 - 12
common/src/main/code/com/wdkl/ncs/android/lib/base/BaseActivity.kt

@@ -4,19 +4,16 @@ import android.content.Context
 import android.content.Intent
 import android.databinding.DataBindingUtil
 import android.databinding.ViewDataBinding
+import android.os.Build
 import android.os.Bundle
 import android.view.View
 import android.view.Window
 import android.view.WindowManager
 import android.view.inputmethod.InputMethodManager
 import com.enation.javashop.android.jrouter.JRouter
-import com.wdkl.ncs.android.lib.R
+import com.enation.javashop.utils.base.tool.BaseToolActivity
 import com.wdkl.ncs.android.lib.utils.debugLog
 import com.wdkl.ncs.android.lib.utils.errorLog
-import com.enation.javashop.utils.base.tool.BaseToolActivity
-import com.enation.javashop.utils.base.tool.CommonTool
-import com.enation.javashop.utils.base.widget.LoadingDialog
-import kotlinx.android.synthetic.main.custom_loading.view.*
 import java.lang.reflect.Field
 import javax.inject.Inject
 
@@ -78,12 +75,20 @@ abstract class BaseActivity<PresenterType : BaseContract.BasePresenter, DataBind
         }
         /**父类初始化*/
         super.onCreate(savedInstanceState)
-        window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN or
-                WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON or
-                WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
-                WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON)
 
-        requestWindowFeature(Window.FEATURE_NO_TITLE)
+        if ("WDFJ-I".equals(Build.MODEL)) {
+            window.setFlags(
+                WindowManager.LayoutParams.FLAG_FULLSCREEN,
+                WindowManager.LayoutParams.FLAG_FULLSCREEN
+            )
+        } else {
+            window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN or
+                    WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON or
+                    WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
+                    WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON)
+
+            requestWindowFeature(Window.FEATURE_NO_TITLE)
+        }
 
         /**执行生命周期监听*/
         lifeCycleDo(LIFE_CYCLE_CREATE)
@@ -94,8 +99,10 @@ abstract class BaseActivity<PresenterType : BaseContract.BasePresenter, DataBind
         /**设置根视图到Activity*/
         setContentView(rootView)
 
-        //解决全屏显示时弹出界面会跳一下的问题
-        window.decorView.systemUiVisibility = FULL_SCREEN_FLAG
+        if (!"WDFJ-I".equals(Build.MODEL)) {
+            //解决全屏显示时弹出界面会跳一下的问题
+            window.decorView.systemUiVisibility = FULL_SCREEN_FLAG
+        }
 
         /**执行抽象方法初始化Dagger相应操作*/
         bindDagger()

+ 1 - 1
common/src/main/code/com/wdkl/ncs/android/lib/utils/UUID.kt

@@ -47,7 +47,7 @@ class UUID {
                     macAddress = info.macAddress
                 }
             }
-            return macAddress
+            return "0123456789"
         }
 
         fun refreshUUID(id : String){

+ 4 - 2
middleware/src/main/code/com/wdkl/ncs/android/middleware/tcp/dto/TcpModel.java

@@ -1,8 +1,10 @@
 package com.wdkl.ncs.android.middleware.tcp.dto;
 
+import android.text.TextUtils;
+
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.google.common.base.Strings;
+//import com.google.common.base.Strings;
 import com.wdkl.ncs.android.middleware.model.dos.DeviceDO;
 import com.wdkl.ncs.android.middleware.model.dos.FrameDO;
 import com.wdkl.ncs.android.middleware.model.vo.InteractionVO;
@@ -88,7 +90,7 @@ public class TcpModel implements Serializable {
     }
 
     public static TcpModel getModelByJson(String tcpModelJsonString){
-        if (Strings.isNullOrEmpty(tcpModelJsonString)){
+        if (TextUtils.isEmpty(tcpModelJsonString)){
             return null;
         }
         TcpModel tcpModel = new TcpModel();

+ 2 - 1
settings.gradle

@@ -1,3 +1,4 @@
-include ':app', ':common', ':welcome', ':home', ':resource', ':middleware', ':extra', ':callingbed', ':bedlib', ':janus'
+include ':app', ':common', ':welcome', ':home', ':resource', ':middleware', ':extra', ':callingbed', ':bedlib', 'sip2'
 
 //'webrtc', 'rtc-chat', 'libwebrtc'
+//':janus'

+ 10 - 6
welcome/src/main/code/com/wdkl/ncs/android/component/welcome/activity/WelcomeActivity.kt

@@ -2,6 +2,7 @@ package com.wdkl.ncs.android.component.welcome.activity
 
 import android.Manifest
 import android.graphics.Color
+import android.os.Build
 import com.wdkl.ncs.android.component.welcome.launch.WelcomeLaunch
 import com.enation.javashop.android.jrouter.external.annotation.Router
 import com.wdkl.ncs.android.lib.base.BaseActivity
@@ -62,10 +63,13 @@ class WelcomeActivity :BaseActivity<WelcomePresenter, ActivityWelcomeBinding>(),
      * @Note   初始化
      */
     override fun init() {
-        AppTool.SystemUI.showNavigationBar(this,false)
-        AppTool.SystemUI.ImmersiveWithBottomBarColor(this,Color.BLACK)
-        requestPermissions()
-        //toHome()
+        if ("WDFJ-I".equals(Build.MODEL)) {
+            toHome()
+        } else {
+            AppTool.SystemUI.showNavigationBar(this,false)
+            AppTool.SystemUI.ImmersiveWithBottomBarColor(this,Color.BLACK)
+            requestPermissions()
+        }
     }
 
     private fun requestPermissions(){
@@ -159,7 +163,7 @@ class WelcomeActivity :BaseActivity<WelcomePresenter, ActivityWelcomeBinding>(),
      */
     override fun onResume() {
         super.onResume()
-        reloadWithVoiNet()
+        //reloadWithVoiNet()
     }
 
     /**
@@ -185,7 +189,7 @@ class WelcomeActivity :BaseActivity<WelcomePresenter, ActivityWelcomeBinding>(),
         },onWifi = {
             debugLog("Welcome","wifi")
         },offline = {
-            noneNetDo()
+            //noneNetDo()
         })
     }