From fcd54c6479b15581ea01ba7d9dc4f25ac3265588 Mon Sep 17 00:00:00 2001 From: t895 Date: Tue, 14 Nov 2023 18:11:38 -0500 Subject: android: Don't enter PiP during startup or shutdown --- .../src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt index 054e4b755..f41d7bdbf 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt @@ -373,8 +373,10 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { val pictureInPictureParamsBuilder = PictureInPictureParams.Builder() .getPictureInPictureActionsBuilder().getPictureInPictureAspectBuilder() if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + val isEmulationActive = emulationViewModel.emulationStarted.value && + !emulationViewModel.isEmulationStopping.value pictureInPictureParamsBuilder.setAutoEnterEnabled( - BooleanSetting.PICTURE_IN_PICTURE.boolean + BooleanSetting.PICTURE_IN_PICTURE.boolean && isEmulationActive ) } setPictureInPictureParams(pictureInPictureParamsBuilder.build()) -- cgit v1.2.3