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

Commit ea685b69 authored by Ugo Yu's avatar Ugo Yu Committed by android-build-merger
Browse files

Merge "Don't report silence state in ACTION_SILENCE_MODE_CHANGED" am: a25a47f5 am: 8d27557c

am: 3d1f9c86

Change-Id: I74e6f5813d3f86c54bb774f73e548d6beb5b7c7a
parents 8befdc73 3d1f9c86
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
@@ -131,7 +131,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
@@ -161,11 +161,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));
    }

    /**