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

Commit c3980705 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Update test for added ServiceState APIs"

parents ebdffd06 b364e198
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.telephony;

import android.os.Bundle;
import android.os.Parcel;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
@@ -224,6 +225,8 @@ public class ServiceStateTest extends TestCase {
        ss.setCdmaEriIconMode(7);
        ss.setEmergencyOnly(true);
        ss.setDataRoamingFromRegistration(true);
        ss.setChannelNumber(2100);
        ss.setCellBandwidths(new int[]{1400, 5000, 10000});

        Parcel p = Parcel.obtain();
        ss.writeToParcel(p, 0);
@@ -232,4 +235,33 @@ public class ServiceStateTest extends TestCase {
        ServiceState newSs = new ServiceState(p);
        assertEquals(ss, newSs);
    }

    @SmallTest
    public void testBundle() {
        ServiceState ss = new ServiceState();
        ss.setVoiceRegState(ServiceState.STATE_IN_SERVICE);
        ss.setDataRegState(ServiceState.STATE_OUT_OF_SERVICE);
        ss.setVoiceRoamingType(ServiceState.ROAMING_TYPE_INTERNATIONAL);
        ss.setDataRoamingType(ServiceState.ROAMING_TYPE_UNKNOWN);
        ss.setOperatorName("long", "short", "numeric");
        ss.setIsManualSelection(true);
        ss.setRilVoiceRadioTechnology(ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT);
        ss.setRilDataRadioTechnology(ServiceState.RIL_RADIO_TECHNOLOGY_EVDO_0);
        ss.setCssIndicator(1);
        ss.setSystemAndNetworkId(2, 3);
        ss.setCdmaRoamingIndicator(4);
        ss.setCdmaDefaultRoamingIndicator(5);
        ss.setCdmaEriIconIndex(6);
        ss.setCdmaEriIconMode(7);
        ss.setEmergencyOnly(true);
        ss.setDataRoamingFromRegistration(true);
        ss.setChannelNumber(2100);
        ss.setCellBandwidths(new int[]{3, 4, 10});

        Bundle b = new Bundle();
        ss.fillInNotifierBundle(b);
        ServiceState newSs = ServiceState.newFromBundle(b);

        assertEquals(ss, newSs);
    }
}
 No newline at end of file