Fix: Root Installer Freeze (Again)

Improve: Default Uninstaller moved
This commit is contained in:
LooKeR
2021-10-24 20:06:51 +05:30
parent 2aaec7e022
commit ab703de3cd
3 changed files with 27 additions and 44 deletions

View File

@ -15,6 +15,7 @@ import android.widget.FrameLayout
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.DialogFragment
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@ -34,6 +35,8 @@ import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.core.Observable
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.schedulers.Schedulers
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
class ProductFragment() : ScreenFragment(), ProductAdapter.Callbacks {
companion object {
@ -382,11 +385,13 @@ class ProductFragment() : ScreenFragment(), ProductAdapter.Callbacks {
(recyclerView?.adapter as? ProductAdapter)?.setStatus(status)
if (state is DownloadService.State.Success && isResumed) {
state.consume()
AppInstaller
.getInstance(context)?.defaultInstaller?.install(
"",
state.release.cacheFileName
)
viewLifecycleOwner.lifecycleScope.launch(Dispatchers.IO){
AppInstaller
.getInstance(context)?.defaultInstaller?.install(
"",
state.release.cacheFileName
)
}
}
}