Compare commits
1 commit
8591f035a4
...
75fe24e825
Author | SHA1 | Date | |
---|---|---|---|
75fe24e825 |
2 changed files with 9 additions and 11 deletions
|
@ -316,11 +316,15 @@ class DownloadWizardActivity: BaseEuiccAccessActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun beforeNext() {}
|
open fun beforeNext() {}
|
||||||
|
|
||||||
protected fun setKeepScreenOn(enabled: Boolean) {
|
|
||||||
val flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
|
|
||||||
val window = (requireActivity() as DownloadWizardActivity).window
|
|
||||||
if (enabled) window.addFlags(flags) else window.clearFlags(flags)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onStart() {
|
||||||
|
super.onStart()
|
||||||
|
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStop() {
|
||||||
|
super.onStop()
|
||||||
|
window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -96,7 +96,6 @@ class DownloadWizardProgressFragment : DownloadWizardActivity.DownloadWizardStep
|
||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
super.onStart()
|
super.onStart()
|
||||||
setKeepScreenOn(true)
|
|
||||||
|
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
showProgressBar(-1) // set indeterminate first
|
showProgressBar(-1) // set indeterminate first
|
||||||
|
@ -141,11 +140,6 @@ class DownloadWizardProgressFragment : DownloadWizardActivity.DownloadWizardStep
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStop() {
|
|
||||||
super.onStop()
|
|
||||||
setKeepScreenOn(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
private suspend fun startDownloadOrSubscribe(): EuiccChannelManagerService.ForegroundTaskSubscriberFlow? =
|
private suspend fun startDownloadOrSubscribe(): EuiccChannelManagerService.ForegroundTaskSubscriberFlow? =
|
||||||
if (state.downloadStarted) {
|
if (state.downloadStarted) {
|
||||||
// This will also return null if task ID is -1 (uninitialized), too
|
// This will also return null if task ID is -1 (uninitialized), too
|
||||||
|
|
Loading…
Add table
Reference in a new issue