Refine code style

This commit is contained in:
Mygod
2020-08-18 05:25:32 +08:00
parent 35055bc074
commit 1029728f22
11 changed files with 14 additions and 20 deletions

View File

@@ -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) }

View File

@@ -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 {