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

Commit 748a5c66 authored by Rahul Arya's avatar Rahul Arya Committed by Automerger Merge Worker
Browse files

Merge "Always start Battery Service" am: 38fa8caa am: b14841b5 am: 9e411fba am: f047951a

parents a981acc6 f047951a
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -5539,6 +5539,13 @@ public class AdapterService extends Service {
                    BluetoothProfile.CONNECTION_POLICY_ALLOWED);
            numProfilesConnected++;
        }
        if (mBatteryService != null && isProfileSupported(
                device, BluetoothProfile.BATTERY)) {
            Log.i(TAG, "connectAllEnabledProfiles: Connecting Battery Service");
            mBatteryService.setConnectionPolicy(device,
                    BluetoothProfile.CONNECTION_POLICY_ALLOWED);
            numProfilesConnected++;
        }

        Log.i(TAG, "connectAllEnabledProfiles: Number of Profiles Connected: "
                + numProfilesConnected);
@@ -5688,6 +5695,14 @@ public class AdapterService extends Service {
                            + "LE Broadcast Assistant Profile");
            mBassClientService.disconnect(device);
        }
        if (mBatteryService != null && (mBatteryService.getConnectionState(device)
                == BluetoothProfile.STATE_CONNECTED
                || mBatteryService.getConnectionState(device)
                == BluetoothProfile.STATE_CONNECTING)) {
            Log.i(TAG, "disconnectAllEnabledProfiles: Disconnecting "
                            + "Battery Service");
            mBatteryService.disconnect(device);
        }

        return BluetoothStatusCodes.SUCCESS;
    }