Merge "API Council feedback for IKE 3GPP support."
diff --git a/api/system-current.txt b/api/system-current.txt
index fd1f09e..095de74 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -40,34 +40,32 @@
 
 package android.net.ipsec.ike.ike3gpp {
 
-  public final class Ike3gppBackoffTimer extends android.net.ipsec.ike.ike3gpp.Ike3gppInfo {
+  public final class Ike3gppBackoffTimer extends android.net.ipsec.ike.ike3gpp.Ike3gppData {
     method public int getBackoffCause();
     method public byte getBackoffTimer();
-    method public int getInfoType();
+    method public int getDataType();
     field public static final int ERROR_TYPE_NETWORK_FAILURE = 10500; // 0x2904
     field public static final int ERROR_TYPE_NO_APN_SUBSCRIPTION = 9002; // 0x232a
   }
 
+  public abstract class Ike3gppData {
+    method public abstract int getDataType();
+    field public static final int DATA_TYPE_NOTIFY_BACKOFF_TIMER = 2; // 0x2
+    field public static final int DATA_TYPE_NOTIFY_N1_MODE_INFORMATION = 1; // 0x1
+  }
+
   public final class Ike3gppExtension {
-    ctor public Ike3gppExtension(@NonNull android.net.ipsec.ike.ike3gpp.Ike3gppParams, @NonNull android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppCallback);
-    method @NonNull public android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppCallback getIke3gppCallback();
+    ctor public Ike3gppExtension(@NonNull android.net.ipsec.ike.ike3gpp.Ike3gppParams, @NonNull android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppDataListener);
+    method @NonNull public android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppDataListener getIke3gppDataListener();
     method @NonNull public android.net.ipsec.ike.ike3gpp.Ike3gppParams getIke3gppParams();
   }
 
-  public abstract static class Ike3gppExtension.Ike3gppCallback {
-    ctor public Ike3gppExtension.Ike3gppCallback();
-    method public abstract void onIke3gppPayloadsReceived(@NonNull java.util.List<android.net.ipsec.ike.ike3gpp.Ike3gppInfo>);
+  public static interface Ike3gppExtension.Ike3gppDataListener {
+    method public void onIke3gppDataReceived(@NonNull java.util.List<android.net.ipsec.ike.ike3gpp.Ike3gppData>);
   }
 
-  public abstract class Ike3gppInfo {
-    ctor public Ike3gppInfo();
-    method public abstract int getInfoType();
-    field public static final int INFO_TYPE_NOTIFY_BACKOFF_TIMER = 2; // 0x2
-    field public static final int INFO_TYPE_NOTIFY_N1_MODE_INFORMATION = 1; // 0x1
-  }
-
-  public final class Ike3gppN1ModeInformation extends android.net.ipsec.ike.ike3gpp.Ike3gppInfo {
-    method public int getInfoType();
+  public final class Ike3gppN1ModeInformation extends android.net.ipsec.ike.ike3gpp.Ike3gppData {
+    method public int getDataType();
     method @NonNull public byte[] getSnssai();
   }
 
diff --git a/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppBackoffTimer.java b/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppBackoffTimer.java
index bdf5b46..30a20d5 100644
--- a/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppBackoffTimer.java
+++ b/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppBackoffTimer.java
@@ -33,7 +33,7 @@
  * @hide
  */
 @SystemApi
-public final class Ike3gppBackoffTimer extends Ike3gppInfo {
+public final class Ike3gppBackoffTimer extends Ike3gppData {
     /**
      * Error-Notify indicating that access is not authorized because no subscription was found for
      * the specified APN.
@@ -83,8 +83,8 @@
     }
 
     @Override
-    public @InfoType int getInfoType() {
-        return INFO_TYPE_NOTIFY_BACKOFF_TIMER;
+    public @DataType int getDataType() {
+        return DATA_TYPE_NOTIFY_BACKOFF_TIMER;
     }
 
     /**
diff --git a/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppData.java b/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppData.java
new file mode 100644
index 0000000..3aae560
--- /dev/null
+++ b/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppData.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.ipsec.ike.ike3gpp;
+
+import android.annotation.IntDef;
+import android.annotation.SystemApi;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Ike3gppData represents 3GPP-specific data sent by the peer/remote endpoint.
+ *
+ * @see 3GPP ETSI TS 24.302: Access to the 3GPP Evolved Packet Core (EPC) via non-3GPP access
+ *     networks
+ * @hide
+ */
+@SystemApi
+public abstract class Ike3gppData {
+    private static final int DATA_TYPE_SHARED_BASE = 0;
+    private static final int DATA_TYPE_CATEGORY_SIZE = 100;
+
+    private static final int DATA_TYPE_PAYLOAD_NOTIFY_BASE = DATA_TYPE_SHARED_BASE;
+
+    /** Data Type representing an {@link Ike3gppN1ModeInformation}. */
+    public static final int DATA_TYPE_NOTIFY_N1_MODE_INFORMATION =
+            DATA_TYPE_PAYLOAD_NOTIFY_BASE + 1;
+
+    /** Data Type representing an {@link Ike3gppBackoffTimer}. */
+    public static final int DATA_TYPE_NOTIFY_BACKOFF_TIMER = DATA_TYPE_PAYLOAD_NOTIFY_BASE + 2;
+
+    /** @hide */
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef({DATA_TYPE_NOTIFY_N1_MODE_INFORMATION, DATA_TYPE_NOTIFY_BACKOFF_TIMER})
+    public @interface DataType {}
+
+    /** @hide */
+    protected Ike3gppData() {}
+
+    /** Returns the DataType that this Ike3gppData represents. */
+    public abstract @DataType int getDataType();
+}
diff --git a/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppExtension.java b/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppExtension.java
index 03274db..2165e3f 100644
--- a/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppExtension.java
+++ b/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppExtension.java
@@ -36,33 +36,34 @@
 @SystemApi
 public final class Ike3gppExtension {
     @NonNull private final Ike3gppParams mIke3gppParams;
-    @NonNull private final Ike3gppCallback mIke3gppCallback;
+    @NonNull private final Ike3gppDataListener mIke3gppDataListener;
 
     /**
-     * Constructs an Ike3gppExtension instance with the given Ike3gppCallback and Ike3gppParams
+     * Constructs an Ike3gppExtension instance with the given Ike3gppDataListener and Ike3gppParams
      * instances.
      *
      * @param ike3gppParams Ike3gppParams used to configure the 3GPP-support for an IKE Session.
-     * @param ike3gppCallback Ike3gppCallback used to notify the caller of 3GPP-specific payloads
-     *     received during an IKE Session.
+     * @param ike3gppDataListener Ike3gppDataListener used to notify the caller of 3GPP-specific
+     *     data received during an IKE Session.
      */
-    // ExecutorRegistration: Not necessary to take an Executor for invoking the callback here, as
-    // this is not actually where the callback is registered. The caller's Executor provided in the
-    // IkeSession constructor will be used to invoke the Ike3gppCallback.
+    // ExecutorRegistration: Not necessary to take an Executor for invoking the listener here, as
+    // this is not actually where the listener is registered. The caller's Executor provided in the
+    // IkeSession constructor will be used to invoke the Ike3gppDataListener.
     @SuppressLint("ExecutorRegistration")
     public Ike3gppExtension(
-            @NonNull Ike3gppParams ike3gppParams, @NonNull Ike3gppCallback ike3gppCallback) {
+            @NonNull Ike3gppParams ike3gppParams,
+            @NonNull Ike3gppDataListener ike3gppDataListener) {
         Objects.requireNonNull(ike3gppParams, "ike3gppParams must not be null");
-        Objects.requireNonNull(ike3gppCallback, "ike3gppCallback must not be null");
+        Objects.requireNonNull(ike3gppDataListener, "ike3gppDataListener must not be null");
 
         mIke3gppParams = ike3gppParams;
-        mIke3gppCallback = ike3gppCallback;
+        mIke3gppDataListener = ike3gppDataListener;
     }
 
-    /** Retrieves the configured Ike3gppCallback. */
+    /** Retrieves the configured Ike3gppDataListener. */
     @NonNull
-    public Ike3gppCallback getIke3gppCallback() {
-        return mIke3gppCallback;
+    public Ike3gppDataListener getIke3gppDataListener() {
+        return mIke3gppDataListener;
     }
 
     /** Retrieves the configured Ike3gppParams. */
@@ -73,7 +74,7 @@
 
     @Override
     public int hashCode() {
-        return Objects.hash(mIke3gppParams, mIke3gppCallback);
+        return Objects.hash(mIke3gppParams, mIke3gppDataListener);
     }
 
     @Override
@@ -85,26 +86,26 @@
         Ike3gppExtension other = (Ike3gppExtension) o;
 
         return mIke3gppParams.equals(other.mIke3gppParams)
-                && mIke3gppCallback.equals(other.mIke3gppCallback);
+                && mIke3gppDataListener.equals(other.mIke3gppDataListener);
     }
 
     /**
-     * Callback for receiving 3GPP-specific payloads.
+     * Listener for receiving 3GPP-specific data.
      *
      * <p>MUST be unique to each IKE Session.
      *
-     * <p>All Ike3gppCallback calls will be invoked on the Executor provided in the IkeSession
+     * <p>All Ike3gppDataListener calls will be invoked on the Executor provided in the IkeSession
      * constructor.
      */
-    public abstract static class Ike3gppCallback {
+    public interface Ike3gppDataListener {
         /**
-         * Invoked when the IKE Session receives one or more 3GPP-specific payloads.
+         * Invoked when the IKE Session receives 3GPP-specific data.
          *
          * <p>This function will be invoked at most once for each IKE Message received by the IKEv2
          * library.
          *
-         * @param payloads List<Ike3gppInfo> the 3GPP-payloads received
+         * @param ike3gppDataList List<Ike3gppData> the 3GPP-data received
          */
-        public abstract void onIke3gppPayloadsReceived(@NonNull List<Ike3gppInfo> payloads);
+        void onIke3gppDataReceived(@NonNull List<Ike3gppData> ike3gppDataList);
     }
 }
diff --git a/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppInfo.java b/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppInfo.java
deleted file mode 100644
index 2379472..0000000
--- a/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppInfo.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.net.ipsec.ike.ike3gpp;
-
-import android.annotation.IntDef;
-import android.annotation.SystemApi;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * Ike3gppInfo represents a 3GPP-specific payload sent by the peer/remote endpoint.
- *
- * @see 3GPP ETSI TS 24.302: Access to the 3GPP Evolved Packet Core (EPC) via non-3GPP access
- *     networks
- * @hide
- */
-@SystemApi
-public abstract class Ike3gppInfo {
-    private static final int INFO_TYPE_SHARED_BASE = 0;
-    private static final int INFO_TYPE_CATEGORY_SIZE = 100;
-
-    private static final int INFO_TYPE_PAYLOAD_NOTIFY_BASE = INFO_TYPE_SHARED_BASE;
-
-    /** Info Type representing an {@link Ike3gppN1ModeInformation}. */
-    public static final int INFO_TYPE_NOTIFY_N1_MODE_INFORMATION =
-            INFO_TYPE_PAYLOAD_NOTIFY_BASE + 1;
-
-    /** Info Type representing an {@link Ike3gppBackoffTimer}. */
-    public static final int INFO_TYPE_NOTIFY_BACKOFF_TIMER = INFO_TYPE_PAYLOAD_NOTIFY_BASE + 2;
-
-    /** @hide */
-    @Retention(RetentionPolicy.SOURCE)
-    @IntDef({INFO_TYPE_NOTIFY_N1_MODE_INFORMATION, INFO_TYPE_NOTIFY_BACKOFF_TIMER})
-    public @interface InfoType {}
-
-    /** Returns the InfoType that this Ike3gppInfo represents. */
-    public abstract @InfoType int getInfoType();
-}
diff --git a/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppN1ModeInformation.java b/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppN1ModeInformation.java
index 8c538ab..bfa9e44 100644
--- a/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppN1ModeInformation.java
+++ b/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppN1ModeInformation.java
@@ -29,7 +29,7 @@
  * @hide
  */
 @SystemApi
-public final class Ike3gppN1ModeInformation extends Ike3gppInfo {
+public final class Ike3gppN1ModeInformation extends Ike3gppData {
     private final byte[] mSnssai;
 
     /** @hide */
@@ -39,8 +39,8 @@
     }
 
     @Override
-    public @InfoType int getInfoType() {
-        return INFO_TYPE_NOTIFY_N1_MODE_INFORMATION;
+    public @DataType int getDataType() {
+        return DATA_TYPE_NOTIFY_N1_MODE_INFORMATION;
     }
 
     /**
diff --git a/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExchangeBase.java b/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExchangeBase.java
index 1e67ba7..88aa114 100644
--- a/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExchangeBase.java
+++ b/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExchangeBase.java
@@ -18,8 +18,8 @@
 import static android.net.ipsec.ike.IkeManager.getIkeLog;
 
 import android.annotation.NonNull;
+import android.net.ipsec.ike.ike3gpp.Ike3gppData;
 import android.net.ipsec.ike.ike3gpp.Ike3gppExtension;
-import android.net.ipsec.ike.ike3gpp.Ike3gppInfo;
 
 import java.util.List;
 import java.util.Objects;
@@ -44,17 +44,17 @@
         mUserCbExecutor = Objects.requireNonNull(userCbExecutor, "userCbExecutor must not be null");
     }
 
-    void maybeInvokeUserCallback(List<Ike3gppInfo> ike3gppInfos) {
-        if (ike3gppInfos.isEmpty()) return;
+    void maybeInvokeUserCallback(List<Ike3gppData> ike3gppDataList) {
+        if (ike3gppDataList.isEmpty()) return;
 
         try {
             mUserCbExecutor.execute(
                     () ->
                             mIke3gppExtension
-                                    .getIke3gppCallback()
-                                    .onIke3gppPayloadsReceived(ike3gppInfos));
+                                    .getIke3gppDataListener()
+                                    .onIke3gppDataReceived(ike3gppDataList));
         } catch (Exception e) {
-            getIkeLog().d(TAG, "Ike3gppCallback#onIke3gppPayloadsReceived execution failed", e);
+            getIkeLog().d(TAG, "Ike3gppDataListener#onIke3gppDataReceived execution failed", e);
         }
     }
 }
diff --git a/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExtensionExchange.java b/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExtensionExchange.java
index bd14086..152fea9 100644
--- a/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExtensionExchange.java
+++ b/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExtensionExchange.java
@@ -23,7 +23,7 @@
 import android.annotation.Nullable;
 import android.net.ipsec.ike.exceptions.InvalidSyntaxException;
 import android.net.ipsec.ike.ike3gpp.Ike3gppExtension;
-import android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppCallback;
+import android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppDataListener;
 import android.util.ArraySet;
 
 import com.android.internal.net.ipsec.ike.IkeSessionStateMachine;
@@ -39,9 +39,9 @@
  * Ike3gppExtensionExchange contains the implementation for 3GPP-specific functionality in IKEv2.
  */
 public class Ike3gppExtensionExchange implements AutoCloseable {
-    private static final String TAG = Ike3gppExtension.class.getSimpleName();
+    private static final String TAG = Ike3gppExtensionExchange.class.getSimpleName();
 
-    private static final Set<Ike3gppCallback> REGISTERED_CALLBACKS =
+    private static final Set<Ike3gppDataListener> REGISTERED_LISTENERS =
             Collections.synchronizedSet(new ArraySet<>());
 
     /**
@@ -100,9 +100,9 @@
         if (mIke3gppExtension != null) {
             mIke3gppIkeAuth = new Ike3gppIkeAuth(mIke3gppExtension, mUserCbExecutor);
 
-            if (!REGISTERED_CALLBACKS.add(ike3gppExtension.getIke3gppCallback())) {
+            if (!REGISTERED_LISTENERS.add(ike3gppExtension.getIke3gppDataListener())) {
                 throw new IllegalArgumentException(
-                        "Ike3gppCallback must be unique for each IkeSession");
+                        "Ike3gppDataListener must be unique for each IkeSession");
             }
         } else {
             mIke3gppIkeAuth = null;
@@ -113,7 +113,7 @@
     public void close() {
         if (mIke3gppExtension == null) return;
 
-        REGISTERED_CALLBACKS.remove(mIke3gppExtension.getIke3gppCallback());
+        REGISTERED_LISTENERS.remove(mIke3gppExtension.getIke3gppDataListener());
     }
 
     /** Gets the 3GPP-specific Request IkePayloads for the specified exchangeSubtype. */
@@ -155,8 +155,8 @@
     /**
      * Handles the provided Response IkePayloads for the specified exchangeSubtype.
      *
-     * <p>If the caller needs to be notified of received Ike3gppInfos, the configured
-     * Ike3gppCallback will be invoked.
+     * <p>If the caller needs to be notified of received Ike3gppData, the configured
+     * Ike3gppDataListener will be invoked.
      */
     public void handle3gppResponsePayloads(int exchangeSubtype, List<IkePayload> ike3gppPayloads)
             throws InvalidSyntaxException {
diff --git a/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppIkeAuth.java b/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppIkeAuth.java
index 1919375..f3672f1 100644
--- a/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppIkeAuth.java
+++ b/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppIkeAuth.java
@@ -25,8 +25,8 @@
 import android.annotation.NonNull;
 import android.net.ipsec.ike.exceptions.InvalidSyntaxException;
 import android.net.ipsec.ike.ike3gpp.Ike3gppBackoffTimer;
+import android.net.ipsec.ike.ike3gpp.Ike3gppData;
 import android.net.ipsec.ike.ike3gpp.Ike3gppExtension;
-import android.net.ipsec.ike.ike3gpp.Ike3gppInfo;
 import android.net.ipsec.ike.ike3gpp.Ike3gppN1ModeInformation;
 import android.util.ArraySet;
 
@@ -91,7 +91,7 @@
     }
 
     void handleAuthResp(List<IkePayload> ike3gppPayloads) throws InvalidSyntaxException {
-        List<Ike3gppInfo> ike3gppInfos = new ArrayList<>();
+        List<Ike3gppData> ike3gppDataList = new ArrayList<>();
         List<IkeNotifyPayload> notifyPayloads =
                 IkePayload.getPayloadListForTypeInProvidedList(
                         IkePayload.PAYLOAD_TYPE_NOTIFY, IkeNotifyPayload.class, ike3gppPayloads);
@@ -109,7 +109,7 @@
 
                     byte[] snssai =
                             Ike3gppN1ModeUtils.getSnssaiFromNotifyData(notifyPayload.notifyData);
-                    ike3gppInfos.add(new Ike3gppN1ModeInformation(snssai));
+                    ike3gppDataList.add(new Ike3gppN1ModeInformation(snssai));
                     break;
                 case NOTIFY_TYPE_BACKOFF_TIMER:
                     backoffTimerPayload = notifyPayload;
@@ -135,12 +135,13 @@
             byte backoffTimer =
                     Ike3gppBackoffTimerUtils.getBackoffTimerfromNotifyData(
                             backoffTimerPayload.notifyData);
-            ike3gppInfos.add(new Ike3gppBackoffTimer(backoffTimer, backoffTimerCause.notifyType));
+            ike3gppDataList.add(
+                    new Ike3gppBackoffTimer(backoffTimer, backoffTimerCause.notifyType));
         } else if (backoffTimerPayload != null) {
             logw("Received BACKOFF_TIMER payload without an Error-Notify");
         }
 
-        maybeInvokeUserCallback(ike3gppInfos);
+        maybeInvokeUserCallback(ike3gppDataList);
     }
 
     private void logd(String msg) {
diff --git a/tests/iketests/src/java/android/net/ipsec/ike/IkeSessionParamsTest.java b/tests/iketests/src/java/android/net/ipsec/ike/IkeSessionParamsTest.java
index f08bdfb..7ad524a 100644
--- a/tests/iketests/src/java/android/net/ipsec/ike/IkeSessionParamsTest.java
+++ b/tests/iketests/src/java/android/net/ipsec/ike/IkeSessionParamsTest.java
@@ -55,7 +55,7 @@
 import android.net.SocketKeepalive;
 import android.net.eap.EapSessionConfig;
 import android.net.ipsec.ike.ike3gpp.Ike3gppExtension;
-import android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppCallback;
+import android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppDataListener;
 import android.net.ipsec.ike.ike3gpp.Ike3gppParams;
 import android.os.PersistableBundle;
 import android.telephony.TelephonyManager;
@@ -284,7 +284,7 @@
     public void testEncodeIkeSessionParamsWith3gppExtension() throws Exception {
         Ike3gppExtension ike3gppExtension =
                 new Ike3gppExtension(
-                        new Ike3gppParams.Builder().build(), mock(Ike3gppCallback.class));
+                        new Ike3gppParams.Builder().build(), mock(Ike3gppDataListener.class));
 
         IkeSessionParams sessionParams =
                 buildWithPskCommon(REMOTE_IPV4_HOST_ADDRESS)
@@ -728,7 +728,7 @@
     public void testBuildWithIke3gppExtension() throws Exception {
         Ike3gppExtension ike3gppExtension =
                 new Ike3gppExtension(
-                        new Ike3gppParams.Builder().build(), mock(Ike3gppCallback.class));
+                        new Ike3gppParams.Builder().build(), mock(Ike3gppDataListener.class));
 
         IkeSessionParams sessionParams =
                 buildWithPskCommon(REMOTE_IPV4_HOST_ADDRESS)
diff --git a/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppBackoffTimerTest.java b/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppBackoffTimerTest.java
index ab576be..b0f966a 100644
--- a/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppBackoffTimerTest.java
+++ b/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppBackoffTimerTest.java
@@ -32,7 +32,7 @@
     public void testIke3gppBackoffTimer() {
         Ike3gppBackoffTimer backoffTimer = new Ike3gppBackoffTimer(BACKOFF_TIMER, BACKOFF_CAUSE);
 
-        assertEquals(Ike3gppInfo.INFO_TYPE_NOTIFY_BACKOFF_TIMER, backoffTimer.getInfoType());
+        assertEquals(Ike3gppData.DATA_TYPE_NOTIFY_BACKOFF_TIMER, backoffTimer.getDataType());
         assertEquals(BACKOFF_TIMER, backoffTimer.getBackoffTimer());
         assertEquals(BACKOFF_CAUSE, backoffTimer.getBackoffCause());
     }
diff --git a/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppExtensionTest.java b/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppExtensionTest.java
index 12658b6..62c41a3 100644
--- a/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppExtensionTest.java
+++ b/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppExtensionTest.java
@@ -20,7 +20,7 @@
 import static org.junit.Assert.assertNotEquals;
 import static org.mockito.Mockito.mock;
 
-import android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppCallback;
+import android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppDataListener;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -28,21 +28,21 @@
 public class Ike3gppExtensionTest {
     private static final byte PDU_SESSION_ID = (byte) 0x01;
 
-    private Ike3gppCallback mMockIke3gppCallback;
+    private Ike3gppDataListener mMockIke3gppDataListener;
     private Ike3gppParams mIke3gppParams;
 
     @Before
     public void setUp() {
-        mMockIke3gppCallback = mock(Ike3gppCallback.class);
+        mMockIke3gppDataListener = mock(Ike3gppDataListener.class);
         mIke3gppParams = new Ike3gppParams.Builder().build();
     }
 
     @Test
     public void testIke3gppExtensionConstructor() {
         Ike3gppExtension ike3gppExtension =
-                new Ike3gppExtension(mIke3gppParams, mMockIke3gppCallback);
+                new Ike3gppExtension(mIke3gppParams, mMockIke3gppDataListener);
 
-        assertEquals(mMockIke3gppCallback, ike3gppExtension.getIke3gppCallback());
+        assertEquals(mMockIke3gppDataListener, ike3gppExtension.getIke3gppDataListener());
         assertEquals(mIke3gppParams, ike3gppExtension.getIke3gppParams());
     }
 
@@ -53,7 +53,7 @@
 
     @Test(expected = NullPointerException.class)
     public void testIke3gppExtensionConstructorInvalidParams() {
-        Ike3gppExtension ike3gppExtension = new Ike3gppExtension(null, mMockIke3gppCallback);
+        Ike3gppExtension ike3gppExtension = new Ike3gppExtension(null, mMockIke3gppDataListener);
     }
 
     @Test
@@ -61,12 +61,12 @@
         Ike3gppExtension extensionA =
                 new Ike3gppExtension(
                         new Ike3gppParams.Builder().setPduSessionId(PDU_SESSION_ID).build(),
-                        mMockIke3gppCallback);
+                        mMockIke3gppDataListener);
 
         Ike3gppExtension extensionB =
                 new Ike3gppExtension(
                         new Ike3gppParams.Builder().setPduSessionId(PDU_SESSION_ID).build(),
-                        mMockIke3gppCallback);
+                        mMockIke3gppDataListener);
 
         assertEquals(extensionA, extensionB);
     }
@@ -74,12 +74,12 @@
     @Test
     public void testNotEquals() {
         Ike3gppExtension extensionA =
-                new Ike3gppExtension(new Ike3gppParams.Builder().build(), mMockIke3gppCallback);
+                new Ike3gppExtension(new Ike3gppParams.Builder().build(), mMockIke3gppDataListener);
 
         Ike3gppExtension extensionB =
                 new Ike3gppExtension(
                         new Ike3gppParams.Builder().setPduSessionId(PDU_SESSION_ID).build(),
-                        mMockIke3gppCallback);
+                        mMockIke3gppDataListener);
 
         assertNotEquals(extensionA, extensionB);
     }
diff --git a/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppN1ModeInformationTest.java b/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppN1ModeInformationTest.java
index 2f43b7b..f3ea3d2 100644
--- a/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppN1ModeInformationTest.java
+++ b/tests/iketests/src/java/android/net/ipsec/ike/ike3gpp/Ike3gppN1ModeInformationTest.java
@@ -31,7 +31,7 @@
         Ike3gppN1ModeInformation n1ModeInformation = new Ike3gppN1ModeInformation(SNSSAI);
 
         assertEquals(
-                Ike3gppInfo.INFO_TYPE_NOTIFY_N1_MODE_INFORMATION, n1ModeInformation.getInfoType());
+                Ike3gppData.DATA_TYPE_NOTIFY_N1_MODE_INFORMATION, n1ModeInformation.getDataType());
         assertArrayEquals(SNSSAI, n1ModeInformation.getSnssai());
     }
 
diff --git a/tests/iketests/src/java/com/android/internal/net/ipsec/ike/IkeSessionStateMachineTest.java b/tests/iketests/src/java/com/android/internal/net/ipsec/ike/IkeSessionStateMachineTest.java
index 528bbe2..eb68ab0 100644
--- a/tests/iketests/src/java/com/android/internal/net/ipsec/ike/IkeSessionStateMachineTest.java
+++ b/tests/iketests/src/java/com/android/internal/net/ipsec/ike/IkeSessionStateMachineTest.java
@@ -126,9 +126,9 @@
 import android.net.ipsec.ike.exceptions.UnrecognizedIkeProtocolException;
 import android.net.ipsec.ike.exceptions.UnsupportedCriticalPayloadException;
 import android.net.ipsec.ike.ike3gpp.Ike3gppBackoffTimer;
+import android.net.ipsec.ike.ike3gpp.Ike3gppData;
 import android.net.ipsec.ike.ike3gpp.Ike3gppExtension;
-import android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppCallback;
-import android.net.ipsec.ike.ike3gpp.Ike3gppInfo;
+import android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppDataListener;
 import android.net.ipsec.ike.ike3gpp.Ike3gppN1ModeInformation;
 import android.net.ipsec.ike.ike3gpp.Ike3gppParams;
 import android.os.Looper;
@@ -407,7 +407,7 @@
 
     private IkeLocalAddressGenerator mMockIkeLocalAddressGenerator;
 
-    private Ike3gppCallback mMockIke3gppCallback;
+    private Ike3gppDataListener mMockIke3gppDataListener;
     private Ike3gppExtension mIke3gppExtension;
 
     private X509Certificate mRootCertificate;
@@ -839,7 +839,7 @@
         mExpectedCurrentSaLocalReqMsgId = 0;
         mExpectedCurrentSaRemoteReqMsgId = 0;
 
-        mMockIke3gppCallback = mock(Ike3gppCallback.class);
+        mMockIke3gppDataListener = mock(Ike3gppDataListener.class);
 
         mMockIkeNattKeepalive = mock(IkeNattKeepalive.class);
     }
@@ -959,7 +959,7 @@
         Ike3gppExtension ike3gppExtension =
                 new Ike3gppExtension(
                         new Ike3gppParams.Builder().setPduSessionId(pduSessionId).build(),
-                        mMockIke3gppCallback);
+                        mMockIke3gppDataListener);
         return buildIkeSessionParamsCommon()
                 .setAuthPsk(mPsk)
                 .setIke3gppExtension(ike3gppExtension)
@@ -2400,27 +2400,8 @@
                 hasChildPayloads,
                 hasConfigPayloadInResp,
                 false /* isMobikeEnabled */,
-                0 /* ike3gppCallbackInvocations */);
-    }
-
-    private IkeMessage verifySharedKeyAuthentication(
-            IkeAuthPskPayload spyAuthPayload,
-            IkeIdPayload respIdPayload,
-            List<IkePayload> authRelatedPayloads,
-            boolean hasChildPayloads,
-            boolean hasConfigPayloadInResp,
-            boolean isMobikeEnabled,
-            int ike3gppCallbackInvocations)
-            throws Exception {
-        return verifySharedKeyAuthentication(
-                spyAuthPayload,
-                respIdPayload,
-                authRelatedPayloads,
-                hasChildPayloads,
-                hasConfigPayloadInResp,
-                isMobikeEnabled,
                 true /* isIpv4 */,
-                ike3gppCallbackInvocations);
+                0 /* ike3gppDataListenerInvocations */);
     }
 
     private IkeMessage verifySharedKeyAuthentication(
@@ -2431,7 +2412,7 @@
             boolean hasConfigPayloadInResp,
             boolean isMobikeEnabled,
             boolean isIpv4,
-            int ike3gppCallbackInvocations)
+            int ike3gppDataListenerInvocations)
             throws Exception {
         IkeMessage ikeAuthReqMessage =
                 verifyAuthenticationCommonAndGetIkeMessage(
@@ -2441,7 +2422,7 @@
                         hasConfigPayloadInResp,
                         isMobikeEnabled,
                         isIpv4,
-                        ike3gppCallbackInvocations);
+                        ike3gppDataListenerInvocations);
 
         // Validate authentication is done. Cannot use matchers because IkeAuthPskPayload is final.
         verify(spyAuthPayload)
