Search Unity

Bug Gamepad devices failed to be discovered by Input system in Android build.

Discussion in 'Input System' started by KentCheng, Jan 19, 2023.

  1. KentCheng

    KentCheng

    Joined:
    Jun 8, 2021
    Posts:
    1
    Hello, I am having trouble trying to get the gamepads to work in our Android build. The Input system seems to ignored the change in connected devices if the gamepad is being connected when the application is tabbed out, and so far it seems to only happens with android version 13.

    To recreate the problem:
    - added debug log when InputSystem.onFindLayoutForDevice is triggered.
    - create android build, and install it to our test phone (with Android version 13) via "adb install"
    - start the application
    - tab out to settings and turn on bluetooth, connect to a gamepad.
    - switch back to the application.
    - check android studio logcat, and no sign that the gamepad is being recognized, but a Mouse layout device is processed by onFindLayoutForDevice.
    upload_2023-1-19_21-20-38.png

    We also ran the same test on android phones with Version 8 and Version 10, both works fine when we switch back to our game application from Settings page. And if we were to connect the gamepad before we launch the game application, it can also be correctly recognized.

    Could this be a bug that is related to Android version 13 and the actions of switching in and out of game application?