mirror of
https://gitee.com/openharmony/telephony_ril_adapter
synced 2024-11-23 15:50:13 +00:00
modify sim slot.
Signed-off-by: clevercong <lichunlin2@huawei.com>
This commit is contained in:
parent
4d7a835e84
commit
a6857b7d93
@ -405,6 +405,8 @@ static constexpr uint32_t HRIL_NETWORKS_SELECT_MODE = 0;
|
||||
inline const int32_t HRIL_SYSPARA_SIZE = 128;
|
||||
inline constexpr const char *HRIL_DEFAULT_SLOT_COUNT = "1";
|
||||
inline constexpr const char *HRIL_TEL_SIM_SLOT_COUNT = "const.telephony.slotCount";
|
||||
inline constexpr const char *HRIL_DEFAULT_VSIM_MODEM_COUNT = "0";
|
||||
inline constexpr const char *HRIL_VSIM_MODEM_COUNT_STR = "const.telephony.vsimModemCount";
|
||||
|
||||
/** Interface token */
|
||||
inline const std::u16string HRIL_INTERFACE_TOKEN = u"ohos.telephony.hril";
|
||||
|
@ -12,6 +12,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("../../../core_service/telephony_core_service.gni")
|
||||
|
||||
RIL_ADAPTER = "../../"
|
||||
RIL_HRIL = "../../services/hril/src"
|
||||
@ -45,6 +46,8 @@ ohos_shared_library("hril") {
|
||||
"LOG_DOMAIN = 0xD001F08",
|
||||
]
|
||||
|
||||
defines += telephony_extra_defines
|
||||
|
||||
deps = [ "$RIL_ADAPTER/interfaces/innerkits:hril_innerkits" ]
|
||||
|
||||
external_deps = [
|
||||
|
@ -33,6 +33,9 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
inline const int32_t DUAL_SLOT_COUNT = 2;
|
||||
inline const int32_t MAX_SLOT_COUNT = 3;
|
||||
|
||||
typedef enum : int32_t {
|
||||
RIL_REGISTER_IS_NONE = 0,
|
||||
RIL_REGISTER_IS_RUNNING,
|
||||
|
@ -1025,7 +1025,16 @@ int32_t GetSimSlotCount()
|
||||
{
|
||||
char simSlotCount[HRIL_SYSPARA_SIZE] = { 0 };
|
||||
GetParameter(HRIL_TEL_SIM_SLOT_COUNT, HRIL_DEFAULT_SLOT_COUNT, simSlotCount, HRIL_SYSPARA_SIZE);
|
||||
return std::atoi(simSlotCount);
|
||||
int32_t simSlotCountNumber = std::atoi(simSlotCount);
|
||||
#ifdef OHOS_BUILD_ENABLE_TELEPHONY_VSIM
|
||||
char vSimModemCount[HRIL_SYSPARA_SIZE] = { 0 };
|
||||
GetParameter(HRIL_VSIM_MODEM_COUNT_STR, HRIL_DEFAULT_VSIM_MODEM_COUNT, vSimModemCount, HRIL_SYSPARA_SIZE);
|
||||
int32_t vSimModemCountNumber = std::atoi(vSimModemCount);
|
||||
if (simSlotCountNumber == DUAL_SLOT_COUNT && vSimModemCountNumber == MAX_SLOT_COUNT) {
|
||||
simSlotCountNumber = MAX_SLOT_COUNT;
|
||||
}
|
||||
#endif
|
||||
return simSlotCountNumber;
|
||||
}
|
||||
|
||||
static void HRilBootUpEventLoop()
|
||||
|
Loading…
Reference in New Issue
Block a user