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

Commit 68ae51d5 authored by Chris Manton's avatar Chris Manton Committed by Gerrit Code Review
Browse files

Merge "Clear bonding initiated when all profile disabled"

parents 1a770e25 fbe4f76f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1097,7 +1097,7 @@ public class AdapterService extends Service {
     * @return true if any profile is enabled, false otherwise
     */
    @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)
    private boolean isAnyProfileEnabled(BluetoothDevice device) {
    boolean isAnyProfileEnabled(BluetoothDevice device) {

        if (mA2dpService != null && mA2dpService.getConnectionPolicy(device)
                > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) {
+6 −0
Original line number Diff line number Diff line
@@ -788,6 +788,12 @@ final class RemoteDevices {
            if (sAdapterService.getConnectionState(device) == 0) {
                resetBatteryLevel(device);
            }
            if (!sAdapterService.isAnyProfileEnabled(device)) {
                DeviceProperties deviceProp = getDeviceProperties(device);
                if (deviceProp != null) {
                    deviceProp.setBondingInitiatedLocally(false);
                }
            }
            debugLog(
                    "aclStateChangeCallback: Adapter State: " + BluetoothAdapter.nameForState(state)
                            + " Disconnected: " + device