mirror of
https://github.com/recloudstream/cloudstream.git
synced 2025-05-17 19:25:55 +08:00
Use exitProcess on TV (#1529)
This commit is contained in:
@ -182,6 +182,7 @@ import java.net.URLDecoder
|
||||
import java.nio.charset.Charset
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.absoluteValue
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCallback {
|
||||
companion object {
|
||||
@ -615,7 +616,9 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
|
||||
val confirmBeforeExit = settingsManager.getInt(getString(R.string.confirm_exit_key), -1)
|
||||
|
||||
if (confirmBeforeExit == 1 || (confirmBeforeExit == -1 && isLayout(PHONE))) {
|
||||
finish()
|
||||
// finish() causes a bug on some TVs where player
|
||||
// may keep playing after closing the app.
|
||||
if (isLayout(TV)) exitProcess(0) else finish()
|
||||
return
|
||||
}
|
||||
|
||||
@ -629,7 +632,9 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener, BiometricCa
|
||||
if (dontShowAgainCheck.isChecked) {
|
||||
settingsManager.edit().putInt(getString(R.string.confirm_exit_key), 1).commit()
|
||||
}
|
||||
finish()
|
||||
// finish() causes a bug on some TVs where player
|
||||
// may keep playing after closing the app.
|
||||
if (isLayout(TV)) exitProcess(0) else finish()
|
||||
}
|
||||
|
||||
builder.show().setDefaultFocus()
|
||||
|
Reference in New Issue
Block a user