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

Commit f61f3a92 authored by Zoey Chen's avatar Zoey Chen
Browse files

[Telephony] Verify the bands[] values are initialized correctly when converting.

Bug: 158025374
Test: atest CellIdentityLteTest
Change-Id: I9fd23450cb5b3d494dd6d5d3200224160e20d00b
parent c30a4d38
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -22,7 +22,10 @@ import android.telephony.CellInfo;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.stream.Collectors;

/** Unit tests for {@link CellIdentityLte}. */

@@ -253,4 +256,15 @@ public class CellIdentityLteTest extends AndroidTestCase {
        CellIdentityLte newCi = CellIdentityLte.CREATOR.createFromParcel(p);
        assertEquals(ci, newCi);
    }

    @SmallTest
    public void testBands() {
        android.hardware.radio.V1_5.CellIdentityLte cid =
                new android.hardware.radio.V1_5.CellIdentityLte();
        cid.bands = Arrays.stream(BANDS).boxed().collect(Collectors.toCollection(ArrayList::new));

        CellIdentityLte cellIdentityLte = new CellIdentityLte(cid);
        assertTrue(Arrays.equals(cellIdentityLte.getBands(), BANDS));

    }
}