Commit 26fb0e5e authored by Mygod's avatar Mygod

Prevent ANR for TFO

parent f4d0835e
...@@ -137,7 +137,7 @@ class App : Application() { ...@@ -137,7 +137,7 @@ class App : Application() {
// handle data restored // handle data restored
if (DataStore.directBootAware && UserManagerCompat.isUserUnlocked(this)) DirectBoot.update() if (DataStore.directBootAware && UserManagerCompat.isUserUnlocked(this)) DirectBoot.update()
TcpFastOpen.enabled(DataStore.publicStore.getBoolean(Key.tfo, TcpFastOpen.sendEnabled)) TcpFastOpen.enabledAsync(DataStore.publicStore.getBoolean(Key.tfo, TcpFastOpen.sendEnabled))
if (DataStore.publicStore.getLong(Key.assetUpdateTime, -1) != info.lastUpdateTime) { if (DataStore.publicStore.getLong(Key.assetUpdateTime, -1) != info.lastUpdateTime) {
val assetManager = assets val assetManager = assets
for (dir in arrayOf("acl", "overture")) for (dir in arrayOf("acl", "overture"))
......
...@@ -52,4 +52,5 @@ object TcpFastOpen { ...@@ -52,4 +52,5 @@ object TcpFastOpen {
"else", "else",
" echo Failed.", " echo Failed.",
"fi"), null, true)?.joinToString("\n") "fi"), null, true)?.joinToString("\n")
fun enabledAsync(value: Boolean) = thread { enabled(value) }.join(1000)
} }
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 to comment