|
@@ -414,7 +414,7 @@ class HomeActivity : BaseActivity<HomeActivityPresenter, ActivityHomeBinding>(),
|
|
watch_activity_home_linyout.setBackgroundResource(R.drawable.main_bg_800x1280)
|
|
watch_activity_home_linyout.setBackgroundResource(R.drawable.main_bg_800x1280)
|
|
btn_callout.setBackgroundResource(R.drawable.round_button_80dp)
|
|
btn_callout.setBackgroundResource(R.drawable.round_button_80dp)
|
|
btn_callout.textSize = 24f
|
|
btn_callout.textSize = 24f
|
|
- } else if ("rk3288".equals(Build.MODEL, true)) {
|
|
|
|
|
|
+ } else if ("rk3288".equals(Build.MODEL, true) || "m3520b_bnkj_zx".equals(Build.MODEL, true)) {
|
|
//亿莱顿,新豪格都是rk3288,亿莱顿在另一个分支上
|
|
//亿莱顿,新豪格都是rk3288,亿莱顿在另一个分支上
|
|
watch_activity_home_linyout.setBackgroundResource(R.drawable.main_bg_1920x1080)
|
|
watch_activity_home_linyout.setBackgroundResource(R.drawable.main_bg_1920x1080)
|
|
btn_callout.setBackgroundResource(R.drawable.round_button_100dp)
|
|
btn_callout.setBackgroundResource(R.drawable.round_button_100dp)
|
|
@@ -633,6 +633,37 @@ class HomeActivity : BaseActivity<HomeActivityPresenter, ActivityHomeBinding>(),
|
|
return result
|
|
return result
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
|
|
|
|
+ Log.d(TAG, "keyDown ====> keyCode: $keyCode, action: ${event?.action}")
|
|
|
|
+ if (keyCode == 135) {
|
|
|
|
+ //手柄拿起
|
|
|
|
+ Log.e(TAG,"手柄拿起 ")
|
|
|
|
+ Constants.hookOn = false
|
|
|
|
+ AppUtils.switchAudioMode(activity, false)
|
|
|
|
+ } else if (keyCode == 134) {
|
|
|
|
+ //手柄放下
|
|
|
|
+ Log.e(TAG,"手柄放下 ")
|
|
|
|
+ Constants.hookOn = true
|
|
|
|
+ AppUtils.switchAudioMode(activity, true)
|
|
|
|
+ if (System.currentTimeMillis() - hookonTime > 2000) {
|
|
|
|
+ if (Constants.CALL_STATE == Constants.CALL_OUTGOING) {
|
|
|
|
+ //呼出取消
|
|
|
|
+ Constants.CALL_STATE = Constants.CALL_STANDBY
|
|
|
|
+ DeviceChannel.calling = false
|
|
|
|
+ VideoUtil.cancelVideoCall(Constants.deviceId, Constants.interactionId)
|
|
|
|
+ EventBus.getDefault().post(MessageEvent("cancel", Constants.EVENT_END_CALL))
|
|
|
|
+ } else if (Constants.CALL_STATE == Constants.CALL_CALLING) {
|
|
|
|
+ Constants.CALL_STATE = Constants.CALL_STANDBY
|
|
|
|
+ DeviceChannel.calling = false
|
|
|
|
+ EventBus.getDefault().post(MessageEvent("handoff", Constants.EVENT_END_CALL))
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ hookonTime = System.currentTimeMillis()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return super.onKeyDown(keyCode, event)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
inner class TimeReceiver: BroadcastReceiver() {
|
|
inner class TimeReceiver: BroadcastReceiver() {
|
|
override fun onReceive(context: Context, intent: Intent) {
|
|
override fun onReceive(context: Context, intent: Intent) {
|