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

Commit b0f5eeed authored by Iván Budnik's avatar Iván Budnik
Browse files

Remove unused method in MediaDeviceUtils

This change is in preparation for removing MediaDeviceUtils.

This is a non-functional change.

Test: Presubmit
Bug: 205124386
Change-Id: Ib0f0c4dcd2565ff49b4abb45abc391e7b5599363
parent 1b7fe82e
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -15,21 +15,9 @@
 */
package com.android.settingslib.media;

import android.bluetooth.BluetoothDevice;

/**
 * MediaDeviceUtils provides utility function for MediaDevice
 */
public class MediaDeviceUtils {

    /**
     * Use BluetoothDevice address to represent unique id
     *
     * @param bluetoothDevice the BluetoothDevice
     * @return BluetoothDevice address
     */
    public static String getId(BluetoothDevice bluetoothDevice) {
        return bluetoothDevice.getAddress();
    }

}
+0 −22
Original line number Diff line number Diff line
@@ -16,38 +16,16 @@

package com.android.settingslib.media;

import static com.google.common.truth.Truth.assertThat;

import static org.mockito.Mockito.when;

import android.bluetooth.BluetoothDevice;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;

@RunWith(RobolectricTestRunner.class)
public class MediaDeviceUtilsTest {

    private static final String TEST_ADDRESS = "11:22:33:44:55:66";

    @Mock
    private BluetoothDevice mBluetoothDevice;

    @Before
    public void setUp() {
        MockitoAnnotations.initMocks(this);
    }

    @Test
    public void getId_returnBluetoothDeviceAddress() {
        when(mBluetoothDevice.getAddress()).thenReturn(TEST_ADDRESS);

        final String id = MediaDeviceUtils.getId(mBluetoothDevice);

        assertThat(id).isEqualTo(TEST_ADDRESS);
    }
}