[3.3.0][魔方] 优化连接稳定性
This commit is contained in:
@@ -218,7 +218,7 @@ ext {
|
||||
|
||||
weak_network : "com.mogo.weak:network:1.0.0",
|
||||
|
||||
mofang_runtime : "com.mogo.eagle.core.mofang:runtime:2.0.0"
|
||||
mofang_runtime : "com.mogo.eagle.core.mofang:runtime:2.0.5"
|
||||
]
|
||||
android = [
|
||||
launcherApplicationId : "com.mogo.launcher",
|
||||
|
||||
@@ -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"))
|
||||
}
|
||||
}
|
||||
@@ -320,7 +320,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
mfTest.isEnabled = true
|
||||
mfTest.isEnabled = mf?.isConnected() ?: false
|
||||
mfTest.isChecked = mf?.isEnableTest() ?: false
|
||||
mfTest.setOnCheckedChangeListener { _, isChecked ->
|
||||
mf?.enableTest(isChecked)
|
||||
@@ -410,6 +410,8 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
mfStatusLayout?.also {
|
||||
it.hideLoadingView()
|
||||
it.setClickedTextAndTag("断开魔方连接", 0)
|
||||
mfTest?.isEnabled = true
|
||||
mfTest?.isChecked = CallerDevaToolsManager.mofang()?.isEnableTest() ?: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,6 +419,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
mfStatusLayout?.also {
|
||||
it.hideLoadingView()
|
||||
it.setClickedTextAndTag("开始连接魔方", 1)
|
||||
mfTest?.isEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user