Revert "Android: Disable input device sensor input due to crash"

This reverts commit 75fb1a7edf.
This commit is contained in:
JosJuice 2024-06-15 14:09:22 +02:00
parent 59cbe5a843
commit 9193045989
1 changed files with 4 additions and 11 deletions

View File

@ -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()
}