There is a bug in the Kotlin’s signature of
getDevice() method in
According to this reference page it is
fun getDevice(): InputDevice!
and thus should always return a non-nullable
However the Return section reads
InputDevice!: The device, or null if unknown.
which is a contradiction.
The method signature should be changed to
fun getDevice(): InputDevice?
I don’t know how to make this method to return null but I have an app and many java.lang.IllegalStateException: device must not be null crash reports proving that my users were able to do that.