title: Remove Bluetooth Pairing Request Prompt
body: <p>So my device is a silent device. What I want is that when I send a pairing request to khadas from a different device, device automatically pairs. The problem is when a bluetooth pairing request is sent, a pairing confirmation prompt with pin comes up. I have setup a Broadcast Receiver <a href="https://stackoverflow.com/questions/35519321/android-bluetooth-pairing-without-user-enter-pin-and-confirmation-using-android">from here</a>, but nothing seems to work the code is : </p>
  
  <pre><code>private final BroadcastReceiver mPairingRequestReceiver = new BroadcastReceiver()
      {
          public void onReceive(Context context, Intent intent)
          {
              Log.v("BDE", "recieved something!");
              String action = intent.getAction();
              if (action.equals(BluetoothDevice.ACTION_PAIRING_REQUEST))
              {
                  try
                  {
                      BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
                      int pin = intent.getIntExtra("android.bluetooth.device.extra.PAIRING_KEY", 1234);
                      //the pin in case you need to accept for an specific pin
                      Log.d(TAG, "Start Auto Pairing. PIN = " + intent.getIntExtra("android.bluetooth.device.extra.PAIRING_KEY", 1234));
                      byte[] pinBytes;
                      pinBytes = ("" + pin).getBytes("UTF-8");
                      device.setPin(pinBytes);
                      //setPairing confirmation if needed
                      device.setPairingConfirmation(true);
                  } catch (Exception e)
                  {
                      e.printStackTrace();
                      Log.e(TAG, "Error occurs when trying to auto pair");
                      e.printStackTrace();
                  }
              }
          }
      };
  </code></pre>
  
  <p>When I run this code, I get a error  "Caused by: java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission: Neither user 10068 nor current process has android.permission.BLUETOOTH_PRIVILEGED."</p>
  
  <p>I have added the permission in Android Manifest too and have installed the app as system app too, still it does not work.</p>