How to switch control scheme from gamepad to touch in Android?

Hello!

I have recognised that the new Input System works in the following way. I have a gamepad paired to the Android and I switched that off. When I start the game on Android, touch works perfectly. After that, if I activate gamepad and it automatically connects to the Android build, then the Input System unpairs the Touch screen and adds the new device (gamepad) and pairs to that.

During this time, if I try to touch the screen, there’s the InputUser.OnEvent method, which gets called. In here, you can see an assert message, which is about it gets called, when an unpaired device is get used (which is the touch screen now).
But the InputUser.OnUnpairedDeviceUsed doesn’t get called, because this method thinks the Touch screen is a synthetic input (documentation says it means it’s not a physically existing input, which is not true), it doesn’t reach the magnitude checking lines in that method. It’s a problem, that OnUnpairedDeviceUsed doesn’t get called, because there isn’t any other event which would get called, if I previously used gamepad on Android, and I touch the screen.

I have checked InputUser.onChange and PlayerInput.onControlsChanged, none of them gets called, if I have an active gamepad and I touch the screen.

These things are getting called perfectly, if I use PC and I switch from gamepad to keyboard+mouse or if I switch from keyboard+mouse to gamepad.

I can’t use PlayerInput.SwitchCurrentControlScheme, because first I should recognise somehow that the user touched the screen after gamepad usage.

Is there a checkbox or setting somewhere which I have missed? Or is there an event, which could be used instead of these?

Okay, the problem was really because of the Input System.
Unity 2021.1.15f1 could only see Input System 1.0.2, and I needed to manually add 1.3.0 to the project.
Then the issue was solved.