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

Commit 51a3a980 authored by Ugo Yu's avatar Ugo Yu
Browse files

Don't report silence state in ACTION_SILENCE_MODE_CHANGED

Bug: 124448652
Test: runtest bluetooth
Change-Id: I892de3635af5b4fa56536e7c3b4573000538a542
parent 3b8750fd
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -286,7 +286,6 @@ public class SilenceDeviceManager {
    void broadcastSilenceStateChange(BluetoothDevice device, boolean state) {
        Intent intent = new Intent(BluetoothDevice.ACTION_SILENCE_MODE_CHANGED);
        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
        intent.putExtra(BluetoothDevice.EXTRA_SILENCE_ENABLED, state);
        mAdapterService.sendBroadcastAsUser(intent, UserHandle.ALL, AdapterService.BLUETOOTH_PERM);

    }
+2 −4
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ public class SilenceDeviceManagerTest {
            verify(mAdapterService, times(++mVerifyCount)).sendBroadcastAsUser(
                    intentArgument.capture(), eq(UserHandle.ALL),
                    eq(AdapterService.BLUETOOTH_PERM));
            verifySilenceStateIntent(enableSilence, intentArgument.getValue());
            verifySilenceStateIntent(intentArgument.getValue());
        }

        // Remove test devices
@@ -160,11 +160,9 @@ public class SilenceDeviceManagerTest {
                eq(AdapterService.BLUETOOTH_PERM));
    }

    void verifySilenceStateIntent(boolean expectedState, Intent intent) {
    void verifySilenceStateIntent(Intent intent) {
        Assert.assertEquals(BluetoothDevice.ACTION_SILENCE_MODE_CHANGED, intent.getAction());
        Assert.assertEquals(mTestDevice, intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE));
        Assert.assertEquals(expectedState,
                intent.getBooleanExtra(BluetoothDevice.EXTRA_SILENCE_ENABLED, false));
    }

    /**