Enhanced AIDLs to fetch the Carrier lock information.

Bug: 314835886
Test: Built Successfully
Change-Id: I746d202d46bef6366525448706316b61ea6907b1
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl
new file mode 100644
index 0000000..5838959
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.radio.sim;
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
+parcelable CarrierInfo {
+  String mcc;
+  String mnc;
+  @nullable String spn;
+  @nullable String gid1;
+  @nullable String gid2;
+  @nullable String imsiPrefix;
+  @nullable List<android.hardware.radio.sim.Plmn> ephlmn;
+  @nullable String iccid;
+  @nullable String impi;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
index 84cdf5d..a5b8dc9 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
@@ -35,10 +35,18 @@
 /* @hide */
 @JavaDerive(toString=true) @VintfStability
 parcelable CarrierRestrictions {
+  /**
+   * @deprecated use @List<CarrierInfo> allowedCarrierInfoList
+   */
   android.hardware.radio.sim.Carrier[] allowedCarriers;
+  /**
+   * @deprecated use @List<CarrierInfo> excludedCarrierInfoList
+   */
   android.hardware.radio.sim.Carrier[] excludedCarriers;
   boolean allowedCarriersPrioritized;
   android.hardware.radio.sim.CarrierRestrictions.CarrierRestrictionStatus status;
+  android.hardware.radio.sim.CarrierInfo[] allowedCarrierInfoList = {};
+  android.hardware.radio.sim.CarrierInfo[] excludedCarrierInfoList = {};
   @Backing(type="int") @VintfStability
   enum CarrierRestrictionStatus {
     UNKNOWN = 0,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl
new file mode 100644
index 0000000..b29a4a7
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.radio.sim;
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
+parcelable Plmn {
+  String mcc;
+  String mnc;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
index 5a5e8ac..8cfe417 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
@@ -37,4 +37,11 @@
 enum SimLockMultiSimPolicy {
   NO_MULTISIM_POLICY,
   ONE_VALID_SIM_MUST_BE_PRESENT,
+  APPLY_TO_ALL_SLOTS,
+  APPLY_TO_ONLY_SLOT_1,
+  VALID_SIM_MUST_PRESENT_ON_SLOT_1,
+  ACTIVE_SERVICE_ON_SLOT_1_TO_UNBLOCK_OTHER_SLOTS,
+  ACTIVE_SERVICE_ON_ANY_SLOT_TO_UNBLOCK_OTHER_SLOTS,
+  ALL_SIMS_MUST_BE_VALID,
+  SLOT_POLICY_OTHER,
 }
diff --git a/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl b/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl
new file mode 100644
index 0000000..a890497
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2023 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.hardware.radio.sim;
+
+import android.hardware.radio.sim.Plmn;
+
+/** @hide */
+@VintfStability
+@JavaDerive(toString=true)
+parcelable CarrierInfo {
+    /**
+     * MCC (Mobile Country Code) of Carrier. Wild char is either '*' or '?'.
+     */
+    String mcc;
+
+    /**
+     * MNC (Mobile Network Code) of the Carrier. Wild char is either '*' or '?'.
+     */
+    String mnc;
+    /**
+     * Service Provider Name(SPN) of the SIM card of the Carrier.
+     */
+    @nullable
+    String spn;
+    /**
+     * GID1 value of the SIM card of the Carrier.
+     */
+    @nullable
+    String gid1;
+    /**
+     * GID2 value of the SIM card of the Carrier.
+     */
+    @nullable
+    String gid2;
+
+    /**
+     * IMSI (International Mobile Subscriber Identity) prefix. Wild char is '*'.
+     */
+    @nullable
+    String imsiPrefix;
+    /**
+     * Equivalent HPLMN of the SIM card of the Carrier.
+     */
+    @nullable
+    List<Plmn> ephlmn;
+    /**
+     * ICCID (Integrated Circuit Card Identification) of the SIM card.
+     */
+    @nullable
+    String iccid;
+    /**
+     * IMPI (IMS Private Identity) of the SIM card of the Carrier.
+     */
+    @nullable
+    String impi;
+}
\ No newline at end of file
diff --git a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
index d5e0c43..0002d5a 100644
--- a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
@@ -17,6 +17,7 @@
 package android.hardware.radio.sim;
 
 import android.hardware.radio.sim.Carrier;
+import android.hardware.radio.sim.CarrierInfo;
 
 /** @hide */
 @VintfStability
@@ -40,12 +41,14 @@
     }
     /**
      * Allowed carriers
+     * @deprecated use @List<CarrierInfo> allowedCarrierInfoList
      */
     Carrier[] allowedCarriers;
     /**
      * Explicitly excluded carriers which match allowed_carriers. Eg. allowedCarriers match mcc/mnc,
      * excludedCarriers has same mcc/mnc and gid1 is ABCD. It means except the carrier whose gid1
      * is ABCD, all carriers with the same mcc/mnc are allowed.
+     * @deprecated use @List<CarrierInfo> excludedCarrierInfoList
      */
     Carrier[] excludedCarriers;
     /**
@@ -59,4 +62,14 @@
     boolean allowedCarriersPrioritized;
     /** Current restriction status as defined in CarrierRestrictionStatus enum */
     CarrierRestrictionStatus status;
-}
+
+    /**  Allowed carriers. */
+    CarrierInfo[] allowedCarrierInfoList = {};
+
+    /**
+     * Explicitly excluded carriers which match allowed_carriers. Eg. allowedCarriers match mcc/mnc,
+     * excludedCarriers has same mcc/mnc and gid1 is ABCD. It means except the carrier whose gid1
+     * is ABCD, all carriers with the same mcc/mnc are allowed.
+     */
+    CarrierInfo[]  excludedCarrierInfoList = {};
+}
\ No newline at end of file
diff --git a/radio/aidl/android/hardware/radio/sim/Plmn.aidl b/radio/aidl/android/hardware/radio/sim/Plmn.aidl
new file mode 100644
index 0000000..fd82692
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/sim/Plmn.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2023 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.hardware.radio.sim;
+
+/** @hide */
+@VintfStability
+@JavaDerive(toString=true)
+parcelable Plmn {
+    /**
+     * MCC (Mobile Country Code) of the PLMN
+     */
+    String mcc;
+    /**
+     * MNC (Mobile Network Code) of the PLMN
+     */
+    String mnc;
+}
\ No newline at end of file
diff --git a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
index 18f97f7..89d85a9 100644
--- a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
+++ b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
@@ -21,14 +21,56 @@
 @Backing(type="int")
 @JavaDerive(toString=true)
 enum SimLockMultiSimPolicy {
+
     /**
      * Indicates that configuration applies to each slot independently.
      */
     NO_MULTISIM_POLICY,
+
     /**
      * Indicates that any SIM card can be used as far as one valid card is present in the device.
      * For the modem, a SIM card is valid when its content (i.e. MCC, MNC, GID, SPN) matches the
      * carrier restriction configuration.
      */
     ONE_VALID_SIM_MUST_BE_PRESENT,
+
+    /**
+     * Indicates that the SIM lock policy applies uniformly to all sim slots.
+     */
+    APPLY_TO_ALL_SLOTS,
+
+    /**
+     * The SIM lock configuration applies exclusively to sim slot 1, leaving
+     * all other sim slots unlocked irrespective of the SIM card in slot 1
+     */
+    APPLY_TO_ONLY_SLOT_1,
+
+    /**
+     * Valid sim cards must be present on sim slot1 in order
+     * to use other sim slots.
+     */
+    VALID_SIM_MUST_PRESENT_ON_SLOT_1,
+
+    /**
+     * Valid sim card must be present on slot1 and it must be in full service
+     * in order to use other sim slots.
+     */
+    ACTIVE_SERVICE_ON_SLOT_1_TO_UNBLOCK_OTHER_SLOTS,
+
+    /**
+     * Valid sim card be present on any slot and it must be in full service
+     * in order to use other sim slots.
+     */
+    ACTIVE_SERVICE_ON_ANY_SLOT_TO_UNBLOCK_OTHER_SLOTS,
+
+    /**
+     * Valid sim cards must be present on all slots. If any SIM cards become
+     * invalid then device would set other SIM cards as invalid as well.
+     */
+    ALL_SIMS_MUST_BE_VALID,
+
+    /**
+     * In case there is no match policy listed above.
+     */
+    SLOT_POLICY_OTHER
 }