-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need BLUETOOTH PRIVILEGED permission - Android 13 #507
Comments
I also encountered the same problem. |
Hello, what characteristic you're trying to read? Are you sure you have the correct UUID and reference? |
Hello! Our peripheral has few standard services like Hex code are This crash occurs on android 13 devices only so not sure if this has to do with wrong implementation on our end. |
Did you try clearing caches on the affected phone by restarting Bluetooth or in nRF Connect? |
Unfortunately this we haven't found in our test devices. All on remote user devices. Anything else you think we can try? |
I think I remember having this exception when the bluetooth is disabled on some devices. Did you make sure bluetooth is enabled before doing those calls ? |
Yes. Saw the same on a stackoverflow thread. We make sure bluetooth is enabled before connecting to a peripheral. |
I also encountered this problem, but still couldn't find a solution.
|
We also encounter this issue. The only solution I can think of is to try refreshing deviceChache (refreshDeviceCache()) and then reconnecting. So my suggestion would be to add a try catch inside BleManagerHandler#internalReadCharacteristic() and possibly add new FailCallback reason that will be notified to Android App (without crashing the whole app) so that devs can handle this exception them self like for example calling refreshDeviceCache() and trying to reconnect |
I also see this issue on Pixel 6 with Android 13, however it starts today, yesterday all was fine. After phone reboot all starts working again. I think it may be related to connected smartband (Xiaomi Band 6) to Pixel 6 , because when smartband is disconnected all works fine. I also see that when smartband is connected it auto connect to my gatt server dedicated to my app and I'm not sure how can I filter it. |
The result of my testing here is that if I use a Google Android 13 phone to connect, the previous connected device contains a special uuid defined by android, then I disconnect and connect to the next device that does not contain a special uuid, this problem will occur. public class GattService extends ProfileService {
private static final boolean DBG = GattServiceConfig.DBG;
private static final boolean VDBG = GattServiceConfig.VDBG;
private static final String TAG = GattServiceConfig.TAG_PREFIX + "GattService";
private static final String UUID_SUFFIX = "-0000-1000-8000-00805f9b34fb";
private static final String UUID_ZERO_PAD = "00000000";
static final int SCAN_FILTER_ENABLED = 1;
static final int SCAN_FILTER_MODIFIED = 2;
private static final int MAC_ADDRESS_LENGTH = 6;
// Batch scan related constants.
private static final int TRUNCATED_RESULT_SIZE = 11;
private static final int TIME_STAMP_LENGTH = 2;
/**
* The default floor value for LE batch scan report delays greater than 0
*/
private static final long DEFAULT_REPORT_DELAY_FLOOR = 5000;
// onFoundLost related constants
private static final int ADVT_STATE_ONFOUND = 0;
private static final int ADVT_STATE_ONLOST = 1;
private static final int ET_LEGACY_MASK = 0x10;
private static final UUID HID_SERVICE_UUID =
UUID.fromString("00001812-0000-1000-8000-00805F9B34FB");
private static final UUID[] HID_UUIDS = {
UUID.fromString("00002A4A-0000-1000-8000-00805F9B34FB"),
UUID.fromString("00002A4B-0000-1000-8000-00805F9B34FB"),
UUID.fromString("00002A4C-0000-1000-8000-00805F9B34FB"),
UUID.fromString("00002A4D-0000-1000-8000-00805F9B34FB")
};
private static final UUID ANDROID_TV_REMOTE_SERVICE_UUID =
UUID.fromString("AB5E0001-5A21-4F05-BC7D-AF01F617B664");
private static final UUID FIDO_SERVICE_UUID =
UUID.fromString("0000FFFD-0000-1000-8000-00805F9B34FB"); // U2F
private static final UUID[] LE_AUDIO_SERVICE_UUIDS = {
UUID.fromString("00001844-0000-1000-8000-00805F9B34FB"), // VCS
UUID.fromString("00001845-0000-1000-8000-00805F9B34FB"), // VOCS
UUID.fromString("00001843-0000-1000-8000-00805F9B34FB"), // AICS
UUID.fromString("00001850-0000-1000-8000-00805F9B34FB"), // PACS
UUID.fromString("0000184E-0000-1000-8000-00805F9B34FB"), // ASCS
UUID.fromString("0000184F-0000-1000-8000-00805F9B34FB"), // BASS
}; |
Hi @philips77 |
Others are you able to circumvent the problem? |
Looks like toggling Bluetooth helps to resolve this issue. However we still get this crash and cannot catch it outside of the "Android BLE library" |
I think it may happen because you trying to use the Bluetooth and it is turned off. This is the case I faced and have the same issue. |
We do not start Bluetooth communication when Bluetooth is Off :). |
I'll see what I can do. |
This crash seems to occur on 2.7.2 release also! |
Hello @philips77 any idea on this? This is the crashlog
@LuoPeiQin @plotczyktest @elongpaoxiao @nadrolinux @NoviaWu123 anyone still facing this issue? |
What characteristic are you trying enable notifications on? Is it any of those from here: #507 (comment) ? |
Although frequency has reduced a bit but the problem still remains. have created a new issue here: https://issuetracker.google.com/issues/330663537 |
- NordicSemiconductor#507 - https://issuetracker.google.com/issues/330663537, https://issuetracker.google.com/issues/330663537 - this is a continuation of 229ad11 where we get read write errors on some Android devices (above api level 33). Signed-off-by: Arka Prava Basu <[email protected]>
I have sent a PR for handling this issue. |
Great to see, and thanks for re-reporting. Google admits it's on their side and a fix is planned for rollout to the field they say in the new issue. |
Although google admits and repair in android 15 beta3,most of user are not keep latest android version. |
On certain user devices (all Android 13) we are facing the following crash.
Something related I could find on SF but we are not enabling notification on any restricted characteristics.
Is there any way the library can shed more info on these crashes?
The text was updated successfully, but these errors were encountered: