Which device is controlled by gesture controls on Nothing Headphone (a) when connected to two phones?

Gesture controls always apply to the device currently outputting audio through the headphones. If no audio is playing, controls will operate the most recently connected device or the device that last played audio through the headphones.