mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 05:35:07 +01:00
Fix Non-builtin
Uncached Vibrator
Getter
If a non-builtin vibrator was attempted to be fetched, it'd insert it in the vibrator cache and return directly as opposed to playing the vibration on it prior to returning. This has now been fixed, the value is both put into the cache and the vibration is played on it.
This commit is contained in:
parent
dc3f7f1ab4
commit
cfdb2abf9e
@ -486,17 +486,18 @@ class EmulationActivity : AppCompatActivity(), SurfaceHolder.Callback, View.OnTo
|
||||
for (id in InputDevice.getDeviceIds()) {
|
||||
val device = InputDevice.getDevice(id)
|
||||
if (device.descriptor == inputManager.controllers[index]!!.rumbleDeviceDescriptor) {
|
||||
vibrators[index] = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
val vibrator = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
device.vibratorManager.defaultVibrator
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
device.vibrator
|
||||
device.vibrator!!
|
||||
}
|
||||
vibrators[index] = vibrator
|
||||
return@let vibrator
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
} as Vibrator
|
||||
}
|
||||
|
||||
val effect = VibrationEffect.createWaveform(timing, amplitude, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user