Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 05dd3ff5 authored by Ikram Gabiyev's avatar Ikram Gabiyev
Browse files

Deprecate use of onActivityHidden() in PiP

We should not rely on onActivityHidden()
callback in PiP to reset the PiP state, such as
the re-entry state and the flags indicating whether
PiP has been moved or resized.

For instance, relying on it can lead to issues with SLEEP
and locking of the screen which causes the PiP activity to stop,
as expected, which then triggers onActivityHidden() resetting the state.
This means unlocking from the keyguard, can move PiP to its default
position, losing previous state.

Instead we should rely on transitions. We make sure to detect
if an incoming transition going through the PipTransition handler
contains a change of mode CLOSE with the same PiP component name.
This triggers the state reset.

The cases where we switch apps entering PiP are already handled
since stopSwipePipToHome and startEnterAnimation check for changes
in component names upon entry as well.

Bug: 299642417
Flag: EXEMPT bugfix
Test: enter multi-activity PiP, move PiP, expand, do a back-gesture
  to remove PiP activity, reopen the activity, and re-enter PiP in
  default bounds.
Test: enter PiP, move PiP, expand, quick-switch to a different PiP app,
  enter PiP into default bounds.
Test: enter PiP, move PiP, lock and unlock the screen, observe same PiP
  position
Change-Id: Id59023be234a8573bbe83d405a7ed5f4c8a4aece
parent c51b65b7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment