mirror of
https://gitee.com/openharmony/telephony_core_service
synced 2024-11-27 02:00:45 +00:00
更换GET_PHONE_NUMBERS
Signed-off-by: liuxiyao223 <liuxiyao223@huawei.com>
This commit is contained in:
parent
3aa1a82d8a
commit
89de785688
@ -83,7 +83,7 @@ The telephony core service module needs to provide APIs for related modules, inc
|
||||
| function getDefaultVoiceSimId(callback: AsyncCallback\<number>): void; | Obtains the sim id of the default SIM card that provides the voice service. | – |
|
||||
| function isSimActive(slotId: number, callback: AsyncCallback\<boolean>): void | Checks whether the SIM card in the specified slot is activated. | – |
|
||||
| function hasSimCard(slotId: number, callback: AsyncCallback\<boolean>): void | Checks whether the specified slot is populated with a SIM card. | – |
|
||||
| function getSimTelephoneNumber(slotId: number, callback: AsyncCallback\<string>): void | Obtains the mobile station integrated services digital network (MSISDN) of the SIM card in the specified slot.|ohos.permission.GET_TELEPHONY_STATE |
|
||||
| function getSimTelephoneNumber(slotId: number, callback: AsyncCallback\<string>): void | Obtains the mobile station integrated services digital network (MSISDN) of the SIM card in the specified slot.|ohos.permission.GET_PHONE_NUMBERS |
|
||||
| function getVoiceMailIdentifier(slotId: number, callback: AsyncCallback\<string>): void | Obtains the voice mailbox identifier of the SIM card in the specified slot.| ohos.permission.GET_TELEPHONY_STATE |
|
||||
| function getVoiceMailNumber(slotId: number, callback: AsyncCallback\<string>): void | Obtains the voice mailbox number of the SIM card in the specified slot.| ohos.permission.GET_TELEPHONY_STATE |
|
||||
| function getCardType(slotId: number, callback: AsyncCallback\<CardType>): void | Obtains the type of the SIM card in the specified slot. | –|
|
||||
|
@ -82,7 +82,7 @@
|
||||
| function getDefaultVoiceSimId(callback: AsyncCallback\<number>): void; | 获取语音业务的默认卡ID | 无 |
|
||||
| function isSimActive(slotId: number, callback: AsyncCallback\<boolean>): void | 检查指定卡槽的SIM卡是否激活 | 无 |
|
||||
| function hasSimCard(slotId: number, callback: AsyncCallback\<boolean>): void | 检查SIM卡是否插入指定卡槽 | 无 |
|
||||
| function getSimTelephoneNumber(slotId: number, callback: AsyncCallback\<string>): void | 获取指定卡槽SIM卡的MSISDN(Mobile Station Integrated Services Digital Network)|ohos.permission.GET_TELEPHONY_STATE |
|
||||
| function getSimTelephoneNumber(slotId: number, callback: AsyncCallback\<string>): void | 获取指定卡槽SIM卡的MSISDN(Mobile Station Integrated Services Digital Network)|ohos.permission.GET_PHONE_NUMBERS |
|
||||
| function getVoiceMailIdentifier(slotId: number, callback: AsyncCallback\<string>): void | 获取指定卡槽SIM卡语音信箱的身份标识 | ohos.permission.GET_TELEPHONY_STATE |
|
||||
| function getVoiceMailNumber(slotId: number, callback: AsyncCallback\<string>): void | 获取指定卡槽SIM卡的语音邮箱号码 | ohos.permission.GET_TELEPHONY_STATE |
|
||||
| function getCardType(slotId: number, callback: AsyncCallback\<CardType>): void | 获取指定卡槽SIM卡的类型 | 无 |
|
||||
|
4
interfaces/kits/js/@ohos.telephony.sim.d.ts
vendored
4
interfaces/kits/js/@ohos.telephony.sim.d.ts
vendored
@ -543,7 +543,7 @@ declare namespace sim {
|
||||
* Obtains the MSISDN of the SIM card in a specified slot.
|
||||
* The MSISDN is recorded in the EFMSISDN file of the SIM card.
|
||||
*
|
||||
* @permission ohos.permission.GET_TELEPHONY_STATE
|
||||
* @permission ohos.permission.GET_PHONE_NUMBERS
|
||||
* @param { number } slotId - Indicates the card slot index number,
|
||||
* ranging from 0 to the maximum card slot index number supported by the device.
|
||||
* @param { AsyncCallback<string> } callback - Indicates the callback for getting the MSISDN;
|
||||
@ -567,7 +567,7 @@ declare namespace sim {
|
||||
* Obtains the MSISDN of the SIM card in a specified slot.
|
||||
* The MSISDN is recorded in the EFMSISDN file of the SIM card.
|
||||
*
|
||||
* @permission ohos.permission.GET_TELEPHONY_STATE
|
||||
* @permission ohos.permission.GET_PHONE_NUMBERS
|
||||
* @param { number } slotId - Indicates the card slot index number,
|
||||
* ranging from 0 to the maximum card slot index number supported by the device.
|
||||
* @returns { Promise<string> } Returns the MSISDN; returns an empty string if no SIM card is inserted or
|
||||
|
@ -1004,7 +1004,8 @@ int32_t CoreService::GetSimTelephoneNumber(int32_t slotId, std::u16string &telep
|
||||
TELEPHONY_LOGE("Non-system applications use system APIs!");
|
||||
return TELEPHONY_ERR_ILLEGAL_USE_OF_SYSTEM_API;
|
||||
}
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
if ((!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) &&
|
||||
(!TelephonyPermission::CheckPermission(Permission::GET_PHONE_NUMBERS))) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return TELEPHONY_ERR_PERMISSION_ERR;
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
"ohos.permission.COMMONEVENT_STICKY",
|
||||
"ohos.permission.CONNECTIVITY_INTERNAL",
|
||||
"ohos.permission.GET_TELEPHONY_STATE",
|
||||
"ohos.permission.GET_PHONE_NUMBERS",
|
||||
"ohos.permission.PERMISSION_USED_STATS",
|
||||
"ohos.permission.RECEIVE_SMS",
|
||||
"ohos.permission.SET_TELEPHONY_STATE",
|
||||
|
@ -61,6 +61,10 @@ static constexpr const char *SET_TELEPHONY_STATE = "ohos.permission.SET_TELEPHON
|
||||
* This permission indicates being allowed to get state of telephony.
|
||||
*/
|
||||
static constexpr const char *GET_TELEPHONY_STATE = "ohos.permission.GET_TELEPHONY_STATE";
|
||||
/**
|
||||
* This permission indicates being allowed to get MSISDN of SIM card.
|
||||
*/
|
||||
static constexpr const char *GET_PHONE_NUMBERS = "ohos.permission.GET_PHONE_NUMBERS";
|
||||
/**
|
||||
* This permission indicates being allowed to set information about network.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user