Compare commits
1 commit
75fe24e825
...
8591f035a4
Author | SHA1 | Date | |
---|---|---|---|
8591f035a4 |
2 changed files with 11 additions and 9 deletions
|
@ -316,15 +316,11 @@ class DownloadWizardActivity: BaseEuiccAccessActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun beforeNext() {}
|
open fun beforeNext() {}
|
||||||
}
|
|
||||||
|
|
||||||
override fun onStart() {
|
protected fun setKeepScreenOn(enabled: Boolean) {
|
||||||
super.onStart()
|
val flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
|
||||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
val window = (requireActivity() as DownloadWizardActivity).window
|
||||||
}
|
if (enabled) window.addFlags(flags) else window.clearFlags(flags)
|
||||||
|
}
|
||||||
override fun onStop() {
|
|
||||||
super.onStop()
|
|
||||||
window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -96,6 +96,7 @@ 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
|
||||||
|
@ -140,6 +141,11 @@ 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