If a pair of Earbuds is connected to two mobile phones, which device will be controlled by the gesture control function?

If the Earbuds are currently outputting sound from a certain mobile device, pressing the control buttons will control that device; if the Earbuds are in a non-playing state, the control buttons will control the last connected device or the last device that played sound through the Earbuds.