Post Reply

[Q] Android bluetooth pairing Security

OP saademou

27th January 2014, 04:43 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
2 posts
Join Date:Joined: Oct 2013
Since I upgraded to android 4.2 I'm having trouble when i try to pair a device The device should be paired but now it says that acros_user_permission is required.

Here is the error log :

error:code 3: java.lang.SecurityException:: Permission Denial: broadcast from android asks to run as user -1 but is calling from user0; this requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS.

and here my method :

public boolean ensurePaired(BluetoothDevice bd) {
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(bd.getAddress()) ;
boolean paired = false;

Log.d(TAG,"Pairing with Bluetooth device with name " + device.getName()+" and address "+device.getAddress());

try {
Method m = device.getClass().getMethod("createBond");
paired = (Boolean) m.invoke(device);
} catch (Exception e)
{
return paired;
}
Log.d("BluetoothPlugin -", "Returning "+ "Result: "+paired);
return paired;
}
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android Q&A, Help & Troubleshooting by ThreadRank