Search in sources :

Example 1 with CallAttributes

use of android.telephony.CallAttributes in project android_frameworks_opt_telephony by LineageOS.

the class CallAttributesTest method testParcelUnparcelPreciseCallState.

@SmallTest
public void testParcelUnparcelPreciseCallState() {
    CallQuality quality = new CallQuality();
    PreciseCallState pcs = new PreciseCallState();
    CallAttributes data = new CallAttributes(pcs, 10, quality);
    Parcel parcel = Parcel.obtain();
    data.writeToParcel(parcel, 0);
    parcel.setDataPosition(0);
    CallAttributes unparceledData = CallAttributes.CREATOR.createFromParcel(parcel);
    parcel.recycle();
    assertEquals("PreciseCallState is not equal after parceled/unparceled", data.getPreciseCallState(), unparceledData.getPreciseCallState());
}
Also used : PreciseCallState(android.telephony.PreciseCallState) CallQuality(android.telephony.CallQuality) Parcel(android.os.Parcel) CallAttributes(android.telephony.CallAttributes) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 2 with CallAttributes

use of android.telephony.CallAttributes in project android_frameworks_opt_telephony by LineageOS.

the class CallAttributesTest method testParcelUnparcelNetworkType.

@SmallTest
public void testParcelUnparcelNetworkType() {
    CallQuality quality = new CallQuality();
    PreciseCallState pcs = new PreciseCallState();
    CallAttributes data = new CallAttributes(pcs, 10, quality);
    Parcel parcel = Parcel.obtain();
    data.writeToParcel(parcel, 0);
    parcel.setDataPosition(0);
    CallAttributes unparceledData = CallAttributes.CREATOR.createFromParcel(parcel);
    parcel.recycle();
    assertEquals("NetworkType is not equal after parceled/unparceled", data.getNetworkType(), unparceledData.getNetworkType());
}
Also used : PreciseCallState(android.telephony.PreciseCallState) CallQuality(android.telephony.CallQuality) Parcel(android.os.Parcel) CallAttributes(android.telephony.CallAttributes) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 3 with CallAttributes

use of android.telephony.CallAttributes in project android_frameworks_opt_telephony by LineageOS.

the class CallAttributesTest method testParcelUnparcelCallQuality.

@SmallTest
public void testParcelUnparcelCallQuality() {
    CallQuality quality = new CallQuality();
    PreciseCallState pcs = new PreciseCallState();
    CallAttributes data = new CallAttributes(pcs, 10, quality);
    Parcel parcel = Parcel.obtain();
    data.writeToParcel(parcel, 0);
    parcel.setDataPosition(0);
    CallAttributes unparceledData = CallAttributes.CREATOR.createFromParcel(parcel);
    parcel.recycle();
    assertEquals("CallQuality is not equal after parceled/unparceled", data.getCallQuality(), unparceledData.getCallQuality());
}
Also used : PreciseCallState(android.telephony.PreciseCallState) CallQuality(android.telephony.CallQuality) Parcel(android.os.Parcel) CallAttributes(android.telephony.CallAttributes) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

Parcel (android.os.Parcel)3 CallAttributes (android.telephony.CallAttributes)3 CallQuality (android.telephony.CallQuality)3 PreciseCallState (android.telephony.PreciseCallState)3 SmallTest (android.test.suitebuilder.annotation.SmallTest)3