Skip to content

Commit 460161c

Browse files
authored
FIX: Device disconnected events are missed when running in the background (#1609)
1 parent c89f80d commit 460161c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ however, it has to be formatted properly to pass verification tests.
1616

1717
### Fixed
1818
- Fixed composite bindings incorrectly getting a control scheme assigned when pasting into input asset editor with a control scheme selected.
19+
- Fixed an issue on PS5 where device disconnected events that happen while the app is in the background are missed causing orphaned devices to hang around forever and exceptions when the same device is added again ([case UUM-7842](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-6744)).
1920

2021
### Actions
2122
- Extended input action code generator (`InputActionCodeGenerator.cs`) to support optional registration and unregistration of callbacks for multiple callback instances via `AddCallbacks(...)` and `RemoveCallbacks(...)` part of the generated code. Contribution by [Ramobo](https://github.com/Ramobo) in [#889](https://github.com/Unity-Technologies/InputSystem/pull/889).

Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ public float pollingFrequency
227227
public double currentTimeOffsetToRealtimeSinceStartup => NativeInputSystem.currentTimeOffsetToRealtimeSinceStartup;
228228
public float unscaledGameTime => Time.unscaledTime;
229229

230-
public bool runInBackground => Application.runInBackground;
230+
public bool runInBackground => Application.runInBackground ||
231+
// certain platforms ignore the runInBackground flag and always run. Make sure we're
232+
// not running on one of those.
233+
// TODO: Add more platforms here as they're discovered.
234+
Application.platform == RuntimePlatform.PS5;
231235

232236
private Action m_ShutdownMethod;
233237
private InputUpdateDelegate m_OnUpdate;

0 commit comments

Comments
 (0)