Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission

Has anyone meet the same problem as the following error message shows when calling bluetoothDeive.createBond() method with android 4.4 api?

java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission

Note: BLUETOOTH_ADMIN permission is already included in AndroidManifest file.

like image 628
user2822074 Avatar asked Nov 14 '13 09:11

user2822074


2 Answers

Got the exact error message.

Took me an hour to realize that the bluetooth on the phone is not enabled. After turning it on, it works as expected.

like image 134
Dino Tw Avatar answered Sep 20 '22 03:09

Dino Tw


I run on this error, and only I can say, you need to install your app as a system privileged app, to go to system folder and try to copy app to the app folder or priv_app folder. On my Android platform, when I made folder inside priv_app folder for my app and copied my apk to it and restarted Android, everything worked OK. I my case I added in manifest all this permissions at the beginning, but it worked only after this step above.

like image 27
LadyG Avatar answered Sep 20 '22 03:09

LadyG