diff options
| author | JosJuice <josjuice@gmail.com> | 2024-06-15 14:09:22 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2024-07-28 11:29:17 +0200 |
| commit | 91930459895f179f360414ae9a0d7a9253a4fedd (patch) | |
| tree | 2963d94436d3a6a2a27af634e490b69bc669deb8 /Source/Android/app/src/main/java | |
| parent | 59cbe5a84324e079535babce673c9116d2cfe56f (diff) | |
Revert "Android: Disable input device sensor input due to crash"
This reverts commit 75fb1a7edfb12f490b08ab0b76a8e2f1536d2d9b.
Diffstat (limited to 'Source/Android/app/src/main/java')
| -rw-r--r-- | Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/DolphinSensorEventListener.kt | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/DolphinSensorEventListener.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/DolphinSensorEventListener.kt index 6076b67384..6aa5ce2fc0 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/DolphinSensorEventListener.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/DolphinSensorEventListener.kt @@ -60,18 +60,11 @@ class DolphinSensorEventListener : SensorEventListener { constructor(inputDevice: InputDevice) { rotateCoordinatesForScreenOrientation = false canSuspendSensorsIndividually = false - sensorManager = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { - inputDevice.sensorManager - - // TODO: There is a bug where after suspending sensors, onSensorChanged can get called for - // a sensor that we never registered as a listener for. The way our code is currently written, - // this causes a NullPointerException, but if we checked for null we would instead have the - // problem of being spammed with onSensorChanged calls even though the sensor shouldn't be - // enabled. For now, let's comment out the ability to use InputDevice sensors. - - //addSensors(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + sensorManager = inputDevice.sensorManager + addSensors() } else { - null + sensorManager = null } sortSensorDetails() } |
