I am using Samsung Note 8 (Android 9) and Samsung A50(Android 10).
I am doing BLE scan which needs Bluetooth as well as location permissions (Android >=23). I am NOT providing the Location permission to the App before starting the BLE scan.
While starting a scan on Note 8, I am getting onScanFailed() callback with error code 2 (SCAN_FAILED_APPLICATION_REGISTRATION_FAILED) when the location permission is not given.
While starting scan on A50, I do not get any callbacks.
From the adb logs I can see internal log like BluetoothUtils: Permission denial: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATIONpermission to get scan results 07-28 21:03:35.720 2010 2650 D
I want to identify a scan failure has occurred because of missing permission. How do i do that?
Note- I am building an Android library, not an Android App so please suggest accordingly.