requestGroupInfo in main thread

This commit is contained in:
Mygod
2019-08-01 12:57:08 +08:00
parent e55aa17399
commit 9fb7fd25c1

View File

@@ -258,7 +258,6 @@ class RepeaterService : Service(), CoroutineScope, WifiP2pManager.ChannelListene
} }
registerReceiver(receiver, intentFilter(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION, registerReceiver(receiver, intentFilter(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION,
WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION)) WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION))
launch {
try { try {
p2pManager.requestGroupInfo(channel) { p2pManager.requestGroupInfo(channel) {
when { when {
@@ -274,11 +273,10 @@ class RepeaterService : Service(), CoroutineScope, WifiP2pManager.ChannelListene
} }
} }
} }
} catch (e: SecurityException) { } catch (e: RuntimeException) {
Timber.w(e) Timber.w(e)
startFailure(e.readableMessage) startFailure(e.readableMessage)
} }
}
return START_NOT_STICKY return START_NOT_STICKY
} }
/** /**