DfuBaseService.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:microbit 作者:
/**
 * Initializes bluetooth adapter
 *
 * @return <code>true</code> if initialization was successful
 */
private boolean initialize() {
    // For API level 18 and above, get a reference to BluetoothAdapter through
    // BluetoothManager.
    final BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
    if (bluetoothManager == null) {
        loge("Unable to initialize BluetoothManager.");
        return false;
    }

    mBluetoothAdapter = bluetoothManager.getAdapter();
    if (mBluetoothAdapter == null) {
        loge("Unable to obtain a BluetoothAdapter.");
        return false;
    }

    return true;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号