feat: 网络

This commit is contained in:
2025-11-12 18:20:57 +08:00
parent 22ff4384ca
commit 570de3c4e7
24 changed files with 600 additions and 11 deletions
@@ -25,6 +25,7 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.suspendCancellableCoroutine
import timber.log.Timber
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
class DeviceServiceManager(val context: Application) {
@@ -157,7 +158,12 @@ class DeviceServiceManager(val context: Application) {
}
suspend fun getSn() = suspendCancellableCoroutine { continuation ->
systemFuncServiceTodo { service ->
ServiceManager.getSystemFuncService(context) { service ->
if (service == null) {
continuation.resumeWithException(Throwable("没有拿到SN 要重启APP"))
return@getSystemFuncService
}
systemFuncService = service
sn = service.sn
continuation.resume(sn)
}
@@ -187,7 +193,6 @@ class DeviceServiceManager(val context: Application) {
}
systemFuncService = service
todo.invoke(service)
Timber.d(" ${service.sn}")
}
} else {
todo.invoke(systemFuncService!!)