Disable gamepad sensors while in PiP mode

This commit is contained in:
Cameron Gutman
2023-07-12 01:07:14 -05:00
parent 642c353164
commit 18b6aae381
3 changed files with 62 additions and 1 deletions

View File

@@ -639,6 +639,9 @@ public class Game extends Activity implements SurfaceHolder.Callback,
performanceOverlayView.setVisibility(View.GONE);
notificationOverlayView.setVisibility(View.GONE);
// Disable sensors while in PiP mode
controllerHandler.disableSensors();
// Update GameManager state to indicate we're in PiP (still gaming, but interruptible)
UiHelper.notifyStreamEnteringPiP(this);
}
@@ -657,6 +660,9 @@ public class Game extends Activity implements SurfaceHolder.Callback,
notificationOverlayView.setVisibility(requestedNotificationOverlayVisibility);
// Enable sensors again after exiting PiP
controllerHandler.enableSensors();
// Update GameManager state to indicate we're out of PiP (gaming, non-interruptible)
UiHelper.notifyStreamExitingPiP(this);
}