Refine code style
This commit is contained in:
@@ -18,7 +18,6 @@ import kotlinx.coroutines.channels.produce
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.InterruptedIOException
|
||||
import java.util.concurrent.Executor
|
||||
|
||||
fun ProcessBuilder.fixPath(redirect: Boolean = false) = apply {
|
||||
environment().compute("PATH") { _, value ->
|
||||
@@ -141,7 +140,7 @@ data class StartTethering(private val type: Int,
|
||||
future.complete(error!!)
|
||||
}
|
||||
}
|
||||
TetheringManager.startTethering(type, true, showProvisioningUi, Executor {
|
||||
TetheringManager.startTethering(type, true, showProvisioningUi, {
|
||||
GlobalScope.launch(Dispatchers.Unconfined) { it.run() }
|
||||
}, TetheringManager.proxy(callback))
|
||||
return future.await()?.let { ParcelableInt(it) }
|
||||
|
||||
@@ -15,7 +15,6 @@ import kotlinx.coroutines.channels.ReceiveChannel
|
||||
import kotlinx.coroutines.channels.consumeEach
|
||||
import kotlinx.coroutines.channels.produce
|
||||
import timber.log.Timber
|
||||
import java.util.concurrent.Executor
|
||||
|
||||
object WifiApCommands {
|
||||
@RequiresApi(28)
|
||||
@@ -90,7 +89,7 @@ object WifiApCommands {
|
||||
@RequiresApi(30)
|
||||
override fun onBlockedClientConnecting(client: MacAddress, blockedReason: Int) =
|
||||
push(SoftApCallbackParcel.OnBlockedClientConnecting(client, blockedReason))
|
||||
}, Executor {
|
||||
}) {
|
||||
scope.launch {
|
||||
try {
|
||||
it.run()
|
||||
@@ -98,7 +97,7 @@ object WifiApCommands {
|
||||
finish.completeExceptionally(e)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
try {
|
||||
finish.await()
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user