From 6b5d44a39569b0189e47a2607a427212201cc6fa Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Mon, 5 Dec 2022 14:30:54 +0800 Subject: [PATCH 1/6] fix js docs. Signed-off-by: dingxiaochen --- api/@ohos.contact.d.ts | 28 +- api/@ohos.telephony.call.d.ts | 720 +++++++++++++++++++++++++++++- api/@ohos.telephony.data.d.ts | 6 +- api/@ohos.telephony.observer.d.ts | 8 +- api/@ohos.telephony.radio.d.ts | 49 +- api/@ohos.telephony.sim.d.ts | 123 ++++- api/@ohos.telephony.sms.d.ts | 8 +- 7 files changed, 870 insertions(+), 72 deletions(-) diff --git a/api/@ohos.contact.d.ts b/api/@ohos.contact.d.ts index c1cb9c658f..814054e2ec 100644 --- a/api/@ohos.contact.d.ts +++ b/api/@ohos.contact.d.ts @@ -27,7 +27,7 @@ declare namespace contact { * Creates a contact. * * @param contact Indicates the contact information. - * @return Returns the contact ID (which can be obtained by {@link Contact#getId()}) if the creation is successful; + * @returns Returns the contact ID (which can be obtained by {@link Contact#getId()}) if the creation is successful; * returns {@link Contact#INVALID_CONTACT_ID} if the creation fails. * @permission ohos.permission.WRITE_CONTACTS */ @@ -37,7 +37,7 @@ declare namespace contact { /** * Select contact. * - * @return Returns the contact list which user select; + * @returns Returns the contact list which user select; * returns empty contact list if user not select. * @syscap SystemCapability.Applications.Contacts * @permission ohos.permission.READ_CONTACTS @@ -49,7 +49,7 @@ declare namespace contact { * Deletes a specified contact. * * @param key Indicates the unique query key of a contact to delete. - * @return Returns {@code true} if the contact is deleted; returns {@code false} otherwise. + * @returns Returns {@code true} if the contact is deleted; returns {@code false} otherwise. * @permission ohos.permission.WRITE_CONTACTS */ function deleteContact(key: string, callback: AsyncCallback): void; @@ -61,7 +61,7 @@ declare namespace contact { * @param key Indicates the unique query key of a contact. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. - * @return Returns the specified contact. + * @returns Returns the specified contact. * @permission ohos.permission.READ_CONTACTS */ function queryContact(key: string, callback: AsyncCallback): void; @@ -75,7 +75,7 @@ declare namespace contact { * * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. - * @return Returns the {@code Contact} list object. + * @returns Returns the {@code Contact} list object. * @permission ohos.permission.READ_CONTACTS */ function queryContacts(callback: AsyncCallback>): void; @@ -90,7 +90,7 @@ declare namespace contact { * @param email Indicates the email address. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. - * @return Returns a {@code Contact} list object. + * @returns Returns a {@code Contact} list object. * @permission ohos.permission.READ_CONTACTS */ function queryContactsByEmail(email: string, callback: AsyncCallback>): void; @@ -106,7 +106,7 @@ declare namespace contact { * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. * @param attrs Indicates the contact attribute. If this parameter is null, * all attributes will be used for matching. - * @return Returns the {@code Contact} list object. + * @returns Returns the {@code Contact} list object. * @permission ohos.permission.READ_CONTACTS */ function queryContactsByPhoneNumber(phoneNumber: string, callback: AsyncCallback>): void; @@ -119,7 +119,7 @@ declare namespace contact { * Queries contact groups. * * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. - * @return Returns the contact group list. + * @returns Returns the contact group list. * @permission ohos.permission.READ_CONTACTS */ function queryGroups(callback: AsyncCallback>): void; @@ -129,7 +129,7 @@ declare namespace contact { /** * Queries contact holders. * - * @return Returns the {@code Holder} list object. + * @returns Returns the {@code Holder} list object. * @permission ohos.permission.READ_CONTACTS */ function queryHolders(callback: AsyncCallback>): void; @@ -140,7 +140,7 @@ declare namespace contact { * * @param id Indicates the contact ID. * @param holder Indicates the contact holder. If this parameter is null, the default holder is used for matching. - * @return Returns the query key of the contact. + * @returns Returns the query key of the contact. * @permission ohos.permission.READ_CONTACTS */ function queryKey(id: number, callback: AsyncCallback): void; @@ -151,7 +151,7 @@ declare namespace contact { * Queries information about "my card". * * @param attrs Indicates the contact attributes. If this parameter is null, all attributes are used for matching. - * @return Returns information about "my card". + * @returns Returns information about "my card". * @permission ohos.permission.READ_CONTACTS */ function queryMyCard(callback: AsyncCallback): void; @@ -164,7 +164,7 @@ declare namespace contact { * @param contact Indicates the contact whose information is to update. * @param attrs Indicates the contact attributes to update. If this parameter is null, * all available attributes will be updated. - * @return Returns {@code true} if the update is successful; returns {@code false} otherwise. + * @returns Returns {@code true} if the update is successful; returns {@code false} otherwise. * @permission ohos.permission.WRITE_CONTACTS */ function updateContact(contact: Contact, callback: AsyncCallback): void; @@ -175,7 +175,7 @@ declare namespace contact { * Checks whether the contact ID is in the local phone book. * * @param id Indicates the contact ID. - * @return Returns {@code true} if the contact ID is in the local phone book; returns {@code false} otherwise. + * @returns Returns {@code true} if the contact ID is in the local phone book; returns {@code false} otherwise. * @permission ohos.permission.READ_CONTACTS */ function isLocalContact(id: number, callback: AsyncCallback): void; @@ -185,7 +185,7 @@ declare namespace contact { * Checks whether the contact ID is of "my card". * * @param id Indicates the contact ID. - * @return Returns {@code true} if the contact ID is of "my card"; returns {@code false} otherwise. + * @returns Returns {@code true} if the contact ID is of "my card"; returns {@code false} otherwise. * @permission ohos.permission.READ_CONTACTS */ function isMyCard(id: number, callback: AsyncCallback): void; diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 4a5bb01d2f..727078e78b 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -87,7 +87,7 @@ declare namespace call { * subsystem domain (IMS) call on a telephone service network. If the device supports only packet switching * (even if the device supports OTT calls), {@code false} is returned. * - * @return Returns {@code true} if the device supports voice calls; returns {@code false} otherwise. + * @returns Returns {@code true} if the device supports voice calls; returns {@code false} otherwise. * @since 7 */ function hasVoiceCapability(): boolean; @@ -151,7 +151,7 @@ declare namespace call { function answer(callback: AsyncCallback): void; /** - * Hangups the foreground call. + * Hang up the foreground call. * * @param callId Indicates the identifier of the call to hangup. * @permission ohos.permission.ANSWER_CALL @@ -162,7 +162,7 @@ declare namespace call { function hangup(callId?: number): Promise; /** - * Hangups the foreground call without callId. + * Hang up the foreground call without callId. * * @systemapi Hide this for inner system use. * @since 9 @@ -170,7 +170,7 @@ declare namespace call { function hangup(callback: AsyncCallback): void; /** - * Rejects the incoming call. + * Reject the incoming call. * * @param callId Indicates the identifier of the call to reject. * @param options Indicates the text message to reject. @@ -183,7 +183,7 @@ declare namespace call { function reject(callId?: number, options?: RejectMessageOptions): Promise; /** - * Rejects the incoming call without callId. + * Reject the incoming call without callId. * * @param options Indicates the text message to reject. * @permission ohos.permission.ANSWER_CALL @@ -532,9 +532,54 @@ declare namespace call { * @since 8 */ export interface CallTransferInfo { + /** + * Phone number. + * + * @since 8 + */ transferNum: string; + + /** + * Call forwarding type. + * + * @since 8 + */ type: CallTransferType; + + /** + * Call forwarding setting type. + * + * @since 8 + */ settingType: CallTransferSettingType; + + /** + * Start time hours. + * + * @since 9 + */ + startHour?: number; + + /** + * Start time minutes. + * + * @since 9 + */ + startMinute?: number; + + /** + * End time hours. + * + * @since 9 + */ + endHour?: number; + + /** + * End time minutes. + * + * @since 9 + */ + endMinute?: number; } /** @@ -687,21 +732,25 @@ declare namespace call { * boolean means whether the call to be made is a video call. The value {@code false} indicates a voice call. */ extras?: boolean; + /** * @systemapi Hide this for inner system use. * @since 8 */ accountId?: number; + /** * @systemapi Hide this for inner system use. * @since 8 */ videoState?: VideoStateType; + /** * @systemapi Hide this for inner system use. * @since 8 */ dialScene?: DialScene; + /** * @systemapi Hide this for inner system use. * @since 8 @@ -742,8 +791,47 @@ declare namespace call { * @since 8 */ export interface CallTransferResult { + /** + * Call forwarding status. + * + * @since 8 + */ status: TransferStatus; + + /** + * Call forwarding phone number. + * + * @since 8 + */ number: string; + + /** + * Start time hours. + * + * @since 9 + */ + startHour: number; + + /** + * Start time minutes. + * + * @since 9 + */ + startMinute: number; + + /** + * End time hours. + * + * @since 9 + */ + endHour: number; + + /** + * End time minutes. + * + * @since 9 + */ + endMinute: number; } /** @@ -751,7 +839,18 @@ declare namespace call { * @since 7 */ export enum CallWaitingStatus { + /** + * Indicates that call waiting is not enabled. + * + * @since 7 + */ CALL_WAITING_DISABLE = 0, + + /** + * Indicates that call waiting is enabled. + * + * @since 7 + */ CALL_WAITING_ENABLE = 1 } @@ -760,7 +859,18 @@ declare namespace call { * @since 8 */ export enum RestrictionStatus { + /** + * Indicates that call barring is not enabled. + * + * @since 8 + */ RESTRICTION_DISABLE = 0, + + /** + * Indicates that call barring is enabled. + * + * @since 8 + */ RESTRICTION_ENABLE = 1 } @@ -769,7 +879,18 @@ declare namespace call { * @since 8 */ export enum TransferStatus { + /** + * Indicates that call forwarding is not enabled. + * + * @since 8 + */ TRANSFER_DISABLE = 0, + + /** + * Indicates that call forwarding is enabled. + * + * @since 8 + */ TRANSFER_ENABLE = 1 } @@ -777,6 +898,11 @@ declare namespace call { * @since 7 */ export interface EmergencyNumberOptions { + /** + * Indicates sim card slot number. + * + * @since 7 + */ slotId?: number; } @@ -784,6 +910,11 @@ declare namespace call { * @since 7 */ export interface NumberFormatOptions { + /** + * Indicates the country code. + * + * @since 7 + */ countryCode?: string; } @@ -792,6 +923,11 @@ declare namespace call { * @since 9 */ export interface AudioDeviceOptions { + /** + * Indicates the bluetooth device address. + * + * @since 9 + */ bluetoothAddress?: string; } @@ -800,9 +936,18 @@ declare namespace call { * @since 9 */ export interface MmiCodeResults { - /** Indicates the result of MMI code. */ + /** + * Indicates the result of MMI code. + * + * @since 9 + */ result: MmiCodeResult; - /** Indicates the message of MMI code. */ + + /** + * Indicates the message of MMI code. + * + * @since 9 + */ message: string; } @@ -811,9 +956,16 @@ declare namespace call { * @since 9 */ export enum MmiCodeResult { - /** Indicates the result of MMI code with successfully. */ + /** Indicates the result of MMI code with successfully. + * + * @since 9 + */ MMI_CODE_SUCCESS = 0, - /** Indicates the result of MMI code with failed. */ + + /** Indicates the result of MMI code with failed. + * + * @since 9 + */ MMI_CODE_FAILED = 1 } @@ -821,28 +973,576 @@ declare namespace call { * @systemapi Hide this for inner system use. * @since 8 */ - export enum DisconnectedDetails { + export enum DisconnectedReason { + /** + * Unassigned number. + * + * @since 8 + */ + UNASSIGNED_NUMBER = 1, + /** + * No route to destination. + * + * @since 8 + */ + NO_ROUTE_TO_DESTINATION = 3, + /** + * Channel unacceptable. + * + * @since 8 + */ + CHANNEL_UNACCEPTABLE = 6, + /** + * Operator determined barring. + * + * @since 8 + */ + OPERATOR_DETERMINED_BARRING = 8, + + /** + * Call completed elsewhere. + * + * @since 9 + */ + CALL_COMPLETED_ELSEWHERE = 13, + + /** + * Normal call clearing. + * + * @since 8 + */ NORMAL_CALL_CLEARING = 16, + + /** + * User busy. + * + * @since 8 + */ USER_BUSY = 17, + + /** + * No user responding. + * + * @since 8 + */ NO_USER_RESPONDING = 18, + + /** + * User alerting, no answer. + * + * @since 8 + */ USER_ALERTING_NO_ANSWER = 19, + + /** + * Call rejected. + * + * @since 8 + */ CALL_REJECTED = 21, + + /** + * Number changed. + * + * @since 8 + */ NUMBER_CHANGED = 22, + + /** + * Call rejected due to feature at the destination. + * + * @since 9 + */ + CALL_REJECTED_DUE_TO_FEATURE_AT_THE_DESTINATION = 24, + + /** + * Pre-emption. + * + * @since 9 + */ + FAILED_PRE_EMPTION = 25, + + /** + * Non selected user clearing. + * + * @since 9 + */ + NON_SELECTED_USER_CLEARING = 26, + + /** + * Destination out of order. + * + * @since 8 + */ DESTINATION_OUT_OF_ORDER = 27, + + /** + * Invalid number format. + * + * @since 8 + */ INVALID_NUMBER_FORMAT = 28, + + /** + * Facility rejected. + * + * @since 9 + */ + FACILITY_REJECTED = 29, + + /** + * Response to status enquiry. + * + * @since 9 + */ + RESPONSE_TO_STATUS_ENQUIRY = 30, + + /** + * Normal, unspecified. + * + * @since 9 + */ + NORMAL_UNSPECIFIED = 31, + + /** + * No circuit/channel available. + * + * @since 9 + */ + NO_CIRCUIT_CHANNEL_AVAILABLE = 34, + + /** + * Network out of order. + * + * @since 8 + */ NETWORK_OUT_OF_ORDER = 38, + + /** + * Temporary failure. + * + * @since 8 + */ TEMPORARY_FAILURE = 41, + + /** + * Switching equipment congestion. + * + * @since 9 + */ + SWITCHING_EQUIPMENT_CONGESTION = 42, + + /** + * Access information discarded. + * + * @since 9 + */ + ACCESS_INFORMATION_DISCARDED = 43, + + /** + * Requested circuit/channel not available. + * + * @since 9 + */ + REQUEST_CIRCUIT_CHANNEL_NOT_AVAILABLE = 44, + + /** + * Resources unavailable unspecified. + * + * @since 9 + */ + RESOURCES_UNAVAILABLE_UNSPECIFIED = 47, + + /** + * Quality of service unavailable. + * + * @since 9 + */ + QUALITY_OF_SERVICE_UNAVAILABLE = 49, + + /** + * Requested facility not subscribed. + * + * @since 9 + */ + REQUESTED_FACILITY_NOT_SUBSCRIBED = 50, + + /** + * Incoming calls barred within the CUG. + * + * @since 9 + */ + INCOMING_CALLS_BARRED_WITHIN_THE_CUG = 55, + + /** + * Bearer capability not authorized. + * + * @since 9 + */ + BEARER_CAPABILITY_NOT_AUTHORIZED = 57, + + /** + * Bearer capability not presently available. + * + * @since 9 + */ + BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE = 58, + + /** + * Service or option not available, unspec. + * + * @since 9 + */ + SERVICE_OR_OPTION_NOT_AVAILABLE_UNSPECIFIED = 63, + + /** + * Bearer service not implemented. + * + * @since 9 + */ + BEARER_SERVICE_NOT_IMPLEMENTED = 65, + + /** + * ACM equal to or greater than ACMmax. + * + * @since 9 + */ + ACM_EQUALTO_OR_GREATE_THAN_ACMMAX = 68, + + /** + * Requested facility not implemented. + * + * @since 9 + */ + REQUESTED_FACILITY_NOT_IMPLEMENTED = 69, + + /** + * Only restricted digital info BC available. + * + * @since 9 + */ + ONLY_RESTRICTED_DIGITAL_INFO_BEARER_CAPABILITY_IS_AVAILABLE = 70, + + /** + * Service or option not implemented, unspec. + * + * @since 9 + */ + SERVICE_OR_OPTION_NOT_IMPLEMENTED_UNSPECIFIED = 79, + + /** + * Invalid transaction identifier value. + * + * @since 9 + */ + INVALID_TRANSACTION_IDENTIFIER_VALUE = 81, + + /** + * User not member of CUG. + * + * @since 9 + */ + USER_NOT_MEMBER_OF_CUG = 87, + + /** + * Incompatible destination. + * + * @since 9 + */ + INCOMPATIBLE_DESTINATION = 88, + + /** + * Invalid transit network selection. + * + * @since 9 + */ + INVALID_TRANSIT_NETWORK_SELECTION = 91, + + /** + * Semantically incorrect message. + * + * @since 9 + */ + SEMANTICALLY_INCORRECT_MESSAGE = 95, + + /** + * Invalid mandatory information. + * + * @since 9 + */ + INVALID_MANDATORY_INFORMATION = 96, + + /** + * Msg type non-existent or not implemented. + * + * @since 9 + */ + MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 97, + + /** + * Msg type not compatible with protocol state. + * + * @since 9 + */ + MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, + + /** + * IE non-existent or not implemented. + * + * @since 9 + */ + INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99, + + /** + * Conditional IE error. + * + * @since 9 + */ + CONDITIONAL_IE_ERROR = 100, + + /** + * Message not compatible with protocol state. + * + * @since 9 + */ + MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, + + /** + * Recovery on timer expiry timer number. + * + * @since 9 + */ + RECOVERY_ON_TIMER_EXPIRED = 102, + + /** + * Protocol error, unspecified. + * + * @since 9 + */ + PROTOCOL_ERROR_UNSPECIFIED = 111, + + /** + * Interworking, unspecified. + * + * @since 9 + */ + INTERWORKING_UNSPECIFIED = 127, + + /** + * Call barred. + * + * @since 9 + */ + CALL_BARRED = 240, + + /** + * FDN blocked. + * + * @since 9 + */ + FDN_BLOCKED = 241, + + /** + * IMSI in VLR is unknown. + * + * @since 9 + */ + IMSI_UNKNOWN_IN_VLR = 242, + + /** + * IMEI not accepted. + * + * @since 9 + */ + IMEI_NOT_ACCEPTED = 243, + + /** + * Dial modified to USSD. + * + * @since 9 + */ + DIAL_MODIFIED_TO_USSD = 244, + + /** + * Dial modified to SS. + * + * @since 9 + */ + DIAL_MODIFIED_TO_SS = 245, + + /** + * Dial modified to dial. + * + * @since 9 + */ + DIAL_MODIFIED_TO_DIAL = 246, + + /** + * Radio off. + * + * @since 9 + */ + RADIO_OFF = 247, + + /** + * Out of service. + * + * @since 9 + */ + OUT_OF_SERVICE = 248, + + /** + * Invalid SIM. + * + * @since 9 + */ + NO_VALID_SIM = 249, + + /** + * Radio internal error. + * + * @since 9 + */ + RADIO_INTERNAL_ERROR = 250, + + /** + * Network response timeout. + * + * @since 9 + */ + NETWORK_RESP_TIMEOUT = 251, + + /** + * Network reject. + * + * @since 9 + */ + NETWORK_REJECT = 252, + + /** + * Radio access failure. + * + * @since 9 + */ + RADIO_ACCESS_FAILURE = 253, + + /** + * Radio link failure. + * + * @since 9 + */ + RADIO_LINK_FAILURE = 254, + + /** + * Radio link lost. + * + * @since 9 + */ + RADIO_LINK_LOST = 255, + + /** + * Radio uplink failure. + * + * @since 9 + */ + RADIO_UPLINK_FAILURE = 256, + + /** + * Radio setup failure. + * + * @since 9 + */ + RADIO_SETUP_FAILURE = 257, + + /** + * Radio release normal. + * + * @since 9 + */ + RADIO_RELEASE_NORMAL = 258, + + /** + * Radio release abnormal. + * + * @since 9 + */ + RADIO_RELEASE_ABNORMAL = 259, + + /** + * Access class blocked. + * + * @since 9 + */ + ACCESS_CLASS_BLOCKED = 260, + + /** + * Network detach. + * + * @since 9 + */ + NETWORK_DETACH = 261, + + /** + * Invalid parameter. + * + * @since 8 + */ INVALID_PARAMETER = 1025, + + /** + * Sim not exit. + * + * @since 8 + */ SIM_NOT_EXIT = 1026, + + /** + * Sim pin need. + * + * @since 8 + */ SIM_PIN_NEED = 1027, + + /** + * Call Not allow. + * + * @since 8 + */ CALL_NOT_ALLOW = 1029, + + /** + * Sim invalid. + * + * @since 8 + */ SIM_INVALID = 1045, + + /** + * Unknown error. + * + * @since 8 + */ UNKNOWN = 1279, } + + /** + * @systemapi Hide this for inner system use. + * @since 9 + */ + export interface DisconnectedDetails { + /** + * Indicates the reason for ending the call. + */ + reason: DisconnectedReason; + /** + * Indicates the message for ending the call. + */ + message: string; + } } export default call; diff --git a/api/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts index a562d69080..fb67aacbf6 100644 --- a/api/@ohos.telephony.data.d.ts +++ b/api/@ohos.telephony.data.d.ts @@ -25,7 +25,7 @@ declare namespace data { /** * Checks whether cellular data services are enabled. * - * @return Returns {@code true} if cellular data services are enabled; returns {@code false} otherwise. + * @returns Returns {@code true} if cellular data services are enabled; returns {@code false} otherwise. */ function getDefaultCellularDataSlotId(callback: AsyncCallback): void; function getDefaultCellularDataSlotId(): Promise; @@ -33,7 +33,7 @@ declare namespace data { /** * Checks whether cellular data services are enabled. * - * @return Returns default cellular data slot id. + * @returns Returns default cellular data slot id. * @since 9 */ function getDefaultCellularDataSlotIdSync(): number; @@ -93,7 +93,7 @@ declare namespace data { function enableCellularData(): Promise; /** - * Diables cellular data services. + * Disables cellular data services. * * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts index 7e0ac5b3e9..7bfc17e425 100644 --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -75,7 +75,7 @@ declare namespace observer { * @param options including slotId Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback including an array of instances of the classes derived from {@link CellInformation}. - * @permission ohos.permission.LOCATION + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION * @systemapi Hide this for inner system use. * @since 8 */ @@ -185,13 +185,13 @@ declare namespace observer { SIM_PUK, SIM_PN_PIN, //Network Personalization (refer 3GPP TS 22.022 [33]) SIM_PN_PUK, - SIM_PU_PIN, //network sUbset Personalization (refer 3GPP TS 22.022 [33]) + SIM_PU_PIN, //Network Subset Personalization (refer 3GPP TS 22.022 [33]) SIM_PU_PUK, - SIM_PP_PIN, //service Provider Personalization (refer 3GPP TS 22.022 [33]) + SIM_PP_PIN, //Service Provider Personalization (refer 3GPP TS 22.022 [33]) SIM_PP_PUK, SIM_PC_PIN, //Corporate Personalization (refer 3GPP TS 22.022 [33]) SIM_PC_PUK, - SIM_SIM_PIN, //SIM/USIM personalisation (refer 3GPP TS 22.022 [33]) + SIM_SIM_PIN, //SIM/USIM Personalization (refer 3GPP TS 22.022 [33]) SIM_SIM_PUK, } } diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index e5cc3b93fc..509612624d 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -65,9 +65,9 @@ declare namespace radio { function getNetworkState(slotId?: number): Promise; /** - * Proactively requests to update location information. + * Actively requests to update location information. * - * @permission ohos.permission.LOCATION + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION * @param { number } [ slotId ] - indicates the card slot index number. * @param { AsyncCallback } callback - the callback of sendUpdateCellLocationRequest. * @systemapi @@ -77,9 +77,9 @@ declare namespace radio { function sendUpdateCellLocationRequest(slotId: number, callback: AsyncCallback): void; /** - * Proactively requests to update location information. + * Actively requests to update location information. * - * @permission ohos.permission.LOCATION + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION * @param { number } [ slotId ] - indicates the card slot index number. * @returns { Promise } the promise returned by the function. * @systemapi @@ -88,7 +88,7 @@ declare namespace radio { function sendUpdateCellLocationRequest(slotId?: number): Promise; /** - * @permission ohos.permission.LOCATION + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION * @systemapi Hide this for inner system use. * @since 8 */ @@ -223,8 +223,7 @@ declare namespace radio { /** * Checks whether the device supports 5G New Radio (NR). * - * @return Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. - * @deprecated Advised to use isNrSupported(slotId: number) instead. + * @returns Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. * @since 7 */ function isNrSupported(): boolean; @@ -234,7 +233,7 @@ declare namespace radio { * * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number * supported by the device. - * @return Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. + * @returns Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. * @since 8 */ function isNrSupported(slotId: number): boolean; @@ -300,7 +299,7 @@ declare namespace radio { function getPreferredNetwork(slotId: number): Promise; /** - * Get the IMS registration state info of specificed IMS service type. + * Get the IMS registration state info of specified 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. @@ -317,11 +316,11 @@ declare namespace radio { * @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; + 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 + * Called when the IMS registration state of specified IMS service type corresponding * to a monitored {@code slotId} updates. * * @param slotId Indicates the card slot index number, @@ -530,7 +529,7 @@ declare namespace radio { /** * Obtains the operator name in the long alphanumeric format of the registered network. * - * @return Returns the operator name in the long alphanumeric format as a string; + * @returns Returns the operator name in the long alphanumeric format as a string; * returns an empty string if no operator name is obtained. */ longOperatorName: string; @@ -538,7 +537,7 @@ declare namespace radio { /** * Obtains the operator name in the short alphanumeric format of the registered network. * - * @return Returns the operator name in the short alphanumeric format as a string; + * @returns Returns the operator name in the short alphanumeric format as a string; * returns an empty string if no operator name is obtained. */ shortOperatorName: string; @@ -546,28 +545,28 @@ declare namespace radio { /** * Obtains the PLMN code of the registered network. * - * @return Returns the PLMN code as a string; returns an empty string if no operator name is obtained. + * @returns Returns the PLMN code as a string; returns an empty string if no operator name is obtained. */ plmnNumeric: string; /** * Checks whether the device is roaming. * - * @return Returns {@code true} if the device is roaming; returns {@code false} otherwise. + * @returns Returns {@code true} if the device is roaming; returns {@code false} otherwise. */ isRoaming: boolean; /** * Obtains the network registration status of the device. * - * @return Returns the network registration status {@code RegState}. + * @returns Returns the network registration status {@code RegState}. */ regState: RegState; /** * Obtains the radio Access technology after config conversion. * - * @return Returns the radio Access technology {@code RadioTechnology}. + * @returns Returns the radio Access technology {@code RadioTechnology}. * @since 8 */ cfgTech: RadioTechnology; @@ -575,21 +574,21 @@ declare namespace radio { /** * Obtains the NSA network registration status of the device. * - * @return Returns the NSA network registration status {@code NsaState}. + * @returns Returns the NSA network registration status {@code NsaState}. */ nsaState: NsaState; /** * Obtains the status of CA. * - * @return Returns {@code true} if CA is actived; returns {@code false} otherwise. + * @returns Returns {@code true} if CA is actived; returns {@code false} otherwise. */ isCaActive: boolean; /** * Checks whether this device is allowed to make emergency calls only. * - * @return Returns {@code true} if this device is allowed to make emergency calls only; + * @returns Returns {@code true} if this device is allowed to make emergency calls only; * returns {@code false} otherwise. */ isEmergency: boolean; @@ -666,14 +665,14 @@ declare namespace radio { * *

An application can call this method to determine the network type that the child class uses. * - * @return Returns the the network type of the serving cell. + * @returns Returns the the network type of the serving cell. */ networkType: NetworkType; /** * Obtains the camp-on status of the serving cell. * - * @return Returns {@code true} if the user equipment (UE) is camped on the cell; returns + * @returns Returns {@code true} if the user equipment (UE) is camped on the cell; returns * {@code false} otherwise. */ isCamped: boolean; @@ -681,7 +680,7 @@ declare namespace radio { /** * Obtains the timestamp when the cell information is obtained. * - * @return Returns a timestamp since boot, in nanoseconds. + * @returns Returns a timestamp since boot, in nanoseconds. */ timeStamp: number; @@ -689,7 +688,7 @@ declare namespace radio { * An abstract method of the parent class whose implementation depends on the child classes. * Returned child class objects vary according to the network type. * - * @return Returns child class objects specific to the network type. + * @returns Returns child class objects specific to the network type. */ signalInformation: SignalInformation; diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 0b269cb7ea..d2425377b5 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -166,6 +166,12 @@ declare namespace sim { function getVoiceMailNumber(slotId: number): Promise; /** + * Sets the voice mail information. + * + * @param slotId Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @param mailName Indicates the name of voice mail. + * @param mailNumber Indicates the number of voice mail. * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 @@ -207,7 +213,7 @@ declare namespace sim { * Obtains the maximum number of SIM cards that can be used simultaneously on the device, * that is, the maximum number of SIM card slots. * - * @return Returns the maximum number of SIM card slots. + * @returns Returns the maximum number of SIM card slots. * @since 7 */ function getMaxSimCount(): number; @@ -303,6 +309,12 @@ declare namespace sim { function getShowNumber(slotId: number): Promise; /** + * Obtains the operatorconfigs of the SIM card in a specified slot. + * + * @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 operatorconfigs in a specified slot; returns empty OperatorConfig + * if no SIM card is inserted * @permission ohos.permission.GET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 @@ -431,11 +443,10 @@ declare namespace sim { function unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise; /** - * Obtains the opkey of the SIM card in a specified slot. + * Obtains the operator key of the SIM card in a specified slot. * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 8300001 - Invalid parameter value. @@ -443,19 +454,18 @@ declare namespace sim { * @throws {BusinessError} 8300003 - System internal error. * @throws {BusinessError} 8300004 - Do not have sim card. * @throws {BusinessError} 8300999 - Unknown error code. - * @return Returns the opkey; returns an empty string if no SIM card is inserted or - * no opkey matched. + * @returns Returns the operator key; returns an empty string if no SIM card is inserted or + * no operator key matched. * @since 9 */ function getOpKey(slotId: number, callback: AsyncCallback): void; function getOpKey(slotId: number): Promise; /** - * Obtains the opname of the SIM card in a specified slot. + * Obtains the operator name of the SIM card in a specified slot. * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 8300001 - Invalid parameter value. @@ -463,8 +473,8 @@ declare namespace sim { * @throws {BusinessError} 8300003 - System internal error. * @throws {BusinessError} 8300004 - Do not have sim card. * @throws {BusinessError} 8300999 - Unknown error code. - * @return Returns the opname; returns an empty string if no SIM card is inserted or - * no opname matched. + * @returns Returns the operator name; returns an empty string if no SIM card is inserted or + * no operator name matched. * @since 9 */ function getOpName(slotId: number, callback: AsyncCallback): void; @@ -572,7 +582,7 @@ declare namespace sim { * @since 7 */ export enum CardType { - /** Icc card type: Unknow type Card. */ + /** Icc card type: unknown type Card. */ UNKNOWN_CARD = -1, /** Icc card type: Single sim card type. */ @@ -671,15 +681,102 @@ declare namespace sim { export enum PersoLockType { PN_PIN_LOCK, //Network Personalization (refer 3GPP TS 22.022 [33]) PN_PUK_LOCK, - PU_PIN_LOCK, //network sUbset Personalization (refer 3GPP TS 22.022 [33]) + PU_PIN_LOCK, //Network Subset Personalization (refer 3GPP TS 22.022 [33]) PU_PUK_LOCK, - PP_PIN_LOCK, //service Provider Personalization (refer 3GPP TS 22.022 [33]) + PP_PIN_LOCK, //Service Provider Personalization (refer 3GPP TS 22.022 [33]) PP_PUK_LOCK, PC_PIN_LOCK, //Corporate Personalization (refer 3GPP TS 22.022 [33]) PC_PUK_LOCK, - SIM_PIN_LOCK, //SIM/USIM personalisation (refer 3GPP TS 22.022 [33]) + SIM_PIN_LOCK, //SIM/USIM Personalization (refer 3GPP TS 22.022 [33]) SIM_PUK_LOCK, } + + /** + * @systemapi Hide this for inner system use. + * @since 9 + */ + export enum OperatorConfigKey { + /** + * Indicates the voice mail number. + */ + KEY_VOICE_MAIL_NUMBER_STRING = "voice_mail_number_string", + /** + * Indicates the status of ims switch. + */ + KEY_IMS_SWITCH_ON_BY_DEFAULT_BOOL = "ims_switch_on_by_default_bool", + /** + * Indicates whether the ims switch status is hidden. + */ + KEY_HIDE_IMS_SWITCH_BOOL = "hide_ims_switch_bool", + /** + * Indicates whether volte mode is supported. + */ + KEY_VOLTE_SUPPORTED_BOOL = "volte_supported_bool", + /** + * Indicates the list supported by nr mode. + */ + KEY_NR_MODE_SUPPORTED_LIST_INT_ARRAY = "nr_mode_supported_list_int_array", + /** + * Indicates whether VOLTE supports configuration. + */ + KEY_VOLTE_PROVISIONING_SUPPORTED_BOOL = "volte_provisioning_supported_bool", + /** + * Indicates whether SS service supports UT. + */ + KEY_SS_OVER_UT_SUPPORTED_BOOL = "ss_over_ut_supported_bool", + /** + * Indicates whether the IMS requires GBA. + */ + KEY_IMS_GBA_REQUIRED_BOOL = "ims_gba_required_bool", + /** + * Indicates whether UT configuration is supported. + */ + KEY_UT_PROVISIONING_SUPPORTED_BOOL = "ut_provisioning_supported_bool", + /** + * Indicates the ims emergency preference. + */ + KEY_IMS_PREFER_FOR_EMERGENCY_BOOL = "ims_prefer_for_emergency_bool", + /** + * Indicates call waiting service. + */ + KEY_CALL_WAITING_SERVICE_CLASS_INT = "call_waiting_service_class_int", + /** + * Indicates call forwarding visibility. + */ + KEY_CALL_TRANSFER_VISIBILITY_BOOL = "call_transfer_visibility_bool", + /** + * Indicates the list of ims call end reasons. + */ + KEY_IMS_CALL_DISCONNECT_REASONINFO_MAPPING_STRING_ARRAY = "ims_call_disconnect_reasoninfo_mapping_string_array", + /** + * Indicates the forced Volte switch on state. + */ + KEY_FORCE_VOLTE_SWITCH_ON_BOOL = "force_volte_switch_on_bool", + /** + * Indicates whether the operator name is displayed. + */ + KEY_ENABLE_OPERATOR_NAME_CUST_BOOL = "enable_operator_name_cust_bool", + /** + * Indicates the name of the operator. + */ + KEY_OPERATOR_NAME_CUST_STRING = "operator_name_cust_string", + /** + * Indicates the spn display rule. + */ + KEY_SPN_DISPLAY_CONDITION_CUST_INT = "spn_display_condition_cust_int", + /** + * Indicates the PLMN name. + */ + KEY_PNN_CUST_STRING_ARRAY = "pnn_cust_string_array", + /** + * Indicates operator PLMN information. + */ + KEY_OPL_CUST_STRING_ARRAY = "opl_cust_string_array", + /** + * Indicates the emergency call list. + */ + KEY_EMERGENCY_CALL_STRING_ARRAY = "emergency_call_string_array", + } } export default sim; diff --git a/api/@ohos.telephony.sms.d.ts b/api/@ohos.telephony.sms.d.ts index 42b9cf1263..56400a5483 100644 --- a/api/@ohos.telephony.sms.d.ts +++ b/api/@ohos.telephony.sms.d.ts @@ -114,7 +114,7 @@ declare namespace sms { /** * Returns whether a device is capable of sending and receiving SMS messages. * - * @return Returns {@code true} if the device is capable of sending and receiving SMS messages; + * @returns Returns {@code true} if the device is capable of sending and receiving SMS messages; * returns {@code false} otherwise. * @since 7 */ @@ -170,12 +170,14 @@ declare namespace sms { /** * SMS over IMS is supported if IMS is registered and SMS is supported on IMS. * + * @param slotId Indicates the default SIM card for Ims Sms. The value {@code 0} indicates card slot 1, + * and the value {@code 1} indicates card slot 2. * @param callback Returns true if SMS over IMS is supported, false otherwise. * @systemapi Hide this for inner system use. * @since 8 */ - function isImsSmsSupported(callback: AsyncCallback): void; - function isImsSmsSupported(): Promise; + function isImsSmsSupported(slotId: number, callback: AsyncCallback): void; + function isImsSmsSupported(slotId: number): Promise; /** * Gets SMS format supported on IMS. SMS over IMS format is either 3GPP or 3GPP2. -- Gitee From de38049c7fa1e43af0e072e2b8f67e8d2a45f838 Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Mon, 5 Dec 2022 15:09:13 +0800 Subject: [PATCH 2/6] fix js docs. Signed-off-by: dingxiaochen --- api/@ohos.telephony.call.d.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 727078e78b..13839ed241 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -979,28 +979,27 @@ declare namespace call { * * @since 8 */ - UNASSIGNED_NUMBER = 1, + /** * No route to destination. * * @since 8 */ - NO_ROUTE_TO_DESTINATION = 3, + /** * Channel unacceptable. * * @since 8 */ - CHANNEL_UNACCEPTABLE = 6, + /** * Operator determined barring. * * @since 8 */ - OPERATOR_DETERMINED_BARRING = 8, /** -- Gitee From 5012efb83ab4fdfa5a6904c3a084725304926175 Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Mon, 5 Dec 2022 11:22:56 +0000 Subject: [PATCH 3/6] update api/@ohos.telephony.observer.d.ts. Signed-off-by: dingxiaochen --- api/@ohos.telephony.observer.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts index 7bfc17e425..6f78554f59 100644 --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -75,7 +75,7 @@ declare namespace observer { * @param options including slotId Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback including an array of instances of the classes derived from {@link CellInformation}. - * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION + * @permission ohos.permission.LOCATION or ohos.permission.APPROXIMATELY_LOCATION * @systemapi Hide this for inner system use. * @since 8 */ -- Gitee From 8bde1a952acec26003276b8df9a41127a92626f8 Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Mon, 5 Dec 2022 11:25:52 +0000 Subject: [PATCH 4/6] update api/@ohos.telephony.radio.d.ts. Signed-off-by: dingxiaochen --- api/@ohos.telephony.radio.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index 509612624d..25424a7283 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -67,7 +67,7 @@ declare namespace radio { /** * Actively requests to update location information. * - * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION + * @permission ohos.permission.LOCATION or ohos.permission.APPROXIMATELY_LOCATION * @param { number } [ slotId ] - indicates the card slot index number. * @param { AsyncCallback } callback - the callback of sendUpdateCellLocationRequest. * @systemapi @@ -79,7 +79,7 @@ declare namespace radio { /** * Actively requests to update location information. * - * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION + * @permission ohos.permission.LOCATION or ohos.permission.APPROXIMATELY_LOCATION * @param { number } [ slotId ] - indicates the card slot index number. * @returns { Promise } the promise returned by the function. * @systemapi @@ -88,7 +88,7 @@ declare namespace radio { function sendUpdateCellLocationRequest(slotId?: number): Promise; /** - * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION + * @permission ohos.permission.LOCATION or ohos.permission.APPROXIMATELY_LOCATION * @systemapi Hide this for inner system use. * @since 8 */ -- Gitee From 6602eae968f6c8bed4587483f7ee38678d88d93d Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Mon, 5 Dec 2022 11:36:46 +0000 Subject: [PATCH 5/6] update api/@ohos.telephony.observer.d.ts. Signed-off-by: dingxiaochen --- api/@ohos.telephony.observer.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts index 6f78554f59..7bfc17e425 100644 --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -75,7 +75,7 @@ declare namespace observer { * @param options including slotId Indicates the ID of the target card slot. * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @param callback including an array of instances of the classes derived from {@link CellInformation}. - * @permission ohos.permission.LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION * @systemapi Hide this for inner system use. * @since 8 */ -- Gitee From ff3d09bee8e415fbb148760b0da9a2cd7bed19b4 Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Mon, 5 Dec 2022 11:38:01 +0000 Subject: [PATCH 6/6] update api/@ohos.telephony.radio.d.ts. Signed-off-by: dingxiaochen --- api/@ohos.telephony.radio.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index 25424a7283..509612624d 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -67,7 +67,7 @@ declare namespace radio { /** * Actively requests to update location information. * - * @permission ohos.permission.LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION * @param { number } [ slotId ] - indicates the card slot index number. * @param { AsyncCallback } callback - the callback of sendUpdateCellLocationRequest. * @systemapi @@ -79,7 +79,7 @@ declare namespace radio { /** * Actively requests to update location information. * - * @permission ohos.permission.LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION * @param { number } [ slotId ] - indicates the card slot index number. * @returns { Promise } the promise returned by the function. * @systemapi @@ -88,7 +88,7 @@ declare namespace radio { function sendUpdateCellLocationRequest(slotId?: number): Promise; /** - * @permission ohos.permission.LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION * @systemapi Hide this for inner system use. * @since 8 */ -- Gitee