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:
@@ -281,7 +281,11 @@ class ElementCallActivity :
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun enterPipMode(): Boolean {
|
||||
return enterPictureInPictureMode(getPictureInPictureParams())
|
||||
return if (lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
|
||||
enterPictureInPictureMode(getPictureInPictureParams())
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
|
||||
Reference in New Issue
Block a user