In 2019.1 and onwards we are migrating to a new set of hopefully easier to use APIs for XR inputs.
See: Any example of the new 2019.1 XR input system?
If you move to those APIs, then you have this handy property:
And in 2019.3 you will also get:
and
as well.
The name property should correspond with GetJoystickNames, but I think this new API will help you more easily look for a specific device, as well as get names for things like HMDs.