|
@@ -84,6 +84,8 @@ import serialporttest.utils.SerialPortUtil
|
|
import java.io.*
|
|
import java.io.*
|
|
import java.lang.Process
|
|
import java.lang.Process
|
|
import java.util.*
|
|
import java.util.*
|
|
|
|
+import java.util.concurrent.Executors
|
|
|
|
+import java.util.concurrent.ScheduledExecutorService
|
|
import java.util.concurrent.TimeUnit
|
|
import java.util.concurrent.TimeUnit
|
|
import kotlin.collections.ArrayList
|
|
import kotlin.collections.ArrayList
|
|
|
|
|
|
@@ -146,7 +148,9 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
//网络异常计数
|
|
//网络异常计数
|
|
private var netErrCount : Int = 0
|
|
private var netErrCount : Int = 0
|
|
|
|
|
|
- private var sleepCountdown = false
|
|
|
|
|
|
+ private var executor: ScheduledExecutorService? = null
|
|
|
|
+
|
|
|
|
+ /*private var sleepCountdown = false
|
|
private val updateHandler: Handler = object : Handler(Looper.getMainLooper()) {
|
|
private val updateHandler: Handler = object : Handler(Looper.getMainLooper()) {
|
|
override fun handleMessage(msg: Message) {
|
|
override fun handleMessage(msg: Message) {
|
|
//熄屏时间到,当前是夜晚且亮度为0则切换到黑屏界面
|
|
//熄屏时间到,当前是夜晚且亮度为0则切换到黑屏界面
|
|
@@ -176,7 +180,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
|
|
|
fun turnScreenOff() {
|
|
fun turnScreenOff() {
|
|
black_view.visibility = View.VISIBLE
|
|
black_view.visibility = View.VISIBLE
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
//志合A133平台sdk
|
|
//志合A133平台sdk
|
|
@@ -299,6 +303,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
SerialPortHelper.setDoorLight(0, "000")
|
|
SerialPortHelper.setDoorLight(0, "000")
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ BaseApplication.userTouchTime = System.currentTimeMillis()
|
|
|
|
|
|
app_version.text = "V" + CommonUtils.getAppVersionName(BaseApplication.appContext)
|
|
app_version.text = "V" + CommonUtils.getAppVersionName(BaseApplication.appContext)
|
|
|
|
|
|
@@ -351,6 +356,36 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
//去掉呼叫床位和取消呼叫菜单
|
|
//去掉呼叫床位和取消呼叫菜单
|
|
room_action_call_bed.visibility = View.GONE
|
|
room_action_call_bed.visibility = View.GONE
|
|
room_cancel_call.visibility = View.GONE
|
|
room_cancel_call.visibility = View.GONE
|
|
|
|
+
|
|
|
|
+ startScheduledExecutor()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ ** 启动一个定时任务执行检测
|
|
|
|
+ */
|
|
|
|
+ private fun startScheduledExecutor() {
|
|
|
|
+ executor = Executors.newSingleThreadScheduledExecutor()
|
|
|
|
+ executor!!.scheduleAtFixedRate({
|
|
|
|
+ try {
|
|
|
|
+ runOnUiThread {
|
|
|
|
+ updateNetState()
|
|
|
|
+ if (initialized) {
|
|
|
|
+ updateSettings(false)
|
|
|
|
+ updateTcpState()
|
|
|
|
+
|
|
|
|
+ /*if (SettingConfig.getDoorLightAlwaysOn(activity) == 0) {
|
|
|
|
+ checkHandleCall()
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ if (Constant.LATER_RESTART && Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
|
|
+ AppUpdateHelper.restartApp()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch (e: Exception) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }, 100, 60, TimeUnit.SECONDS)
|
|
}
|
|
}
|
|
|
|
|
|
private fun checkAppExist() : Boolean {
|
|
private fun checkAppExist() : Boolean {
|
|
@@ -544,8 +579,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
|
|
|
|
fun switchFragment(id: Int, fragment: Fragment, tag: String) {
|
|
fun switchFragment(id: Int, fragment: Fragment, tag: String) {
|
|
- resetSleepTime()
|
|
|
|
-
|
|
|
|
supportFragmentManager.beginTransaction()
|
|
supportFragmentManager.beginTransaction()
|
|
.replace(id, fragment, tag)
|
|
.replace(id, fragment, tag)
|
|
.commitAllowingStateLoss()
|
|
.commitAllowingStateLoss()
|
|
@@ -553,8 +586,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
|
|
|
|
fun addCallFragment(fragment: Fragment) {
|
|
fun addCallFragment(fragment: Fragment) {
|
|
- cancelSleep()
|
|
|
|
- black_view.visibility = View.GONE
|
|
|
|
|
|
+ screenOn()
|
|
|
|
|
|
skyCallFragment = fragment
|
|
skyCallFragment = fragment
|
|
supportFragmentManager.beginTransaction()
|
|
supportFragmentManager.beginTransaction()
|
|
@@ -613,16 +645,12 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
|
|
|
override fun bindEvent() {
|
|
override fun bindEvent() {
|
|
black_view.setOnClickListener {
|
|
black_view.setOnClickListener {
|
|
- resetSleepTime()
|
|
|
|
- black_view.visibility = View.GONE
|
|
|
|
|
|
+ screenOn()
|
|
return@setOnClickListener
|
|
return@setOnClickListener
|
|
}
|
|
}
|
|
|
|
|
|
//护理按钮
|
|
//护理按钮
|
|
room_action_nurse.setOnLongClickListener {
|
|
room_action_nurse.setOnLongClickListener {
|
|
- //重置黑屏时间
|
|
|
|
- resetSleepTime()
|
|
|
|
-
|
|
|
|
if (!Constant.TCP_CONNECTED) {
|
|
if (!Constant.TCP_CONNECTED) {
|
|
showMessage(R.string.net_error)
|
|
showMessage(R.string.net_error)
|
|
return@setOnLongClickListener true
|
|
return@setOnLongClickListener true
|
|
@@ -679,17 +707,11 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
|
|
|
|
room_action_nurse.setOnClickListener {
|
|
room_action_nurse.setOnClickListener {
|
|
- //重置黑屏时间
|
|
|
|
- resetSleepTime()
|
|
|
|
-
|
|
|
|
showMessage(R.string.enter_nursing_tips)
|
|
showMessage(R.string.enter_nursing_tips)
|
|
}
|
|
}
|
|
|
|
|
|
//增援按钮
|
|
//增援按钮
|
|
room_action_support.setOnClickListener {
|
|
room_action_support.setOnClickListener {
|
|
- //重置黑屏时间
|
|
|
|
- resetSleepTime()
|
|
|
|
-
|
|
|
|
if (Constant.TCP_CONNECTED) {
|
|
if (Constant.TCP_CONNECTED) {
|
|
if (Constant.DEVICE_ID != -1) {
|
|
if (Constant.DEVICE_ID != -1) {
|
|
OtherUtil.sendReinforce(Constant.DEVICE_ID)
|
|
OtherUtil.sendReinforce(Constant.DEVICE_ID)
|
|
@@ -709,9 +731,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
|
|
|
//呼叫按钮
|
|
//呼叫按钮
|
|
room_action_call.setOnClickListener {
|
|
room_action_call.setOnClickListener {
|
|
- //重置黑屏时间
|
|
|
|
- resetSleepTime()
|
|
|
|
-
|
|
|
|
val time = System.currentTimeMillis()
|
|
val time = System.currentTimeMillis()
|
|
if (time - clickTime > 2000) {
|
|
if (time - clickTime > 2000) {
|
|
//防止重复点击
|
|
//防止重复点击
|
|
@@ -738,9 +757,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
|
|
|
|
room_action_call_bed.setOnClickListener {
|
|
room_action_call_bed.setOnClickListener {
|
|
- //重置黑屏时间
|
|
|
|
- resetSleepTime()
|
|
|
|
-
|
|
|
|
if (Utils.getInBedVOS().size > 0) {
|
|
if (Utils.getInBedVOS().size > 0) {
|
|
CallbedDialogHelper.showDialog(activity, object : CallbedDialogHelper.ClickListener {
|
|
CallbedDialogHelper.showDialog(activity, object : CallbedDialogHelper.ClickListener {
|
|
override fun onVideoClick(bedVO: FrameBedVO?) {
|
|
override fun onVideoClick(bedVO: FrameBedVO?) {
|
|
@@ -766,9 +782,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
|
|
|
//门口机取消分机呼叫
|
|
//门口机取消分机呼叫
|
|
room_cancel_call.setOnClickListener {
|
|
room_cancel_call.setOnClickListener {
|
|
- //重置黑屏时间
|
|
|
|
- resetSleepTime()
|
|
|
|
-
|
|
|
|
if (Constant.TCP_CONNECTED) {
|
|
if (Constant.TCP_CONNECTED) {
|
|
if (Constant.DEVICE_ID != -1) {
|
|
if (Constant.DEVICE_ID != -1) {
|
|
VoiceUtil.cancelCallByDoor(Constant.DEVICE_ID)
|
|
VoiceUtil.cancelCallByDoor(Constant.DEVICE_ID)
|
|
@@ -784,9 +797,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
|
|
|
|
app_version.setOnLongClickListener {
|
|
app_version.setOnLongClickListener {
|
|
- //重置黑屏时间
|
|
|
|
- resetSleepTime()
|
|
|
|
-
|
|
|
|
AppInfoDialogHelper.showAppDialog(activity,
|
|
AppInfoDialogHelper.showAppDialog(activity,
|
|
{ dialog, which -> AppUpdateHelper.reboot(activity) },
|
|
{ dialog, which -> AppUpdateHelper.reboot(activity) },
|
|
{ dialog, which ->
|
|
{ dialog, which ->
|
|
@@ -802,9 +812,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
|
|
|
//if ("rk3288".equals(Build.MODEL)) {
|
|
//if ("rk3288".equals(Build.MODEL)) {
|
|
app_version.setOnClickListener {
|
|
app_version.setOnClickListener {
|
|
- //重置黑屏时间
|
|
|
|
- resetSleepTime()
|
|
|
|
-
|
|
|
|
if (System.currentTimeMillis() - clickVersionTime < 1500) {
|
|
if (System.currentTimeMillis() - clickVersionTime < 1500) {
|
|
clickCount++
|
|
clickCount++
|
|
} else {
|
|
} else {
|
|
@@ -844,9 +851,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
|
|
|
|
room_action_blue_code.setOnClickListener {
|
|
room_action_blue_code.setOnClickListener {
|
|
- //重置黑屏时间
|
|
|
|
- resetSleepTime()
|
|
|
|
-
|
|
|
|
if (Constant.TCP_CONNECTED) {
|
|
if (Constant.TCP_CONNECTED) {
|
|
if (Constant.DEVICE_ID != -1) {
|
|
if (Constant.DEVICE_ID != -1) {
|
|
if (Constant.inBlueCode) {
|
|
if (Constant.inBlueCode) {
|
|
@@ -913,12 +917,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
handler.removeCallbacksAndMessages(null)
|
|
handler.removeCallbacksAndMessages(null)
|
|
}
|
|
}
|
|
|
|
|
|
- override fun onResume() {
|
|
|
|
- super.onResume()
|
|
|
|
- //重置黑屏时间
|
|
|
|
- resetSleepTime()
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
override fun destory() {
|
|
override fun destory() {
|
|
SoundPoolManager.getInstance().release()
|
|
SoundPoolManager.getInstance().release()
|
|
unRegReceiver()
|
|
unRegReceiver()
|
|
@@ -932,7 +930,9 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
SerialPortUtil.getInstance().closeSerialPort()
|
|
SerialPortUtil.getInstance().closeSerialPort()
|
|
//}
|
|
//}
|
|
|
|
|
|
- cancelSleep()
|
|
|
|
|
|
+ if (executor != null) {
|
|
|
|
+ executor!!.shutdownNow()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//数据加载错误
|
|
//数据加载错误
|
|
@@ -1166,9 +1166,6 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|
|
|
|
Constant.SLEEP_MINUTE = partSetting.sleepSecondsDoor
|
|
Constant.SLEEP_MINUTE = partSetting.sleepSecondsDoor
|
|
Constant.NIGHT_BRIGHTNESS = partSetting.nightLight
|
|
Constant.NIGHT_BRIGHTNESS = partSetting.nightLight
|
|
- if (sleepCountdown) {
|
|
|
|
- resetSleepTime()
|
|
|
|
- }
|
|
|
|
|
|
|
|
var mic1 = zhylManager.sys_getMic1gain(BaseApplication.appContext)
|
|
var mic1 = zhylManager.sys_getMic1gain(BaseApplication.appContext)
|
|
var yl2 = zhylManager.sys_getDacVolume(BaseApplication.appContext)
|
|
var yl2 = zhylManager.sys_getDacVolume(BaseApplication.appContext)
|
|
@@ -1213,8 +1210,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
showMessage("current version: " + versionName + "_" + versionCode + ", new version: " + newAppVersion + "_" + appInfo.versionNo)
|
|
showMessage("current version: " + versionName + "_" + versionCode + ", new version: " + newAppVersion + "_" + appInfo.versionNo)
|
|
|
|
|
|
if (versionCode < appInfo.versionNo) {
|
|
if (versionCode < appInfo.versionNo) {
|
|
- cancelSleep()
|
|
|
|
- black_view.visibility = View.GONE
|
|
|
|
|
|
+ screenOn()
|
|
|
|
|
|
if (Constant.silentUpdate) {
|
|
if (Constant.silentUpdate) {
|
|
Constant.APP_UPDATING = true
|
|
Constant.APP_UPDATING = true
|
|
@@ -1249,7 +1245,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
private fun regReceiver() {
|
|
private fun regReceiver() {
|
|
receiver = TimeReceiver()
|
|
receiver = TimeReceiver()
|
|
val intentFilter = IntentFilter()
|
|
val intentFilter = IntentFilter()
|
|
- intentFilter.addAction(Intent.ACTION_TIME_TICK)
|
|
|
|
|
|
+ //intentFilter.addAction(Intent.ACTION_TIME_TICK)
|
|
intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION)
|
|
intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION)
|
|
registerReceiver(receiver, intentFilter)
|
|
registerReceiver(receiver, intentFilter)
|
|
}
|
|
}
|
|
@@ -1266,7 +1262,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
Log.d("serialPortBedOnclick", "按键: buffer[0]=" + buffer[0] + ", buffer[9]=" + buffer[9]
|
|
Log.d("serialPortBedOnclick", "按键: buffer[0]=" + buffer[0] + ", buffer[9]=" + buffer[9]
|
|
+ ", buffer[10]=" + buffer[10] + ", buffer[11]=" + buffer[11])
|
|
+ ", buffer[10]=" + buffer[10] + ", buffer[11]=" + buffer[11])
|
|
//如果是黑屏状态则先切换到正常界面
|
|
//如果是黑屏状态则先切换到正常界面
|
|
- if (black_view.visibility == View.VISIBLE) {
|
|
|
|
|
|
+ //if (black_view.visibility == View.VISIBLE) {
|
|
if (buffer[0].toInt() == 1 || buffer[0].toInt() == 2
|
|
if (buffer[0].toInt() == 1 || buffer[0].toInt() == 2
|
|
|| buffer[5].toInt() == 1 || buffer[5].toInt() == 2
|
|
|| buffer[5].toInt() == 1 || buffer[5].toInt() == 2
|
|
|| buffer[6].toInt() == 1 || buffer[6].toInt() == 2
|
|
|| buffer[6].toInt() == 1 || buffer[6].toInt() == 2
|
|
@@ -1275,12 +1271,14 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
|| buffer[10].toInt() == 1 || buffer[10].toInt() == 2
|
|
|| buffer[10].toInt() == 1 || buffer[10].toInt() == 2
|
|
|| buffer[11].toInt() == 1 || buffer[11].toInt() == 2) {
|
|
|| buffer[11].toInt() == 1 || buffer[11].toInt() == 2) {
|
|
|
|
|
|
|
|
+ //记录用户按键时间
|
|
|
|
+ BaseApplication.userTouchTime = System.currentTimeMillis()
|
|
|
|
+
|
|
runOnUiThread {
|
|
runOnUiThread {
|
|
- cancelSleep()
|
|
|
|
- black_view.visibility = View.GONE
|
|
|
|
|
|
+ screenOn()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ //}
|
|
|
|
|
|
//测试模式
|
|
//测试模式
|
|
if (testFragment == curFragment) {
|
|
if (testFragment == curFragment) {
|
|
@@ -1369,16 +1367,14 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
//插簧按键为H1
|
|
//插簧按键为H1
|
|
Log.d("forkSpringData", "插簧状态: $data")
|
|
Log.d("forkSpringData", "插簧状态: $data")
|
|
//如果是黑屏状态则先切换到正常界面
|
|
//如果是黑屏状态则先切换到正常界面
|
|
- if (black_view.visibility == View.VISIBLE) {
|
|
|
|
|
|
+ //if (black_view.visibility == View.VISIBLE) {
|
|
//插簧手柄放下
|
|
//插簧手柄放下
|
|
if (data == 0) {
|
|
if (data == 0) {
|
|
runOnUiThread {
|
|
runOnUiThread {
|
|
- cancelSleep()
|
|
|
|
- black_view.visibility = View.GONE
|
|
|
|
|
|
+ screenOn()
|
|
}
|
|
}
|
|
- //return
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ //}
|
|
|
|
|
|
//测试模式
|
|
//测试模式
|
|
if (testFragment == curFragment) {
|
|
if (testFragment == curFragment) {
|
|
@@ -1569,9 +1565,7 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
if (tcpModel.type == TcpType.VOICE) {
|
|
if (tcpModel.type == TcpType.VOICE) {
|
|
val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
if (tcpModel.action == TcpAction.VoiceAction.CALL) {
|
|
if (tcpModel.action == TcpAction.VoiceAction.CALL) {
|
|
- if (black_view.visibility == View.VISIBLE) {
|
|
|
|
- black_view.visibility = View.GONE
|
|
|
|
- }
|
|
|
|
|
|
+ screenOn()
|
|
|
|
|
|
Constant.fromId = tcpModel.fromId
|
|
Constant.fromId = tcpModel.fromId
|
|
Constant.TARGET_SIP = interactionVO.fromSipId
|
|
Constant.TARGET_SIP = interactionVO.fromSipId
|
|
@@ -1599,9 +1593,8 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
if (Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
RingPlayHelper.stopRingTone()
|
|
RingPlayHelper.stopRingTone()
|
|
}
|
|
}
|
|
- if (black_view.visibility == View.VISIBLE) {
|
|
|
|
- black_view.visibility = View.GONE
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ screenOn()
|
|
SoundPoolManager.getInstance().playSound(6, 1.0f, 1.0f, 0)
|
|
SoundPoolManager.getInstance().playSound(6, 1.0f, 1.0f, 0)
|
|
Utils.showToastWithImage("Responded")
|
|
Utils.showToastWithImage("Responded")
|
|
} else if (tcpModel.action == TcpAction.VoiceAction.SUCCESS) {
|
|
} else if (tcpModel.action == TcpAction.VoiceAction.SUCCESS) {
|
|
@@ -2028,15 +2021,13 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
//Log.w(TAG, "Constant.day_state: ${Constant.day_state}, night brightness: ${Constant.NIGHT_BRIGHTNESS}")
|
|
//Log.w(TAG, "Constant.day_state: ${Constant.day_state}, night brightness: ${Constant.NIGHT_BRIGHTNESS}")
|
|
if (Constant.day_state == 1) {
|
|
if (Constant.day_state == 1) {
|
|
//夜晚
|
|
//夜晚
|
|
- if (!Constant.IS_RECORDING && !sleepCountdown && skyCallFragment == null && black_view.visibility == View.GONE) {
|
|
|
|
- black_view.visibility = View.VISIBLE
|
|
|
|
|
|
+ if (!Constant.IS_RECORDING && skyCallFragment == null && (System.currentTimeMillis() - BaseApplication.userTouchTime > 60*1000)) {
|
|
|
|
+ screenOff()
|
|
}
|
|
}
|
|
//Log.w(TAG, "sleepCountdown: $sleepCountdown")
|
|
//Log.w(TAG, "sleepCountdown: $sleepCountdown")
|
|
} else {
|
|
} else {
|
|
//白天
|
|
//白天
|
|
- if (black_view.visibility == View.VISIBLE) {
|
|
|
|
- black_view.visibility = View.GONE
|
|
|
|
- }
|
|
|
|
|
|
+ screenOn()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2068,26 +2059,27 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- inner class TimeReceiver: BroadcastReceiver() {
|
|
|
|
- override fun onReceive(context: Context, intent: Intent) {
|
|
|
|
- if (intent.action == Intent.ACTION_TIME_TICK) {
|
|
|
|
- updateNetState()
|
|
|
|
- if (initialized) {
|
|
|
|
- updateSettings(false)
|
|
|
|
- updateTcpState()
|
|
|
|
|
|
+ fun screenOn() {
|
|
|
|
+ try {
|
|
|
|
+ val zhylManager = ZhylManager.getInstance(BaseApplication.appContext)
|
|
|
|
+ zhylManager.disp_setScreenWakeUp()
|
|
|
|
+ } catch (e: Exception) {
|
|
|
|
+ //
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- /*if (SettingConfig.getDoorLightAlwaysOn(activity) == 0) {
|
|
|
|
- checkHandleCall()
|
|
|
|
- }*/
|
|
|
|
|
|
+ fun screenOff() {
|
|
|
|
+ try {
|
|
|
|
+ val zhylManager = ZhylManager.getInstance(BaseApplication.appContext)
|
|
|
|
+ zhylManager.disp_setScreenSleep()
|
|
|
|
+ } catch (e: Exception) {
|
|
|
|
+ //
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- if (Constant.LATER_RESTART && Constant.CALL_STATE == Constant.CALL_STANDBY) {
|
|
|
|
- AppUpdateHelper.restartApp()
|
|
|
|
- }
|
|
|
|
- } else if (TextUtils.isEmpty(Constant.TCP_SERVER_URL)) {
|
|
|
|
- //还未连接tcp服务器
|
|
|
|
- //presenter.loadTcpServerHost()
|
|
|
|
- }
|
|
|
|
- } else if (intent.action == ConnectivityManager.CONNECTIVITY_ACTION) {
|
|
|
|
|
|
+ inner class TimeReceiver: BroadcastReceiver() {
|
|
|
|
+ override fun onReceive(context: Context, intent: Intent) {
|
|
|
|
+ if (intent.action == ConnectivityManager.CONNECTIVITY_ACTION) {
|
|
updateNetState()
|
|
updateNetState()
|
|
}
|
|
}
|
|
}
|
|
}
|