Discover what apps are using a device in code

I'm reorganising the devices that my app has created to group them as children of one of two other child devices, but I'd like to inform the user where those devices are being used so they can more easily substitute the new device.

So my question is: Is there a way for an app to discover where a device is being used? Or is the only way to view the device settings to find the usage?

Even a way of counting the number of uses would be helpful.

No, there is no mechanism that reports the apps in use by a device. It's just shown on the device page.

Thanks.

I'll just provide instructions to remap the devices (easier after 2.3.1 is released I guess) and to press a button to complete the internal transformation.