Commit 6f114843 by patpat

ButtonTask优化timeout

parent cc99045f
......@@ -73,7 +73,7 @@ class MainActivity : BaseActivity() {
WifiHelpler.connect("BGY-802.1X", "dengquanye", "pat2019@@", "wpa_eap")
MainWebSocket.initialize()
QRCodeTask.getInstance().start()
ButtonTask.getInstance().start()
ButtonTask.start()
}
private fun initView() {
......
......@@ -17,10 +17,10 @@ object ButtonTask {
fun start() {
if (mTimerId < 0) {
mAudioManager = App.getDefault().getSystemService(Context.AUDIO_SERVICE) as AudioManager
mTimerId = TimerHelper.loop({
mTimerId = TimerHelper.loop(Runnable {
val buf = ByteArray(5)
libszxb.devicekey(buf)
Log.i(TAG, String.format("%02x %02x %02x %02x", buf[0], buf[1], buf[2], buf[3]));
// Log.i(TAG, String.format("%02x %02x %02x %02x", buf[0], buf[1], buf[2], buf[3]));
if (buf[1].toInt() == 1) {
mAudioManager!!.adjustStreamVolume(
AudioManager.STREAM_SYSTEM,
......@@ -35,7 +35,6 @@ object ButtonTask {
AudioManager.FLAG_SHOW_UI
)
}
true
}, 200)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment