自己解決できましたのでご報告致します。
本件、リフレクションを使用することで実現出来ました。
以下に実現コードを記述します。(若干省略します)
public void start(Context context) {
((BluetoothManager) context_.getSystemService(Context.BLUETOOTH_SERVICE)).getProfileProxy(Context, new BluetoothServiceListener(), BluetoothProfile.HEADSET);
BluetoothDevice device = getDevice() //ペアリングしている目的のヘッドセットデバイスのオブジェクト取得メソッド(省略)
connectDevice(BluetoothDevice device);
}
void connectDevice(BluetoothDevice device) {
Method connectMethod = BluetoothHeadset.class.getDeclaredMethod("connect", BluetoothDevice.class);
connectMethod.setAccessible(true);
connectMethod.invoke(mProxy, device);
}
BluetoothHeadset mProxy;
class BluetoothServiceListener implements BluetoothProfile.ServiceListener {
@Override
public void onServiceConnected(int profile, BluetoothProfile proxy) {
mProxy = (BluetoothHeadset)proxy;
}
}
2017年5月18日木曜日 22時18分04秒 UTC+9
rinjintoat...@gmail.com: