From ce490e73c2d7c59a014e33c5841208a69949945a Mon Sep 17 00:00:00 2001 From: "wangmengyao (I)" Date: Mon, 25 May 2026 22:45:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A9=E5=B1=95slotId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmengyao (I) --- interfaces/innerkits/include/hril_types.h | 1 + services/hril/include/hril_manager.h | 1 + services/hril/src/hril_manager.cpp | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/interfaces/innerkits/include/hril_types.h b/interfaces/innerkits/include/hril_types.h index 7e5bb29..334373b 100644 --- a/interfaces/innerkits/include/hril_types.h +++ b/interfaces/innerkits/include/hril_types.h @@ -194,6 +194,7 @@ inline constexpr const char *HRIL_VIRTUAL_MODEM_SWITCH = "const.booster.virtual_ inline constexpr const char *HRIL_VIRTUAL_MODEM_DEFAULT_SWITCH = "false"; inline constexpr const char *HRIL_DEFAULT_VSIM_MODEM_COUNT = "0"; inline constexpr const char *HRIL_VSIM_MODEM_COUNT_STR = "const.telephony.vsimModemCount"; +inline constexpr const char *DISTRIBUTE_MODEM_MULTIDEVICE_ENABLE = "persist.distributedmodem.multidevice.enable"; /** Interface token */ inline const std::u16string HRIL_INTERFACE_TOKEN = u"ohos.telephony.hril"; diff --git a/services/hril/include/hril_manager.h b/services/hril/include/hril_manager.h index 0365f85..7cb1b9f 100644 --- a/services/hril/include/hril_manager.h +++ b/services/hril/include/hril_manager.h @@ -35,6 +35,7 @@ namespace OHOS { namespace Telephony { inline const int32_t DUAL_SLOT_COUNT = 2; inline const int32_t MAX_SLOT_COUNT = 3; +inline const int32_t DC_MD_MAX_SLOT_COUNT = 8; typedef enum : int32_t { RIL_REGISTER_IS_NONE = 0, diff --git a/services/hril/src/hril_manager.cpp b/services/hril/src/hril_manager.cpp index 244988c..12954b0 100644 --- a/services/hril/src/hril_manager.cpp +++ b/services/hril/src/hril_manager.cpp @@ -1137,6 +1137,13 @@ int32_t GetSimSlotCount() (vSimModemCountNumber == MAX_SLOT_COUNT || vSimModemCountNumber == DUAL_SLOT_COUNT)) { simSlotCountNumber = MAX_SLOT_COUNT; } + + char multiDeviceEnable[HRIL_SYSPARA_SIZE] = {0}; + GetParameter(DISTRIBUTE_MODEM_MULTIDEVICE_ENABLE, "false", multiDeviceEnable, HRIL_SYSPARA_SIZE); + if (strcmp(multiDeviceEnable, "true") == 0) { + simSlotCountNumber = DC_MD_MAX_SLOT_COUNT; + } + TELEPHONY_LOGI("GetSimSlotCount, %{public}d", simSlotCountNumber); return simSlotCountNumber; }