Remove obsolete getIsimChallengeResponse

This method is fully superceded by getIccAuthentication
Any callers should use the new method instead.

Bug: 27954896
Test: compilation
Change-Id: I8fb81a6c6cb1dcb278f4fe9d4ac4d3ae54a342c2
diff --git a/src/java/com/android/internal/telephony/CommandsInterface.java b/src/java/com/android/internal/telephony/CommandsInterface.java
index 3731e02..483546f 100644
--- a/src/java/com/android/internal/telephony/CommandsInterface.java
+++ b/src/java/com/android/internal/telephony/CommandsInterface.java
@@ -1722,18 +1722,6 @@
     public int getLteOnCdmaMode();
 
     /**
-     * Request the ISIM application on the UICC to perform the AKA
-     * challenge/response algorithm for IMS authentication. The nonce string
-     * and challenge response are Base64 encoded Strings.
-     *
-     * @param nonce the nonce string to pass with the ISIM authentication request
-     * @param response a callback message with the String response in the obj field
-     * @deprecated
-     * @see requestIccSimAuthentication
-     */
-    public void requestIsimAuthentication(String nonce, Message response);
-
-    /**
      * Request the SIM application on the UICC to perform authentication
      * challenge/response algorithm. The data string and challenge response are
      * Base64 encoded Strings.
diff --git a/src/java/com/android/internal/telephony/PhoneSubInfoController.java b/src/java/com/android/internal/telephony/PhoneSubInfoController.java
index 9cd088f..f085742 100644
--- a/src/java/com/android/internal/telephony/PhoneSubInfoController.java
+++ b/src/java/com/android/internal/telephony/PhoneSubInfoController.java
@@ -26,8 +26,8 @@
 import android.os.ServiceManager;
 import android.telephony.ImsiEncryptionInfo;
 import android.telephony.PhoneNumberUtils;
-import android.telephony.SubscriptionManager;
 import android.telephony.Rlog;
+import android.telephony.SubscriptionManager;
 
 import com.android.internal.telephony.uicc.IsimRecords;
 import com.android.internal.telephony.uicc.UiccCard;
@@ -432,18 +432,6 @@
         }
     }
 
-    public String getIsimChallengeResponse(String nonce) throws RemoteException {
-        Phone phone = getPhone(getDefaultSubscription());
-        mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE,
-                "Requires READ_PRIVILEGED_PHONE_STATE");
-        IsimRecords isim = phone.getIsimRecords();
-        if (isim != null) {
-            return isim.getIsimChallengeResponse(nonce);
-        } else {
-            return null;
-        }
-    }
-
     public String getIccSimChallengeResponse(int subId, int appType, int authType, String data)
             throws RemoteException {
         Phone phone = getPhone(subId);
diff --git a/src/java/com/android/internal/telephony/RIL.java b/src/java/com/android/internal/telephony/RIL.java
index 582500e..fab8c03 100644
--- a/src/java/com/android/internal/telephony/RIL.java
+++ b/src/java/com/android/internal/telephony/RIL.java
@@ -2879,26 +2879,6 @@
     }
 
     @Override
-    public void requestIsimAuthentication(String nonce, Message result) {
-        IRadio radioProxy = getRadioProxy(result);
-        if (radioProxy != null) {
-            RILRequest rr = obtainRequest(RIL_REQUEST_ISIM_AUTHENTICATION, result,
-                    mRILDefaultWorkSource);
-
-            if (RILJ_LOGD) {
-                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
-                        + " nonce = " + nonce);
-            }
-
-            try {
-                radioProxy.requestIsimAuthentication(rr.mSerial, convertNullToEmptyString(nonce));
-            } catch (RemoteException | RuntimeException e) {
-                handleRadioProxyExceptionForRR(rr, "requestIsimAuthentication", e);
-            }
-        }
-    }
-
-    @Override
     public void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message result) {
         IRadio radioProxy = getRadioProxy(result);
         if (radioProxy != null) {
diff --git a/src/java/com/android/internal/telephony/RadioResponse.java b/src/java/com/android/internal/telephony/RadioResponse.java
index e54b7ab..c140933 100644
--- a/src/java/com/android/internal/telephony/RadioResponse.java
+++ b/src/java/com/android/internal/telephony/RadioResponse.java
@@ -914,12 +914,13 @@
     }
 
     /**
+     * This method is deprecated and should not be used.
      *
      * @param responseInfo Response info struct containing response type, serial no. and error
      * @param response response string of the challenge/response algo for ISIM auth in base64 format
      */
     public void requestIsimAuthenticationResponse(RadioResponseInfo responseInfo, String response) {
-        responseString(responseInfo, response);
+        throw new RuntimeException("Inexplicable response received for requestIsimAuthentication");
     }
 
     /**
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCommandInterface.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCommandInterface.java
index 2683a80..4b1e2a0 100644
--- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCommandInterface.java
+++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCommandInterface.java
@@ -548,10 +548,6 @@
     }
 
     @Override
-    public void requestIsimAuthentication(String nonce, Message response) {
-    }
-
-    @Override
     public void requestIccSimAuthentication(int authContext, String data, String aid, Message response) {
     }
 
diff --git a/src/java/com/android/internal/telephony/sip/SipCommandInterface.java b/src/java/com/android/internal/telephony/sip/SipCommandInterface.java
index 69832e8..2bbc65c 100644
--- a/src/java/com/android/internal/telephony/sip/SipCommandInterface.java
+++ b/src/java/com/android/internal/telephony/sip/SipCommandInterface.java
@@ -549,10 +549,6 @@
     }
 
     @Override
-    public void requestIsimAuthentication(String nonce, Message response) {
-    }
-
-    @Override
     public void requestIccSimAuthentication(int authContext, String data, String aid, Message response) {
     }
 
diff --git a/src/java/com/android/internal/telephony/test/SimulatedCommands.java b/src/java/com/android/internal/telephony/test/SimulatedCommands.java
index f80e32e..44b7745 100644
--- a/src/java/com/android/internal/telephony/test/SimulatedCommands.java
+++ b/src/java/com/android/internal/telephony/test/SimulatedCommands.java
@@ -1828,11 +1828,6 @@
     }
 
     @Override
-    public void requestIsimAuthentication(String nonce, Message response) {
-        unimplemented(response);
-    }
-
-    @Override
     public void requestIccSimAuthentication(int authContext, String data, String aid, Message response) {
         unimplemented(response);
     }
diff --git a/src/java/com/android/internal/telephony/test/SimulatedCommandsVerifier.java b/src/java/com/android/internal/telephony/test/SimulatedCommandsVerifier.java
index 40b15a9..fb69333 100644
--- a/src/java/com/android/internal/telephony/test/SimulatedCommandsVerifier.java
+++ b/src/java/com/android/internal/telephony/test/SimulatedCommandsVerifier.java
@@ -1189,11 +1189,6 @@
     }
 
     @Override
-    public void requestIsimAuthentication(String nonce, Message response) {
-
-    }
-
-    @Override
     public void requestIccSimAuthentication(int authContext, String data, String aid,
                                             Message response) {
 
diff --git a/src/java/com/android/internal/telephony/uicc/IsimRecords.java b/src/java/com/android/internal/telephony/uicc/IsimRecords.java
index b176d4e..019cc79 100644
--- a/src/java/com/android/internal/telephony/uicc/IsimRecords.java
+++ b/src/java/com/android/internal/telephony/uicc/IsimRecords.java
@@ -54,11 +54,4 @@
      *      not present or not loaded
      */
     String[] getIsimPcscf();