@@ -2467,7 +2448,7 @@
             boolean hasConfigPayloadInResp,
             boolean isMobikeEnabled,
             boolean isIpv4,
-            int ike3gppCallbackInvocations)
+            int ike3gppDataListenerInvocations)
             throws Exception {
         // Send IKE AUTH response to IKE state machine
         ReceivedIkePacket authResp = makeIkeAuthRespWithChildPayloads(authRelatedPayloads);
@@ -2497,9 +2478,9 @@
         verifyDecodeEncryptedMessage(mSpyCurrentIkeSaRecord, authResp);
 
         // Validate that user has been notified. Expect one invocation for
-        // IkeSessionCallback#onOpened and 'ike3gppCallbackInvocations' invocations for
-        // Ike3gppCallback#onIke3gppPayloadsReceived
-        verify(mSpyUserCbExecutor, times(1 + ike3gppCallbackInvocations))
+        // IkeSessionCallback#onOpened and 'ike3gppDataListenerInvocations' invocations for
+        // Ike3gppDataListener#onIke3gppDataReceived
+        verify(mSpyUserCbExecutor, times(1 + ike3gppDataListenerInvocations))
                 .execute(any(Runnable.class));
 
         // Verify IkeSessionConfiguration
@@ -2616,8 +2597,8 @@
             }
         }
 
