Android 配对请求-未从uid 1000导出

Android 配对请求-未从uid 1000导出,android,bluetooth,uid,Android,Bluetooth,Uid,我尝试打开一个特定MAC地址的配对对话框 BluetoothDevice device; String bt_mac = read.toUpperCase(Locale.GERMAN); device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(bt_mac); Intent intent = new Intent("android.bluetooth.device.action.PAIRING_REQUEST"); intent

我尝试打开一个特定MAC地址的配对对话框

BluetoothDevice device;
String bt_mac = read.toUpperCase(Locale.GERMAN);
device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(bt_mac);
Intent intent = new Intent("android.bluetooth.device.action.PAIRING_REQUEST");
intent.putExtra("android.bluetooth.device.extra.DEVICE", device);
intent.putExtra("android.bluetooth.device.extra.PAIRING_VARIANT", 0);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
但我只收到以下错误消息:

java.lang.SecurityException:权限拒绝:启动意图{ act=android.bluetooth.device.action.PAIRING\u请求flg=0x10000000 cmp=com.android.settings/.bluetooth.BluetoothPairingDialog(具有 来自ProcessRecord{434110a0 15553:de.test.testapp/u0a10003} (pid=15553,uid=10003)未从uid 1000导出

我认为问题在于消息的这一部分:不是从UID1000导出的 但我不知道如何修复它

根据,配对请求属于“只有系统才能发送的特殊广播”:



我猜其他建议将此作为解决方案的用户(例如有问题的用户)可能拥有root权限。

您是否有权限
android.permission.BLUETOOTH\u ADMIN
设置?是的。
    <protected-broadcast android:name="android.bluetooth.device.action.PAIRING_REQUEST" />