-
-    /**
-     * Returns the response of ISIM Authetification through RIL.
-     * Returns null if the Authentification hasn't been successed or isn't present iphonesubinfo.
-     * @return the response of ISIM Authetification, or null if not available
-     */
-    String getIsimChallengeResponse(String nonce);
 }
diff --git a/src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java b/src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java
index 93c49d5..3b33c03 100644
--- a/src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java
+++ b/src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java
@@ -404,33 +404,6 @@
         return (mIsimPcscf != null) ? mIsimPcscf.clone() : null;
     }
 
-    /**
-     * Returns the response of ISIM Authetification through RIL.
-     * Returns null if the Authentification hasn't been successed or isn't present iphonesubinfo.
-     * @return the response of ISIM Authetification, or null if not available
-     */
-    @Override
-    public String getIsimChallengeResponse(String nonce){
-        if (DBG) log("getIsimChallengeResponse-nonce:"+nonce);
-        try {
-            synchronized(mLock) {
-                mCi.requestIsimAuthentication(nonce,obtainMessage(EVENT_ISIM_AUTHENTICATE_DONE));
-                try {
-                    mLock.wait();
-                } catch (InterruptedException e) {
-                    log("interrupted while trying to request Isim Auth");
-                }
-            }
-        } catch(Exception e) {
-            if (DBG) log( "Fail while trying to request Isim Auth");
-            return null;
-        }
-
-        if (DBG) log("getIsimChallengeResponse-auth_rsp"+auth_rsp);
-
-        return auth_rsp;
-    }
-
     @Override
     public int getDisplayRule(ServiceState serviceState) {
         // Not applicable to Isim
diff --git a/tests/telephonytests/src/com/android/internal/telephony/RILTest.java b/tests/telephonytests/src/com/android/internal/telephony/RILTest.java
index f45c6ac..753e03c 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/RILTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/RILTest.java
@@ -45,7 +45,6 @@
 import static com.android.internal.telephony.RILConstants.RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND;
 import static com.android.internal.telephony.RILConstants.RIL_REQUEST_IMS_REGISTRATION_STATE;
 import static com.android.internal.telephony.RILConstants.RIL_REQUEST_IMS_SEND_SMS;
-import static com.android.internal.telephony.RILConstants.RIL_REQUEST_ISIM_AUTHENTICATION;
 import static com.android.internal.telephony.RILConstants.RIL_REQUEST_LAST_CALL_FAIL_CAUSE;
 import static com.android.internal.telephony.RILConstants.RIL_REQUEST_NV_READ_ITEM;
 import static com.android.internal.telephony.RILConstants.RIL_REQUEST_NV_RESET_CONFIG;
@@ -628,16 +627,6 @@
 
     @FlakyTest
     @Test
-    public void testRequestIsimAuthentication() throws Exception {
-        String nonce = "nonce";
-        mRILUnderTest.requestIsimAuthentication(nonce, obtainMessage());
-        verify(mRadioProxy).requestIsimAuthentication(mSerialNumberCaptor.capture(), eq(nonce));
-        verifyRILResponse(
-                mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_ISIM_AUTHENTICATION);
-    }
-
-    @FlakyTest
-    @Test
     public void testAcknowledgeIncomingGsmSmsWithPdu() throws Exception {
         boolean success = true;
         String ackPdu = "ackPdu";