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

Commit 5d1604ce authored by Kyunglyul Hyun's avatar Kyunglyul Hyun
Browse files

Use identity address in PanService

The native interface expects the identity address,
but the Java layer sometimes used the random address,
preventing proper disconnection.

This change ensures consistent use of the identity address
for communication with the native interface.

Bug: 351961492
Bug: 351961099
Test: atest PanServiceTest
Change-Id: If43005b142e0ebc3b938d097cc35a8b053f86bf1
parent 332d382a
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -98,7 +98,11 @@ public class PanService extends ProfileService {
                        Log.e(TAG, "Error setting up tether interface: " + error);
                        for (Map.Entry device : mPanDevices.entrySet()) {
                            mNativeInterface.disconnect(
                                    Utils.getByteAddress((BluetoothDevice) device.getKey()));
                                    Flags.panUseIdentityAddress()
                                            ? Utils.getByteBrEdrAddress(
                                                    (BluetoothDevice) device.getKey())
                                            : Utils.getByteAddress(
                                                    (BluetoothDevice) device.getKey()));
                        }
                        mPanDevices.clear();
                        mIsTethering = false;
@@ -662,7 +666,10 @@ public class PanService extends ProfileService {
                            "handlePanDeviceStateChange BT tethering is off/Local role"
                                    + " is PANU drop the connection");
                    mPanDevices.remove(device);
                    mNativeInterface.disconnect(Utils.getByteAddress(device));
                    mNativeInterface.disconnect(
                            Flags.panUseIdentityAddress()
                                    ? Utils.getByteBrEdrAddress(device)
                                    : Utils.getByteAddress(device));
                    return;
                }
                Log.d(TAG, "handlePanDeviceStateChange LOCAL_NAP_ROLE:REMOTE_PANU_ROLE");