二.Framework的Java部分
路径framework/base/java/Android/server/中添加BluetoothHidService.java文件
路径framework/base/java/android/bluetooth/中添加BluetoothHid.java和IBluetoothHid.aidl文件。
- interface IBluetoothHid {
- boolean connect(in BluetoothDevice device);
- boolean disconnect(in BluetoothDevice device);
- int getState(in BluetoothDevice device);
- boolean setPriority(in BluetoothDevice device, int priority);
- int getPriority(in BluetoothDevice device);
- }
BluetoothHid.java中主要的两个方法connect和disconnect间接地通过aidl访问BluetoothHidService。这里主要是实现跨进程并为上层提供可直接访问的方法。
由此framework的主要部分打包生成framework.Jar并最终部署到system/framework里。
