Update IRadioNetwork for AOSP IMS

Bug: 216387835
Test: build & flash
Change-Id: Ia5209365daaab1bf68b1c1db5381553d266eaa12
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
index 1557cbe..08d44f4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
@@ -37,6 +37,9 @@
   boolean noinit;
   android.hardware.radio.network.Cdma2000RegistrationInfo cdmaInfo;
   android.hardware.radio.network.EutranRegistrationInfo eutranInfo;
+  /**
+   * @deprecated use NrRegistrationInfo instead.
+   */
   android.hardware.radio.network.NrVopsInfo ngranNrVopsInfo;
   boolean geranDtmSupported;
   @nullable android.hardware.radio.network.NrRegistrationInfo ngranInfo;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl
index d06a5ca..9c8f692 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl
@@ -36,10 +36,14 @@
 parcelable EutranRegistrationInfo {
   android.hardware.radio.network.LteVopsInfo lteVopsInfo;
   android.hardware.radio.network.NrIndicators nrIndicators;
-  byte lteAttachType;
-  boolean isEmergencyAttached;
-  const byte EPS_ONLY = 1;
-  const byte COMBINED_EPS_AND_IMSI = 2;
-  const byte COMBINED_CSFB_NOT_PREFERRED = 3;
-  const byte COMBINED_SMS_ONLY = 4;
+  android.hardware.radio.network.EutranRegistrationInfo.AttachType lteAttachType;
+  int extraInfo;
+  const int EXTRA_CSFB_NOT_PREFERRED = 1;
+  const int EXTRA_SMS_ONLY = 2;
+  enum AttachType {
+    NONE = 0,
+    EPS_ONLY = 1,
+    COMBINED = 2,
+    EMERGENCY = 3,
+  }
 }
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrRegistrationInfo.aidl
index 04d900d..930ff54 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrRegistrationInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrRegistrationInfo.aidl
@@ -35,10 +35,7 @@
 @VintfStability
 parcelable NrRegistrationInfo {
   android.hardware.radio.network.NrVopsInfo ngranNrVopsInfo;
-  byte resultValue;
-  boolean isSmsOverNasAllowed;
-  boolean isEmergencyRegistered;
-  const byte REGISTERED_OVER_3GPP = 1;
-  const byte REGISTERED_OVER_NON_3GPP = 2;
-  const byte REGISTERED_OVER_3GPP_AND_NON_3GPP = 3;
+  int extraInfo;
+  const int EXTRA_SMS_OVER_NAS_ALLOWED = 1;
+  const int EXTRA_REGISTERED_FOR_EMERGENCY = 2;
 }
diff --git a/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl b/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
index 5ca5280..b613cde 100644
--- a/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
@@ -31,6 +31,7 @@
      * Network capabilities for voice over PS services. This info is valid only on NR network and
      * must be present when the device is camped on NR. NrVopsInfo must be empty when the device is
      * not camped on NR.
+     * @deprecated use NrRegistrationInfo instead.
      */
     NrVopsInfo ngranNrVopsInfo;
     /**
@@ -38,5 +39,10 @@
      */
     boolean geranDtmSupported;
 
+    /**
+     * Network registration information and network capabilities for voice over PS services.
+     * This info is valid only on NR network and must be present when the device is camped on NR.
+     * NrRegistrationInfo must be empty when the device is not camped on NR.
+     */
     @nullable NrRegistrationInfo ngranInfo;
 }
diff --git a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl
index a3371c2..3b40050 100644
--- a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl
@@ -22,14 +22,22 @@
 @VintfStability
 @JavaDerive(toString=true)
 parcelable EutranRegistrationInfo {
-    /** LTE is attached with eps only. */
-    const byte EPS_ONLY = 1;
-    /** LTE combined EPS and IMSI attach. */
-    const byte COMBINED_EPS_AND_IMSI = 2;
+    enum AttachType {
+        /** Default value. */
+        NONE,
+        /** LTE is attached with eps only. */
+        EPS_ONLY,
+        /** LTE combined EPS and IMSI attach. */
+        COMBINED,
+        /** LTE is attached for emergency bearer service. */
+        EMERGENCY,
+    }
+
     /** LTE combined attach with CSFB not preferred */
-    const byte COMBINED_CSFB_NOT_PREFERRED = 3;
+    const int EXTRA_CSFB_NOT_PREFERRED = 1 << 0;
+
     /** LTE combined attach for SMS only */
-    const byte COMBINED_SMS_ONLY = 4;
+    const int EXTRA_SMS_ONLY = 1 << 1;
 
     /**
      * Network capabilities for voice over PS services. This info is valid only on LTE network and
@@ -47,8 +55,8 @@
      * The type of network attachment. This info is valid only on LTE network and must be present
      * when device has attached to the network.
      */
-    byte lteAttachType;
+    AttachType lteAttachType;
 
-    /** True if emergency attached */
-    boolean isEmergencyAttached;
+    /** Values are bitwise ORs of EXTRA_* constants */
+    int extraInfo;
 }
diff --git a/radio/aidl/android/hardware/radio/network/NrRegistrationInfo.aidl b/radio/aidl/android/hardware/radio/network/NrRegistrationInfo.aidl
index eb1e9dd..7e6bed5 100644
--- a/radio/aidl/android/hardware/radio/network/NrRegistrationInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/NrRegistrationInfo.aidl
@@ -16,14 +16,16 @@
 
 package android.hardware.radio.network;
 
+import android.hardware.radio.network.EutranRegistrationInfo;
 import android.hardware.radio.network.NrVopsInfo;
 
 @VintfStability
 parcelable NrRegistrationInfo {
-    /** 5GS registration result value - TS 24.501 9.11.3.6 */
-    const byte REGISTERED_OVER_3GPP = 1;
-    const byte REGISTERED_OVER_NON_3GPP = 2;
-    const byte REGISTERED_OVER_3GPP_AND_NON_3GPP = 3;
+    /** SMS over NAS is allowed - TS 24.501 9.11.3.6. */
+    const int EXTRA_SMS_OVER_NAS_ALLOWED = 1 << 0;
+
+    /** Registered for emergency services - TS 24.501 9.11.3.6. */
+    const int EXTRA_REGISTERED_FOR_EMERGENCY = 1 << 1;
 
     /**
      * Network capabilities for voice over PS services. This info is valid only on NR network and
@@ -31,10 +33,7 @@
      * not camped on NR.
      */
     NrVopsInfo ngranNrVopsInfo;
-    /** 5GS registration result value - TS 24.501 9.11.3.6 */
-    byte resultValue;
-    /** 5GS registration result SMS over NAS - TS 24.501 9.11.3.6 */
-    boolean isSmsOverNasAllowed;
-    /** True if emergency registered */
-    boolean isEmergencyRegistered;
+
+    /** Values are bitwise ORs of EXTRA_ */
+    int extraInfo;
 }
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index e1d508d..d55763a 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -1404,7 +1404,8 @@
     if (rat == RadioTechnology::LTE || rat == RadioTechnology::LTE_CA) {
         ASSERT_EQ(info.getTag(), AccessTechnologySpecificInfo::eutranInfo);
     } else if (rat == RadioTechnology::NR) {
-        ASSERT_EQ(info.getTag(), AccessTechnologySpecificInfo::ngranNrVopsInfo);
+        ASSERT_TRUE(info.getTag() == AccessTechnologySpecificInfo::ngranNrVopsInfo
+            || info.getTag() == AccessTechnologySpecificInfo::ngranInfo);
     }
 }