From aa48e638815e21ef3de2590cd32024cd2da9bac7 Mon Sep 17 00:00:00 2001 From: arunvoddu Date: Wed, 6 Dec 2023 17:52:42 +0000 Subject: [PATCH] Enhanced AIDLs to fetch the Carrier lock information. Bug: 314835886 Test: Built Successfully Change-Id: I746d202d46bef6366525448706316b61ea6907b1 --- .../hardware/radio/sim/CarrierInfo.aidl | 47 +++++++++++++ .../radio/sim/CarrierRestrictions.aidl | 8 +++ .../android/hardware/radio/sim/Plmn.aidl | 40 +++++++++++ .../radio/sim/SimLockMultiSimPolicy.aidl | 7 ++ .../hardware/radio/sim/CarrierInfo.aidl | 70 +++++++++++++++++++ .../radio/sim/CarrierRestrictions.aidl | 15 +++- .../aidl/android/hardware/radio/sim/Plmn.aidl | 31 ++++++++ .../radio/sim/SimLockMultiSimPolicy.aidl | 42 +++++++++++ 8 files changed, 259 insertions(+), 1 deletion(-) create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl create mode 100644 radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl create mode 100644 radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl create mode 100644 radio/aidl/android/hardware/radio/sim/Plmn.aidl 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 0000000000..5838959fb5 --- /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 -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 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 84cdf5d1a7..a5b8dc96f6 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 @@ package android.hardware.radio.sim; /* @hide */ @JavaDerive(toString=true) @VintfStability parcelable CarrierRestrictions { + /** + * @deprecated use @List allowedCarrierInfoList + */ android.hardware.radio.sim.Carrier[] allowedCarriers; + /** + * @deprecated use @List 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 0000000000..b29a4a76bd --- /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 -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 5a5e8ac11d..8cfe417c26 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 @@ package android.hardware.radio.sim; 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 0000000000..a8904978ac --- /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 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 d5e0c43f82..0002d5a9f4 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 @@ parcelable CarrierRestrictions { } /** * Allowed carriers + * @deprecated use @List 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 excludedCarrierInfoList */ Carrier[] excludedCarriers; /** @@ -59,4 +62,14 @@ parcelable CarrierRestrictions { 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 0000000000..fd82692d45 --- /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 18f97f798f..89d85a9a76 100644 --- a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl +++ b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl @@ -21,14 +21,56 @@ package android.hardware.radio.sim; @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 }