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

Commit 38fa8caa authored by Rahul Arya's avatar Rahul Arya Committed by Gerrit Code Review
Browse files

Merge "Always start Battery Service"

parents 2305dc8a a0fee1d6
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -5524,6 +5524,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);
@@ -5673,6 +5680,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;
    }