Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I avoid or dismiss Android's Bluetooth pairing notification when I am doing programmatic pairing?
    primarykey
    data
    text
    <p>I have an app where I am programmatically controlling Bluetooth pairing and unpairing. I can pair before connection and unpair afterwards. The reason I need to do this is specific to my application and not in the scope of my question.</p> <p>Basically what I am doing is:</p> <ol> <li>Get a reference <code>ib</code> to <code>IBluetooth</code> object as described in <a href="https://stackoverflow.com/questions/3462968/how-to-unpair-bluetooth-device-using-android-2-1-sdk">this answer</a></li> <li>Register a BroadcastReceiver for <code>android.bluetooth.device.action.PAIRING_REQUEST</code></li> <li>Call <code>ib.createBond(address)</code></li> <li>Wait for BroadcastReceiver to trigger</li> <li>Convert user pin into bytes with <a href="http://www.google.com/codesearch#uX1GffpyOZk/core/java/android/bluetooth/BluetoothDevice.java&amp;q=convertPinToBytes&amp;type=cs" rel="nofollow noreferrer">convertPinToBytes()</a> </li> <li>Call <code>ib.setPin(address, pinBytes)</code> from within BroadcastReceiver</li> </ol> <p>Anyways, this approach works great, except for the fact that when I do the pairing, I get a notification in the Status bar requesting that the user enter a PIN to complete the pairing. But this is in fact unnecessary, because by the time the user sees this, my app has already used <code>setPin()</code>. I'd really like for that notification to either a) not appear at all, or b) be dismissed automatically somehow.</p> <p>I realize this may not even be possible, but I thought I would ask in case someone has a creative idea.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload