【问题标题】:Pairing Request - not exported from uid 1000配对请求 - 未从 uid 1000 导出
【发布时间】:2014-09-28 01:50:39
【问题描述】:

我尝试打开与特定 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: Permission Denial: 开始 Intent { 行动=android.bluetooth.device.action.PAIRING_REQUEST flg=0x10000000 cmp=com.android.settings/.bluetooth.BluetoothPairingDialog(有 额外内容)}来自 ProcessRecord{434110a0 15553:de.test.testapp/u0a10003} (pid=15553, uid=10003) 未从 uid 1000 导出

我认为问题在于消息的这一部分:notexported from uid 1000 但我不知道如何解决它

【问题讨论】:

  • 你有android.permission.BLUETOOTH_ADMIN的权限吗?
  • 是的,我有。

标签: android bluetooth uid


【解决方案1】:

根据AndroidManifest.xml,PAIRING REQUEST属于“只有系统才能发送的特殊广播”:

    <protected-broadcast android:name="android.bluetooth.device.action.PAIRING_REQUEST" />

我猜想其他提出此作为解决方案的用户(例如在this 问题中)可能具有 root 权限。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-04
    • 2012-05-20
    相关资源
    最近更新 更多