Loading src/java/com/android/internal/telephony/RIL.java +4 −0 Original line number Diff line number Diff line Loading @@ -1267,6 +1267,10 @@ public class RIL extends BaseCommands implements CommandsInterface { handleRadioProxyExceptionForRR(SIM_SERVICE, "supplySimDepersonalization", e); } } else { if (PersoSubState.PERSOSUBSTATE_SIM_NETWORK == persoType) { supplyNetworkDepersonalization(controlKey, result); return; } if (RILJ_LOGD) { Rlog.d(RILJ_LOG_TAG, "supplySimDepersonalization: REQUEST_NOT_SUPPORTED"); } Loading tests/telephonytests/src/com/android/internal/telephony/RILTest.java +75 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static com.android.internal.telephony.RILConstants.RIL_REQUEST_DEVICE_IDE import static com.android.internal.telephony.RILConstants.RIL_REQUEST_DTMF; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENABLE_UICC_APPLICATIONS; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_DEPERSONALIZATION; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_PIN; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_PIN2; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_PUK; Loading Loading @@ -168,6 +169,8 @@ import android.util.SparseArray; import androidx.test.filters.FlakyTest; import com.android.internal.telephony.uicc.IccCardApplicationStatus.PersoSubState; import org.junit.After; import org.junit.Before; import org.junit.Test; Loading Loading @@ -471,6 +474,78 @@ public class RILTest extends TelephonyTest { RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION); } @FlakyTest @Test public void testSupplySimDepersonalization() throws Exception { String controlKey = "1234"; PersoSubState persoType = PersoSubState.PERSOSUBSTATE_SIM_NETWORK_PUK; // Not supported on Radio 1.0. mRILUnderTest.supplySimDepersonalization(persoType, controlKey, obtainMessage()); verify(mRadioProxy, never()).supplySimDepersonalization(anyInt(), anyInt(), eq(controlKey)); verify(mRadioProxy, never()).supplyNetworkDepersonalization( anyInt(), eq(controlKey)); // Make radio version 1.5 to support the operation. try { replaceInstance(RIL.class, "mRadioVersion", mRILUnderTest, mRadioVersionV15); } catch (Exception e) { } mRILUnderTest.supplySimDepersonalization(persoType, controlKey, obtainMessage()); verify(mRadioProxy).supplySimDepersonalization( mSerialNumberCaptor.capture(), eq((int) invokeMethod( mRILInstance, "convertPersoTypeToHalPersoType", new Class<?>[] {PersoSubState.class}, new Object[] {persoType})), eq(controlKey)); verifyRILResponse( mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_ENTER_SIM_DEPERSONALIZATION); } @FlakyTest @Test public void testSupplySimDepersonalizationWithNetworkLock() throws Exception { String controlKey = "1234"; PersoSubState persoType = PersoSubState.PERSOSUBSTATE_SIM_NETWORK; // use supplyNetworkDepersonalization on Radio 1.0. mRILUnderTest.supplySimDepersonalization(persoType, controlKey, obtainMessage()); verify(mRadioProxy, never()).supplySimDepersonalization(anyInt(), anyInt(), eq(controlKey)); verify(mRadioProxy).supplyNetworkDepersonalization( mSerialNumberCaptor.capture(), eq(controlKey)); verifyRILResponse( mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION); // Make radio version 1.5 to support the operation. try { replaceInstance(RIL.class, "mRadioVersion", mRILUnderTest, mRadioVersionV15); } catch (Exception e) { } mRILUnderTest.supplySimDepersonalization(persoType, controlKey, obtainMessage()); verify(mRadioProxy).supplySimDepersonalization( mSerialNumberCaptor.capture(), eq((int) invokeMethod( mRILInstance, "convertPersoTypeToHalPersoType", new Class<?>[] {PersoSubState.class}, new Object[] {persoType})), eq(controlKey)); verifyRILResponse( mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_ENTER_SIM_DEPERSONALIZATION); } @FlakyTest @Test public void testGetCurrentCalls() throws Exception { Loading Loading
src/java/com/android/internal/telephony/RIL.java +4 −0 Original line number Diff line number Diff line Loading @@ -1267,6 +1267,10 @@ public class RIL extends BaseCommands implements CommandsInterface { handleRadioProxyExceptionForRR(SIM_SERVICE, "supplySimDepersonalization", e); } } else { if (PersoSubState.PERSOSUBSTATE_SIM_NETWORK == persoType) { supplyNetworkDepersonalization(controlKey, result); return; } if (RILJ_LOGD) { Rlog.d(RILJ_LOG_TAG, "supplySimDepersonalization: REQUEST_NOT_SUPPORTED"); } Loading
tests/telephonytests/src/com/android/internal/telephony/RILTest.java +75 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static com.android.internal.telephony.RILConstants.RIL_REQUEST_DEVICE_IDE import static com.android.internal.telephony.RILConstants.RIL_REQUEST_DTMF; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENABLE_UICC_APPLICATIONS; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_DEPERSONALIZATION; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_PIN; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_PIN2; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_PUK; Loading Loading @@ -168,6 +169,8 @@ import android.util.SparseArray; import androidx.test.filters.FlakyTest; import com.android.internal.telephony.uicc.IccCardApplicationStatus.PersoSubState; import org.junit.After; import org.junit.Before; import org.junit.Test; Loading Loading @@ -471,6 +474,78 @@ public class RILTest extends TelephonyTest { RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION); } @FlakyTest @Test public void testSupplySimDepersonalization() throws Exception { String controlKey = "1234"; PersoSubState persoType = PersoSubState.PERSOSUBSTATE_SIM_NETWORK_PUK; // Not supported on Radio 1.0. mRILUnderTest.supplySimDepersonalization(persoType, controlKey, obtainMessage()); verify(mRadioProxy, never()).supplySimDepersonalization(anyInt(), anyInt(), eq(controlKey)); verify(mRadioProxy, never()).supplyNetworkDepersonalization( anyInt(), eq(controlKey)); // Make radio version 1.5 to support the operation. try { replaceInstance(RIL.class, "mRadioVersion", mRILUnderTest, mRadioVersionV15); } catch (Exception e) { } mRILUnderTest.supplySimDepersonalization(persoType, controlKey, obtainMessage()); verify(mRadioProxy).supplySimDepersonalization( mSerialNumberCaptor.capture(), eq((int) invokeMethod( mRILInstance, "convertPersoTypeToHalPersoType", new Class<?>[] {PersoSubState.class}, new Object[] {persoType})), eq(controlKey)); verifyRILResponse( mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_ENTER_SIM_DEPERSONALIZATION); } @FlakyTest @Test public void testSupplySimDepersonalizationWithNetworkLock() throws Exception { String controlKey = "1234"; PersoSubState persoType = PersoSubState.PERSOSUBSTATE_SIM_NETWORK; // use supplyNetworkDepersonalization on Radio 1.0. mRILUnderTest.supplySimDepersonalization(persoType, controlKey, obtainMessage()); verify(mRadioProxy, never()).supplySimDepersonalization(anyInt(), anyInt(), eq(controlKey)); verify(mRadioProxy).supplyNetworkDepersonalization( mSerialNumberCaptor.capture(), eq(controlKey)); verifyRILResponse( mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION); // Make radio version 1.5 to support the operation. try { replaceInstance(RIL.class, "mRadioVersion", mRILUnderTest, mRadioVersionV15); } catch (Exception e) { } mRILUnderTest.supplySimDepersonalization(persoType, controlKey, obtainMessage()); verify(mRadioProxy).supplySimDepersonalization( mSerialNumberCaptor.capture(), eq((int) invokeMethod( mRILInstance, "convertPersoTypeToHalPersoType", new Class<?>[] {PersoSubState.class}, new Object[] {persoType})), eq(controlKey)); verifyRILResponse( mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_ENTER_SIM_DEPERSONALIZATION); } @FlakyTest @Test public void testGetCurrentCalls() throws Exception { Loading