Finally I found
Call getProfileProxy to get a2dp proxy
adapter.getProfileProxy(c, listner, BluetoothProfile.A2DP);
listenr should implement onA2DPProxyReceived.
Then Callback onA2DPProxyReceived will be called.
public void onA2DPProxyReceived (BluetoothA2dp proxy) {
Method disconnect = null;
try {
disconnect = BluetoothA2dp.class.getDeclaredMethod("disconnect", BluetoothDevice.class);
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
BluetoothDevice device = findBondedDeviceByName(mBtAdapter, myDevice);
disconnect.setAccessible(true);
try {
int result = disconnect.invoke(proxy,device);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
Refer to sites below