-        // Only expect a N1_MODE_CAPABILITY payload if an Ike3gppExention and PDU Session ID are
-        // specified.
+        // Only expect a N1_MODE_CAPABILITY payload if an Ike3gppExtension and PDU Session ID
+        // are specified.
         Ike3gppExtension ike3gppExtension =
                 mIkeSessionStateMachine.mIkeSessionParams.getIke3gppExtension();
         if (ike3gppExtension == null || !ike3gppExtension.getIke3gppParams().hasPduSessionId()) {
@@ -3205,7 +3186,8 @@
                 false /*hasChildPayloads*/,
                 false /*hasConfigPayloadInResp*/,
                 isMobikeEnabled,
-                0 /* ike3gppCallbackInvocations */);
+                true /* isIpv4 */,
+                0 /* ike3gppDataListenerInvocations */);
         verifyRetransmissionStopped();
     }
 
@@ -5217,13 +5199,13 @@
     @Test
     public void testIkeAuthWithN1Mode() throws Exception {
         verifyIkeAuthWith3gppEnabled(
-                makeN1ModeInformationPayload(), 1 /* ike3gppCallbackInvocations */);
+                makeN1ModeInformationPayload(), 1 /* ike3gppDataListenerInvocations */);
 
         verifyN1ModeReceived();
     }
 
     private void verifyIkeAuthWith3gppEnabled(
-            IkePayload ike3gppPayload, int ike3gppCallbackInvocations) throws Exception {
+            IkePayload ike3gppPayload, int ike3gppDataListenerInvocations) throws Exception {
         // Quit and restart IKE Session with N1 Mode Capability params
         mIkeSessionStateMachine.quitNow();
         reset(mMockChildSessionFactoryHelper);
@@ -5249,7 +5231,8 @@
                 true /*hasChildPayloads*/,
                 true /*hasConfigPayloadInResp*/,
                 false /* isMobikeEnabled */,
-                ike3gppCallbackInvocations);
+                true /* isIpv4 */,
+                ike3gppDataListenerInvocations);
         verifyRetransmissionStopped();
     }
 
