2 个文件变更+10-0
@@ -18,6 +18,7 @@
18#include "napi_util.h"18#include "napi_util.h"
19#include "telephony_types.h"19#include "telephony_types.h"
20#include "wrapper.rs.h"20#include "wrapper.rs.h"
21+#include "core_service_client.h"
21 22 
22namespace OHOS {23namespace OHOS {
23using namespace Telephony;24using namespace Telephony;
@@ -33,6 +34,10 @@ static bool IsCellularDataManagerInited()
33 34 
34static inline bool IsValidSlotId(int32_t slotId)35static inline bool IsValidSlotId(int32_t slotId)
35{36{
37+ if (SIM_SLOT_COUNT == CELLDATA_SLOT_ID_3) {
38+ return slotId != CELLDATA_SLOT_ID_3 ? ((slotId >= DEFAULT_SIM_SLOT_ID) && (slotId < SIM_SLOT_COUNT - 1)) :
39+ DelayedRefSingleton<CoreServiceClient>::GetInstance().IsMultiSimsCapabilitySupported(slotId);
40+ }
36 return ((slotId >= DEFAULT_SIM_SLOT_ID) && (slotId < SIM_SLOT_COUNT));41 return ((slotId >= DEFAULT_SIM_SLOT_ID) && (slotId < SIM_SLOT_COUNT));
37}42}
38 43 
@@ -21,6 +21,7 @@
21#include "napi_util.h"21#include "napi_util.h"
22#include "telephony_log_wrapper.h"22#include "telephony_log_wrapper.h"
23#include "show_system_apn_settings.h"23#include "show_system_apn_settings.h"
24+#include "core_service_client.h"
24 25 
25namespace OHOS {26namespace OHOS {
26namespace Telephony {27namespace Telephony {
@@ -44,6 +45,10 @@ static bool IsCellularDataManagerInited()
44 45 
45static inline bool IsValidSlotId(int32_t slotId)46static inline bool IsValidSlotId(int32_t slotId)
46{47{
48+ if (SIM_SLOT_COUNT == CELLDATA_SLOT_ID_3) {
49+ return slotId != CELLDATA_SLOT_ID_3 ? ((slotId >= DEFAULT_SIM_SLOT_ID) && (slotId < SIM_SLOT_COUNT - 1)) :
50+ DelayedRefSingleton<CoreServiceClient>::GetInstance().IsMultiSimsCapabilitySupported(slotId);
51+ }
47 return ((slotId >= DEFAULT_SIM_SLOT_ID) && (slotId < SIM_SLOT_COUNT));52 return ((slotId >= DEFAULT_SIM_SLOT_ID) && (slotId < SIM_SLOT_COUNT));
48}53}
49 54