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

Commit b12f1a82 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Gerrit Code Review
Browse files

Merge "Battery Level: Add FLAG_RECEIVER_INCLUDE_BACKGROUND flag to intent"

parents db22a417 c21698d0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -455,6 +455,7 @@ final class RemoteDevices {
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
        intent.putExtra(BluetoothDevice.EXTRA_BATTERY_LEVEL, batteryLevel);
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
        intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
        sAdapterService.sendBroadcast(intent, AdapterService.BLUETOOTH_PERM);
    }

+2 −1
Original line number Diff line number Diff line
@@ -440,7 +440,8 @@ public class RemoteDevicesTest {
        Assert.assertEquals(device, intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE));
        Assert.assertEquals(batteryLevel,
                intent.getIntExtra(BluetoothDevice.EXTRA_BATTERY_LEVEL, -15));
        Assert.assertEquals(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT, intent.getFlags());
        Assert.assertEquals(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT
                        | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND, intent.getFlags());
    }

    private static Intent getHeadsetConnectionStateChangedIntent(BluetoothDevice device,