Java.lang.SecurityException: BLUETOOTH PRIVILEGED permission required

Does anyone encounter the same problem as the next call to bluetoothDeive.createBond() when using the android 4.4 api method?

java.lang.SecurityException: BLUETOOTH PRIVILEGED permission required

Note. BLUETOOTH_ADMIN permission is already included in the AndroidManifest file.

+7
android bluetooth
source share
5 answers

You cannot use this permission if your application is a third-party application (not a system application). To find out more, see the Android API: BLUETOOTH_PRIVILEGED

+14
source share

I run this error, and I can only say, you need to install the application as an application with system privileges, go to the system folder and try to copy the application to the application folder or priv_app folder. On my Android platform, when I made a folder inside the priv_app folder for my application and copied its apk and restarted Android, everything worked fine. In my case, I added all these permissions in the manifest at the beginning, but it worked only after this step above.

0
source share

Try the following:

1) remove "android.permission.BLUETOOTH_PRIVILEGED" from your permissions.
2) delete "android.permission.BLUETOOTH".
3) add "android.permission.BLUETOOTH_ADMIN" and only that.

The link indicates that this is the only permission required. https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#createBond ()

EDIT: If you have already enabled bluetooth_admin, this may be a platform issue. They may not have previously supported this feature. Perhaps you should aim for a higher min-sdk platform, I use Android 20 at least (but have never tried this feature).

0
source share

You have not published any code or description about the ur application, but I assume that this error implies that you are adding the BLUETOOTH_PRIVILEGED permission to the manifest file.

 <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" /> 

http://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_PRIVILEGED

-one
source share

try this in your manifest

  <user-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> 

Note that the user does not use permission in the first line. Until I switched this, for some reason I kept getting

java.lang.SecurityException: BLUETOOTH_ADMIN permission required

-one
source share

All Articles