Search in sources :

Example 1 with Builder

use of android.telephony.PhysicalChannelConfig.Builder in project android_frameworks_opt_telephony by LineageOS.

the class PhysicalChannelConfigTest method testParcel.

@Test
public void testParcel() {
    PhysicalChannelConfig config = new Builder().setRat(RAT).setCellConnectionStatus(CONNECTION_STATUS).setCellBandwidthDownlinkKhz(CELL_BANDWIDTH).setFrequencyRange(FREQUENCY_RANGE).setChannelNumber(CHANNEL_NUMBER).setContextIds(CONTEXT_IDS).setPhysicalCellId(PHYSICAL_CELL_ID).build();
    Parcel parcel = Parcel.obtain();
    config.writeToParcel(parcel, 0);
    parcel.setDataPosition(0);
    PhysicalChannelConfig fromParcel = PhysicalChannelConfig.CREATOR.createFromParcel(parcel);
    assertThat(fromParcel).isEqualTo(config);
}
Also used : Parcel(android.os.Parcel) Builder(android.telephony.PhysicalChannelConfig.Builder) PhysicalChannelConfig(android.telephony.PhysicalChannelConfig) Test(org.junit.Test)

Example 2 with Builder

use of android.telephony.PhysicalChannelConfig.Builder in project android_frameworks_opt_telephony by LineageOS.

the class PhysicalChannelConfigTest method testBuilder.

@Test
public void testBuilder() {
    PhysicalChannelConfig config = new Builder().setRat(RAT).setCellConnectionStatus(CONNECTION_STATUS).setCellBandwidthDownlinkKhz(CELL_BANDWIDTH).setFrequencyRange(FREQUENCY_RANGE).setChannelNumber(CHANNEL_NUMBER).setContextIds(CONTEXT_IDS).setPhysicalCellId(PHYSICAL_CELL_ID).build();
    assertThat(config.getRat()).isEqualTo(RAT);
    assertThat(config.getConnectionStatus()).isEqualTo(CONNECTION_STATUS);
    assertThat(config.getCellBandwidthDownlink()).isEqualTo(CELL_BANDWIDTH);
    assertThat(config.getFrequencyRange()).isEqualTo(FREQUENCY_RANGE);
    assertThat(config.getChannelNumber()).isEqualTo(CHANNEL_NUMBER);
    assertThat(config.getContextIds()).isEqualTo(CONTEXT_IDS);
    assertThat(config.getPhysicalCellId()).isEqualTo(PHYSICAL_CELL_ID);
}
Also used : Builder(android.telephony.PhysicalChannelConfig.Builder) PhysicalChannelConfig(android.telephony.PhysicalChannelConfig) Test(org.junit.Test)

Aggregations

PhysicalChannelConfig (android.telephony.PhysicalChannelConfig)2 Builder (android.telephony.PhysicalChannelConfig.Builder)2 Test (org.junit.Test)2 Parcel (android.os.Parcel)1