@@ -5262,12 +5245,12 @@
     }
 
     private void verifyN1ModeReceived() {
-        ArgumentCaptor<List<Ike3gppInfo>> ike3gppInfoCaptor = ArgumentCaptor.forClass(List.class);
-        verify(mMockIke3gppCallback).onIke3gppPayloadsReceived(ike3gppInfoCaptor.capture());
+        ArgumentCaptor<List<Ike3gppData>> ike3gppDataCaptor = ArgumentCaptor.forClass(List.class);
+        verify(mMockIke3gppDataListener).onIke3gppDataReceived(ike3gppDataCaptor.capture());
 
         Ike3gppN1ModeInformation n1ModeInformation = null;
-        for (Ike3gppInfo payload : ike3gppInfoCaptor.getValue()) {
-            if (payload.getInfoType() == Ike3gppInfo.INFO_TYPE_NOTIFY_N1_MODE_INFORMATION) {
+        for (Ike3gppData payload : ike3gppDataCaptor.getValue()) {
+            if (payload.getDataType() == Ike3gppData.DATA_TYPE_NOTIFY_N1_MODE_INFORMATION) {
                 n1ModeInformation = (Ike3gppN1ModeInformation) payload;
             }
         }
@@ -5315,12 +5298,12 @@
     }
 
     private void verifyBackoffTimer(int expectedNotifyErrorCause) {
-        ArgumentCaptor<List<Ike3gppInfo>> ike3gppInfoCaptor = ArgumentCaptor.forClass(List.class);
-        verify(mMockIke3gppCallback).onIke3gppPayloadsReceived(ike3gppInfoCaptor.capture());
+        ArgumentCaptor<List<Ike3gppData>> ike3gppDataCaptor = ArgumentCaptor.forClass(List.class);
+        verify(mMockIke3gppDataListener).onIke3gppDataReceived(ike3gppDataCaptor.capture());
 
         Ike3gppBackoffTimer backoffTimer = null;
-        for (Ike3gppInfo payload : ike3gppInfoCaptor.getValue()) {
-            if (payload.getInfoType() == Ike3gppInfo.INFO_TYPE_NOTIFY_BACKOFF_TIMER) {
+        for (Ike3gppData payload : ike3gppDataCaptor.getValue()) {
+            if (payload.getDataType() == Ike3gppData.DATA_TYPE_NOTIFY_BACKOFF_TIMER) {
                 backoffTimer = (Ike3gppBackoffTimer) payload;
             }
         }
@@ -5334,10 +5317,10 @@
     public void testIkeAuthWithBackoffTimerWithoutError() throws Exception {
         verifyIkeAuthWith3gppEnabled(
                 new IkeNotifyPayload(NOTIFY_TYPE_BACKOFF_TIMER, BACKOFF_TIMER_DATA),
-                0 /* ike3gppCallbackInvocations */);
+                0 /* ike3gppDataListenerInvocations */);
 
         // BackoffTimer should be ignored
-        verify(mMockIke3gppCallback, never()).onIke3gppPayloadsReceived(any());
+        verify(mMockIke3gppDataListener, never()).onIke3gppDataReceived(any());
     }
 
     @Test(expected = IllegalArgumentException.class)
@@ -5519,7 +5502,7 @@
                         true /* hasConfigPayloadInResp */,
                         doesPeerSupportMobike,
                         isIpv4,
-                        0 /* ike3gppCallbackInvocations */);
+                        0 /* ike3gppDataListenerInvocations */);
         verifyRetransmissionStopped();
 
         boolean isMobikeSupportIndicated = false;
diff --git a/tests/iketests/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExtensionExchangeTest.java b/tests/iketests/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExtensionExchangeTest.java
index 08200b2..0d46bc1 100644
--- a/tests/iketests/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExtensionExchangeTest.java
+++ b/tests/iketests/src/java/com/android/internal/net/ipsec/ike/ike3gpp/Ike3gppExtensionExchangeTest.java
@@ -28,7 +28,7 @@
 import static org.mockito.Mockito.mock;
 
 import android.net.ipsec.ike.ike3gpp.Ike3gppExtension;
-import android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppCallback;
+import android.net.ipsec.ike.ike3gpp.Ike3gppExtension.Ike3gppDataListener;
 import android.net.ipsec.ike.ike3gpp.Ike3gppParams;
 
 import com.android.internal.net.ipsec.ike.message.IkeNotifyPayload;
@@ -59,19 +59,19 @@
 
     private static final Executor INLINE_EXECUTOR = Runnable::run;
 
-    private Ike3gppCallback mMockIke3gppCallback;
+    private Ike3gppDataListener mMockIke3gppDataListener;
 
     private Ike3gppParams mIke3gppParams;
     private Ike3gppExtensionExchange mIke3gppExtensionExchange;
 
     @Before
     public void setUp() {
-        mMockIke3gppCallback = mock(Ike3gppCallback.class);
+        mMockIke3gppDataListener = mock(Ike3gppDataListener.class);
 
         mIke3gppParams = new Ike3gppParams.Builder().setPduSessionId(PDU_SESSION_ID).build();
         mIke3gppExtensionExchange =
                 new Ike3gppExtensionExchange(
-                        new Ike3gppExtension(mIke3gppParams, mMockIke3gppCallback),
+                        new Ike3gppExtension(mIke3gppParams, mMockIke3gppDataListener),
                         INLINE_EXECUTOR);
     }