1. BluetoothDevice.createBond() 發生錯誤
E/AndroidRuntime(28384): FATAL EXCEPTION: main
E/AndroidRuntime(28384): Process: com.example.bttest, PID: 28384
E/AndroidRuntime(28384): java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission: Neither user 10048 nor current process has android.permission.BLUETOOTH_PRIVILEGED.
E/AndroidRuntime(28384): at android.os.Parcel.readException(Parcel.java:1461)
E/AndroidRuntime(28384): at android.os.Parcel.readException(Parcel.java:1415)
E/AndroidRuntime(28384): at android.bluetooth.IBluetooth$Stub$Proxy.createBond(IBluetooth.java:910)
E/AndroidRuntime(28384): at android.bluetooth.BluetoothDevice.createBond(BluetoothDevice.java:738)
即使在AndroidManifest.xml 加入了 <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" /> 還是不行
public static final String BLUETOOTH_PRIVILEGED
Allows applications to pair bluetooth devices without user interaction. This is not available to third party applications.