Search in sources :

Example 1 with NvWriteItem

use of android.hardware.radio.V1_0.NvWriteItem in project android_frameworks_opt_telephony by LineageOS.

the class RIL method nvWriteItem.

@Override
public void nvWriteItem(int itemId, String itemValue, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_NV_WRITE_ITEM, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " itemId = " + itemId + " itemValue = " + itemValue);
        }
        NvWriteItem item = new NvWriteItem();
        item.itemId = itemId;
        item.value = convertNullToEmptyString(itemValue);
        try {
            radioProxy.nvWriteItem(rr.mSerial, item);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "nvWriteItem", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) NvWriteItem(android.hardware.radio.V1_0.NvWriteItem) RemoteException(android.os.RemoteException)

Example 2 with NvWriteItem

use of android.hardware.radio.V1_0.NvWriteItem in project android_frameworks_opt_telephony by LineageOS.

the class RILTest method testNvWriteItem.

@FlakyTest
@Test
public void testNvWriteItem() throws Exception {
    int itemId = 1;
    String itemValue = "value";
    mRILUnderTest.nvWriteItem(itemId, itemValue, obtainMessage(), new WorkSource());
    NvWriteItem item = new NvWriteItem();
    item.itemId = itemId;
    item.value = itemValue;
    verify(mRadioProxy).nvWriteItem(mSerialNumberCaptor.capture(), eq(item));
    verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_NV_WRITE_ITEM);
}
Also used : NvWriteItem(android.hardware.radio.V1_0.NvWriteItem) WorkSource(android.os.WorkSource) FlakyTest(androidx.test.filters.FlakyTest) FlakyTest(androidx.test.filters.FlakyTest) Test(org.junit.Test)

Example 3 with NvWriteItem

use of android.hardware.radio.V1_0.NvWriteItem in project android_frameworks_opt_telephony by LineageOS.

the class RIL method nvWriteItem.

@Override
public void nvWriteItem(int itemId, String itemValue, Message result, WorkSource workSource) {
    workSource = getDeafultWorkSourceIfInvalid(workSource);
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_NV_WRITE_ITEM, result, workSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " itemId = " + itemId + " itemValue = " + itemValue);
        }
        NvWriteItem item = new NvWriteItem();
        item.itemId = itemId;
        item.value = convertNullToEmptyString(itemValue);
        try {
            radioProxy.nvWriteItem(rr.mSerial, item);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "nvWriteItem", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) NvWriteItem(android.hardware.radio.V1_0.NvWriteItem) RemoteException(android.os.RemoteException)

Aggregations

NvWriteItem (android.hardware.radio.V1_0.NvWriteItem)3 IRadio (android.hardware.radio.V1_0.IRadio)2 RemoteException (android.os.RemoteException)2 WorkSource (android.os.WorkSource)1 FlakyTest (androidx.test.filters.FlakyTest)1 Test (org.junit.Test)1