Android7.0 realease版本中已经将framework/opt/bluetooth中的pbap部分移植package/apps/Bluetooth的蓝牙应用中,所以之前用到framework/opt/bluetooth中pbap部分的代码已经无法正常使用了。但研读代码过程中发现蓝牙应用中已经提供了从蓝牙导入联系人、通话记录的服务。
这里给出调用该服务的简单方法。
一、连接服务
private IBluetoothPbapClient mBluetoothPbapClient = null;
private final ServiceConnection mPbapServiceConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mBluetoothPbapClient = IBluetoothPbapClient.Stub.asInterface(service);
}
@Override