In Android Oreo. The activity can go into pip mode and go back to launcher.
https://developer.android.com/guide/topics/ui/picture-in-picture.html
Now I am the launcher. Is there any way to know currently there is a pip windows displayed on the screen?
isInPictureInPictureMode()
only indicate your application pipmode, which will be false if there is other app go into the pip mode.
The intent flags were the same when you exit application and go to pipmode back to launcher.
12-15 03:31:39.580 11671 11671 D FLAG_ACTIVITY_FORWARD_RESULT
12-15 03:31:39.580 11671 11671 D FLAG_ACTIVITY_NEW_TASK
12-15 03:31:39.580 11671 11671 D FLAG_ACTIVITY_PREVIOUS_IS_TOP
12-15 03:31:39.581 11671 11671 D FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
12-15 03:31:39.581 11671 11671 D FLAG_RECEIVER_BOOT_UPGRADE
12-15 03:31:39.581 11671 11671 D FLAG_RECEIVER_FOREGROUND
12-15 03:31:39.581 11671 11671 D FLAG_RECEIVER_INCLUDE_BACKGROUND
12-15 03:31:39.581 11671 11671 D FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS
12-15 03:31:50.174 11671 11671 D FLAG_ACTIVITY_FORWARD_RESULT
12-15 03:31:50.174 11671 11671 D FLAG_ACTIVITY_NEW_TASK
12-15 03:31:50.174 11671 11671 D FLAG_ACTIVITY_PREVIOUS_IS_TOP
12-15 03:31:50.174 11671 11671 D FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
12-15 03:31:50.174 11671 11671 D FLAG_RECEIVER_BOOT_UPGRADE
12-15 03:31:50.174 11671 11671 D FLAG_RECEIVER_FOREGROUND
12-15 03:31:50.174 11671 11671 D FLAG_RECEIVER_INCLUDE_BACKGROUND
12-15 03:31:50.174 11671 11671 D FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS
I check the pip mode source code and they control this by the WindowManagerService
. I don't think it can be accessed through the application level.