Fix trimming memory from main

This commit is contained in:
Mygod
2019-08-12 13:17:30 +08:00
parent 3770acf561
commit 9ad7d25501
2 changed files with 5 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package be.mygod.vpnhotspot.util
import android.os.Handler
import android.os.HandlerThread
import android.os.Looper
import androidx.annotation.WorkerThread
import androidx.core.os.postDelayed
import com.topjohnwu.superuser.Shell
import timber.log.Timber
@@ -50,6 +51,7 @@ class RootSession : AutoCloseable {
return instance.Transaction()
}
@WorkerThread
fun trimMemory() = monitor.withLock {
val instance = instance ?: return
instance.haltTimeout()