简体   繁体   中英

Android 5.0+ hides “Bluetooth pairing request” from user in notification area

I see this very confusing issue on GPE devices (Nexus, Moto G) with Android 5.0+ (still exists in Moto G with 5.1). I`m working on android application that connects to a custom board via Bluetooth (RFCOMM). When I initiate connection Android frequently shows "Bluetooth pairing request" dialog and ask user click "pair" button. It is normal behaviour. But with Google Play Edition devices like Nexus(5,6,9) and Moto G(may be with other GPE devices too). This messages do not appears to user. Instead android hides it in notification area. As result users do not understand that some user actions required. From user prospective app hangs up.

This dialog is not a part of the application. With Samsung Galaxy devices I do not see this issues.

Is there any workaround to show this dialog on top always?

I can think about two options:

  1. You could start an Intent that would bypass the lock screen (if there is one) and display a msg to the user that an action is required ( Android Lollipop - Bypass lock screen for popup activity ).

  2. You could add your own notification with a beep (using the MediaManager) and vibration to make sure the user is aware that he needs to approve the pairing. bear in mind that the user can configure the phone not to display notifications on any device running Android 5.x (in settings->sound and notifications) so It's won't always solve your problem.

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM