[3.3.0][魔方] 优化连接稳定性

This commit is contained in:
renwj
2023-06-30 15:03:58 +08:00
parent 0f6b477f15
commit 6f51faf690
3 changed files with 11 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ internal class MoGoMoFangProviderImpl: IMoGoMoFangProvider, OnMoFangDeviceListen
private val linkedLog by lazy { MoFangLinkedLog().also { executor.setLinkedLog(it) } }
private val isTest by lazy { AtomicBoolean(SPUtils.getInstance().getBoolean(SP_KEY_TEST_ENABLE)) }
private val isTest by lazy { AtomicBoolean(SPUtils.getInstance().getBoolean(SP_KEY_TEST_ENABLE) && isConnected()) }
private var toast: MoGoPopWindow? = null
@@ -292,4 +292,9 @@ internal class MoGoMoFangProviderImpl: IMoGoMoFangProvider, OnMoFangDeviceListen
Toast.makeText(Utils.getApp(), "检测到魔方未正确连接,请在系统蓝牙设置页面,找到魔方并配对连接...", Toast.LENGTH_SHORT).show()
}
}
override fun onBluetoothKeyboardAbnormalDisconnected(status: Int) {
Log.d(TAG, "--- onBluetoothKeyboardAbnormalDisconnected(status: $status) ---")
linkedLog.record(mapOf("callback" to "onBluetoothKeyboardAbnormalDisconnected:$status"))
}
}