Fix PiP crash with IllegalStateException. Activity must be resumed to enter PiP mode.
https://sentry.tools.element.io/organizations/element/issues/1449388/events/2eb06349f6224481960a64916d51ae60/?project=59
This commit is contained in:
parent
16d42dba4b
commit
750f07547c
1 changed files with 5 additions and 1 deletions
|
|
@ -281,7 +281,11 @@ class ElementCallActivity :
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
override fun enterPipMode(): Boolean {
|
override fun enterPipMode(): Boolean {
|
||||||
return enterPictureInPictureMode(getPictureInPictureParams())
|
return if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
||||||
|
enterPictureInPictureMode(getPictureInPictureParams())
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue