Problem on setBluetoothState on android version 9 #352
Labels
android
Relates to Android platform
bug
Something isn't working properly
more info needed
Further information is requested. If not provided, issue will be closed
runtime issue
An issue related to app runtime
I'm submitting a ... (check one with "x"):
Bug report
Current behavior:
On android version 9 (Honor 9), setBluetoothState() does not work correctly anymore, and successCallback returns an incorrect value. I cannot confirm if this is a general change on android 9.0, or if this is a Huawei change that applies to Honor phones.
Prior to update to android 9, setBluetoothState correctly turned bluetooth on, while success callback was called properly.
After updating to android 9, setBluetoothState now causes a popup from OS asking the user to allow/deny change to bluetooth state. Presumably this is a security update intended to limit the ability of apps to change bluetooth state without user permission.
However the success callback is still called immediately and always returns OK, even if user has not yet granted permission to let the application change the bluetooth state or even if user ultimately denies permission.
Example of how it works right now on android 9:
Expected behavior:
setBluetoothState() should probably wait for user confirmation before calling the success callback, and call errorCallback if user denies permission to change bluetooth state.
Example on how it should work:
Steps to reproduce:
On android 9, simply do the following:
Environment information
8.0.0
android 7.1.4
cordova.plugins.diagnostic 4.0.12 "Diagnostic"
-
Win 7 professional
Runtime issue
-
Huawei Honor 9 (STF-L09)
-
Android version 9, EMUI: 9.0.1.162 (C432E2R1P5)
The text was updated successfully, but these errors were encountered: