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

Commit 8d27557c 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

Change-Id: If225364de16e38560917ad154a16229f1b26cfc4
parents f2de57b1 a25a47f5
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));
    }

    /**