update 主循环自动继续
This commit is contained in:
@@ -107,9 +107,10 @@ object MyLooper {
|
|||||||
} else {
|
} else {
|
||||||
WeworkController.mainLoopRunning = false
|
WeworkController.mainLoopRunning = false
|
||||||
LogUtils.v("加入指令到执行队列", if (message.fileBase64.isNullOrEmpty()) GsonUtils.toJson(message) else message.type)
|
LogUtils.v("加入指令到执行队列", if (message.fileBase64.isNullOrEmpty()) GsonUtils.toJson(message) else message.type)
|
||||||
getInstance().removeMessages(message.type * message.hashCode() + (System.currentTimeMillis() / 10000).toInt())
|
val messageWhat = message.type * message.hashCode() + (System.currentTimeMillis() / 10000).toInt()
|
||||||
|
getInstance().removeMessages(messageWhat)
|
||||||
getInstance().sendMessage(Message.obtain().apply {
|
getInstance().sendMessage(Message.obtain().apply {
|
||||||
what = message.type * message.hashCode() + (System.currentTimeMillis() / 10000).toInt()
|
what = messageWhat
|
||||||
obj = message.apply {
|
obj = message.apply {
|
||||||
messageId = messageList.messageId
|
messageId = messageList.messageId
|
||||||
apiSend = messageList.apiSend
|
apiSend = messageList.apiSend
|
||||||
|
|||||||
@@ -55,10 +55,10 @@ object WeworkLoopImpl {
|
|||||||
sleep(300)
|
sleep(300)
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
mainLoopRunning = false
|
|
||||||
LogUtils.e("ERROR mainLoop: " + e.message, e)
|
LogUtils.e("ERROR mainLoop: " + e.message, e)
|
||||||
error("ERROR mainLoop: $e")
|
error("ERROR mainLoop: $e")
|
||||||
sleep(Constant.LONG_INTERVAL)
|
sleep(Constant.LONG_INTERVAL)
|
||||||
|
MyLooper.getInstance().removeMessages(WeworkMessageBean.LOOP_RECEIVE_NEW_MESSAGE)
|
||||||
MyLooper.getInstance().sendMessage(Message.obtain().apply {
|
MyLooper.getInstance().sendMessage(Message.obtain().apply {
|
||||||
what = WeworkMessageBean.LOOP_RECEIVE_NEW_MESSAGE
|
what = WeworkMessageBean.LOOP_RECEIVE_NEW_MESSAGE
|
||||||
obj = WeworkMessageBean().apply { type = WeworkMessageBean.LOOP_RECEIVE_NEW_MESSAGE }
|
obj = WeworkMessageBean().apply { type = WeworkMessageBean.LOOP_RECEIVE_NEW_MESSAGE }
|
||||||
@@ -526,10 +526,10 @@ object WeworkLoopImpl {
|
|||||||
if (spotNodeList.size > 0) {
|
if (spotNodeList.size > 0) {
|
||||||
LogUtils.i("发现未读消息: " + spotNodeList.size + "条")
|
LogUtils.i("发现未读消息: " + spotNodeList.size + "条")
|
||||||
log("发现未读消息: " + spotNodeList.size + "条")
|
log("发现未读消息: " + spotNodeList.size + "条")
|
||||||
if (AccessibilityUtil.performClick(spotNodeList.first())) {
|
if (AccessibilityUtil.performClick(spotNodeList.firstOrNull())) {
|
||||||
//进入聊天页 下一步 getChatMessageList
|
//进入聊天页 下一步 getChatMessageList
|
||||||
} else {
|
} else {
|
||||||
AccessibilityUtil.clickByNode(WeworkController.weworkService, spotNodeList.first().parent)
|
AccessibilityUtil.clickByNode(WeworkController.weworkService, spotNodeList.firstOrNull()?.parent)
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user