Revert "Android: Disable input device sensor input due to crash"
This reverts commit 75fb1a7edf
.
This commit is contained in:
parent
59cbe5a843
commit
9193045989
|
@ -60,18 +60,11 @@ class DolphinSensorEventListener : SensorEventListener {
|
||||||
constructor(inputDevice: InputDevice) {
|
constructor(inputDevice: InputDevice) {
|
||||||
rotateCoordinatesForScreenOrientation = false
|
rotateCoordinatesForScreenOrientation = false
|
||||||
canSuspendSensorsIndividually = false
|
canSuspendSensorsIndividually = false
|
||||||
sensorManager = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
inputDevice.sensorManager
|
sensorManager = inputDevice.sensorManager
|
||||||
|
addSensors()
|
||||||
// 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();
|
|
||||||
} else {
|
} else {
|
||||||
null
|
sensorManager = null
|
||||||
}
|
}
|
||||||
sortSensorDetails()
|
sortSensorDetails()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue