Android createRfcommSocketToServiceRecord需要BLUETOOTH_管理员?

Android createRfcommSocketToServiceRecord需要BLUETOOTH_管理员?,android,bluetooth,android-permissions,Android,Bluetooth,Android Permissions,是否存在任何情况,包括Android 4.2中的任何已知错误,可能导致createRfcommSocketToServiceRecord抛出: java.lang.SecurityException: Need BLUETOOTH_ADMIN permission: Neither user 10043 nor current process has android.permission.BLUETOOTH_ADMIN. at android.os.Parcel.readException(Pa

是否存在任何情况,包括Android 4.2中的任何已知错误,可能导致createRfcommSocketToServiceRecord抛出:

java.lang.SecurityException: Need BLUETOOTH_ADMIN permission: Neither user 10043 nor current process has android.permission.BLUETOOTH_ADMIN.
at android.os.Parcel.readException(Parcel.java:1425)
at android.os.Parcel.readException(Parcel.java:1379)
at android.bluetooth.IBluetoothSocket$Stub$Proxy.initSocket(IBluetoothSocket.java:230)
at android.bluetooth.BluetoothSocket.<init>(BluetoothSocket.java:225)
at android.bluetooth.BluetoothDevice.createRfcommSocketToServiceRecord(BluetoothDevice.java:948)
createRfcommSocketToServiceRecord被记录为只需要BLUETOOTH权限,而不需要BLUETOOTH_管理权限。这似乎是合理的

我的应用程序只有蓝牙权限,我自己也从未见过它崩溃。但今天我收到一份来自运行安卓4.2的Xperia C C2305的崩溃报告,上面有堆栈跟踪


合理的行动方案是什么?由于我不愿意添加更多权限,我可能必须捕获SecurityException并将其作为连接故障报告给用户。

如果您希望应用程序的该部分在该设备上工作,则需要请求权限。否则,您的建议将避免崩溃,但该功能永远不会起作用。@gabe createRfcommSocketToServiceRecord被记录为不需要_ADMIN权限,它适用于所有其他尝试过它的人。我不明白为什么需要BLUETOOTH_管理员许可,我没有发现或配对,我只是在连接。显然在那部手机上是这样的。这可能是意外情况下的错误配置,也可能是OEM有意进行的更改。不管怎样,未经许可,该手机将无法连接。仅供参考-虽然因为它不是一款受欢迎的机型,所以没有太多闲聊,但您并不是唯一一个看到它的人-它已在Arduino论坛上报道。@Gabeschen有趣。。。你有那个论坛的链接吗?我认为这将构成对我问题的回答。