From aca341e0ade2db03d010a1a3943740b950b1b900 Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Tue, 20 Sep 2022 10:30:55 +0800 Subject: [PATCH 1/2] fixed 78beebd from https://gitee.com/dingxiaochen/interface_sdk-js/pulls/2765 fix js api. Signed-off-by: dingxiaochen --- api/@ohos.contact.d.ts | 2 +- api/@ohos.telephony.radio.d.ts | 76 ++++++++++++++++++++++++++++++++++ api/@ohos.telephony.sim.d.ts | 4 +- 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/api/@ohos.contact.d.ts b/api/@ohos.contact.d.ts index b286bac943..3570dc1a02 100644 --- a/api/@ohos.contact.d.ts +++ b/api/@ohos.contact.d.ts @@ -39,7 +39,7 @@ declare namespace contact { * * @return Returns the contact list which user select; * returns empty contact list if user not select. - * @syscap SystemCapability.Applications.ContactsData, SystemCapability.Applications.Contacts + * @syscap SystemCapability.Applications.ContactsData * @permission ohos.permission.READ_CONTACTS */ function selectContact(callback: AsyncCallback>): void; diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index 0975e3245b..618492de5f 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -285,6 +285,42 @@ declare namespace radio { function getPreferredNetwork(slotId: number, callback: AsyncCallback): void; function getPreferredNetwork(slotId: number): Promise; + /** + * Get the IMS registration state info of specificed IMS service type. + * + * @param slotId Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param imsType Indicates the ims service type of the {@link ImsServiceType}. + * @param callback including an instance of the {@link ImsRegInfo} class. + * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback): void; + function getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise; + + /** + * Called when the IMS registration state of specificed IMS service type corresponding + * to a monitored {@code slotId} updates. + * + * @param slotId Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param imsType Indicates the ims service type of the {@link ImsServiceType}. + * @param callback including an instance of the {@link ImsRegInfo} class. + * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. + * @since 9 + */ + function on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: Callback): void; + + + /** + * @permission ohos.permission.GET_TELEPHONY_STATE + * @systemapi Hide this for inner system use. + * @since 9 + */ + function off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback?: Callback): void; + /** * @systemapi Hide this for inner system use. * @since 8 @@ -778,6 +814,46 @@ declare namespace radio { /** Manual network selection modes. */ NETWORK_SELECTION_MANUAL } + + /** + * @systemapi Hide this for inner system use. + * @since 9 + */ + export enum ImsRegState { + IMS_UNREGISTERED, + IMS_REGISTERED, + } + + /** + * @systemapi Hide this for inner system use. + * @since 9 + */ + export enum ImsRegTech { + REGISTRATION_TECH_NONE, + REGISTRATION_TECH_LTE, + REGISTRATION_TECH_IWLAN, + REGISTRATION_TECH_NR, + } + + /** + * @systemapi Hide this for inner system use. + * @since 9 + */ + export interface ImsRegInfo { + imsRegState: ImsRegState; + imsRegTech: ImsRegTech; + } + + /** + * @systemapi Hide this for inner system use. + * @since 9 + */ + export enum ImsServiceType { + TYPE_VOICE, + TYPE_VIDEO, + TYPE_UT, + TYPE_SMS, + } } export default radio; \ No newline at end of file diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 475772a1af..7e3d87ff68 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -434,7 +434,7 @@ declare namespace sim { * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @return Returns the opkey; returns "-1" if no SIM card is inserted or + * @return Returns the opkey; returns an empty string if no SIM card is inserted or * no opkey matched. * @since 9 */ @@ -446,7 +446,7 @@ declare namespace sim { * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @return Returns the opname; returns null if no SIM card is inserted or + * @return Returns the opname; returns an empty string if no SIM card is inserted or * no opname matched. * @since 9 */ -- Gitee From 4ded98bf9a026870b5545a3c8d683b982902a2a6 Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Tue, 20 Sep 2022 07:39:28 +0000 Subject: [PATCH 2/2] update api/@ohos.contact.d.ts. Signed-off-by: dingxiaochen --- api/@ohos.contact.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.contact.d.ts b/api/@ohos.contact.d.ts index 3570dc1a02..b286bac943 100644 --- a/api/@ohos.contact.d.ts +++ b/api/@ohos.contact.d.ts @@ -39,7 +39,7 @@ declare namespace contact { * * @return Returns the contact list which user select; * returns empty contact list if user not select. - * @syscap SystemCapability.Applications.ContactsData + * @syscap SystemCapability.Applications.ContactsData, SystemCapability.Applications.Contacts * @permission ohos.permission.READ_CONTACTS */ function selectContact(callback: AsyncCallback>): void; -- Gitee