GrapheneOS
I've looked into this issue more, the Android API which Firefox and probably also other browsers use in order to determine pointer type is android.view.InputDevice
. I've written some Android code to check which value is returned by GrapheneOS and the stock ROM.
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
val devices = InputDevice.getDeviceIds().map { InputDevice.getDevice(it) }
Column {
devices.forEach {
Text(text = getInput(it))
}
}
}
}
}
private fun getInput(inputDevice: InputDevice): String {
val sources = inputDevice.sources
return when {
hasInputDeviceSource(sources, InputDevice.SOURCE_MOUSE) -> "MOUSE"
hasInputDeviceSource(sources, InputDevice.SOURCE_STYLUS) -> "STYLUS"
hasInputDeviceSource(sources, InputDevice.SOURCE_TOUCHPAD) -> "TOUCHPAD"
hasInputDeviceSource(sources, InputDevice.SOURCE_TRACKBALL) -> "TRACKBALL"
hasInputDeviceSource(sources, InputDevice.SOURCE_TOUCHSCREEN) -> "TOUCHSCREEN"
hasInputDeviceSource(sources, InputDevice.SOURCE_JOYSTICK) -> "JOYSTICK"
else -> "UNKNOWN"
}
}
private fun hasInputDeviceSource(sources: Int, inputDeviceSource: Int): Boolean {
return sources and inputDeviceSource == inputDeviceSource
}
When I run this app on the stock ROM it shows:
UNKNOWN
UNKNOWN
UNKNOWN
TOUCHSCREEN
And for GrapheneOS it's:
UNKNOWN
UNKNOWN
UNKNOWN
STYLUS
So the app thinks the user is using a stylus, despite he is in fact using a touch screen. For me, it looks either as a bug or a purposeful anti-fingerprinting mechanism.
Could you check whenever you are getting the same results on your installation or GrapheneOS? You can use the method I've described in my previous comment, which doesn't involve having to build an Android app.