Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d65e8f4b authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

LE: Do not invoke callback if retrying read/write operation

When a descriptor read/write operation fails with insufficient
authentication/encryption, it will automatically be tried again with
elevated security requirements. The first (failed) attempt should not be
reported to the application requesting the read/write, since it will get
the 2nd callback once the retry succeeds/fails.

Change-Id: Ia27b91afa63b6f9ffdc597d59c24d29f3d8a1008
parent e2efefe1
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -491,6 +491,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                        mService.readDescriptor(mClientIf, address,
                        mService.readDescriptor(mClientIf, address,
                            srvcType, srvcInstId, srvcUuid, charInstId, charUuid,
                            srvcType, srvcInstId, srvcUuid, charInstId, charUuid,
                            descrInstId, descrUuid, AUTHENTICATION_MITM);
                            descrInstId, descrUuid, AUTHENTICATION_MITM);
                        return;
                    } catch (RemoteException e) {
                    } catch (RemoteException e) {
                        Log.e(TAG,"",e);
                        Log.e(TAG,"",e);
                    }
                    }
@@ -544,6 +545,7 @@ public final class BluetoothGatt implements BluetoothProfile {
                            srvcType, srvcInstId, srvcUuid, charInstId, charUuid,
                            srvcType, srvcInstId, srvcUuid, charInstId, charUuid,
                            descrInstId, descrUuid, characteristic.getWriteType(),
                            descrInstId, descrUuid, characteristic.getWriteType(),
                            AUTHENTICATION_MITM, descriptor.getValue());
                            AUTHENTICATION_MITM, descriptor.getValue());
                        return;
                    } catch (RemoteException e) {
                    } catch (RemoteException e) {
                        Log.e(TAG,"",e);
                        Log.e(TAG,"",e);
                    }
                    }