harmony(鸿蒙)JS API Changes of the Telephony Subsystem

2022-08-09 浏览 (664)

JS API Changes of the Telephony Subsystem

The table below lists the APIs changes of the Telephony subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.

API Changes

ModuleClassMethod/Attribute/Enumeration/ConstantChange Type
ohos.telephony.smssmshasSmsCapability(): boolean;Added
ohos.telephony.simCardTypeSINGLE_MODE_ISIM_CARD = 60Added
ohos.telephony.simCardTypeDUAL_MODE_UG_CARD = 50Added
ohos.telephony.simCardTypeDUAL_MODE_TELECOM_LTE_CARD = 43Added
ohos.telephony.simCardTypeCU_DUAL_MODE_CARD = 42Added
ohos.telephony.simCardTypeCT_NATIONAL_ROAMING_CARD = 41Added
ohos.telephony.simCardTypeDUAL_MODE_CG_CARD = 40Added
ohos.telephony.simCardTypeSINGLE_MODE_RUIM_CARD = 30Added
ohos.telephony.simCardTypeSINGLE_MODE_USIM_CARD = 20Added
ohos.telephony.simCardTypeSINGLE_MODE_SIM_CARD = 10Added
ohos.telephony.simCardTypeUNKNOWN_CARD = -1Added
ohos.telephony.simsimhasSimCard(slotId: number, callback: AsyncCallback<boolean>): void;
hasSimCard(slotId: number): Promise<boolean>;
Added
ohos.telephony.simsimgetMaxSimCount(): number;Added
ohos.telephony.simsimgetCardType(slotId: number, callback: AsyncCallback<CardType>): void;
getCardType(slotId: number): Promise<CardType>;
Added
ohos.telephony.simsimhasOperatorPrivileges(slotId: number, callback: AsyncCallback<boolean>): void;
hasOperatorPrivileges(slotId: number): Promise<boolean>;
Added
ohos.telephony.simsimisSimActive(slotId: number, callback: AsyncCallback<boolean>): void;
isSimActive(slotId: number): Promise<boolean>;
Added
ohos.telephony.radioNetworkStatecfgTech: RadioTechnology;Added
ohos.telephony.radioradiogetOperatorName(slotId: number, callback: AsyncCallback<string>): void;
getOperatorName(slotId: number): Promise<string>;
Added
ohos.telephony.radioradioisNrSupported(): boolean;
isNrSupported(slotId: number): boolean;
Added
ohos.telephony.radioradiogetPrimarySlotId(callback: AsyncCallback<number>): void;
getPrimarySlotId(): Promise<number>;
Added
ohos.telephony.observerLockReasonSIM_SIM_PUKAdded
ohos.telephony.observerLockReasonSIM_SIM_PINAdded
ohos.telephony.observerLockReasonSIM_PC_PUKAdded
ohos.telephony.observerLockReasonSIM_PC_PINAdded
ohos.telephony.observerLockReasonSIM_PP_PUKAdded
ohos.telephony.observerLockReasonSIM_PP_PINAdded
ohos.telephony.observerLockReasonSIM_PU_PUKAdded
ohos.telephony.observerLockReasonSIM_PU_PINAdded
ohos.telephony.observerLockReasonSIM_PN_PUKAdded
ohos.telephony.observerLockReasonSIM_PN_PINAdded
ohos.telephony.observerLockReasonSIM_PUKAdded
ohos.telephony.observerLockReasonSIM_PINAdded
ohos.telephony.observerLockReasonSIM_NONEAdded
ohos.telephony.observerSimStateDatareason: LockReason;Added
ohos.telephony.observerSimStateDatastate: SimState;Added
ohos.telephony.observerSimStateDatatype: CardType;Added
ohos.telephony.observerobserveroff(type: 'simStateChange', callback?: Callback<SimStateData>): void;Added
ohos.telephony.observerobserveron(type: 'simStateChange', callback: Callback<SimStateData>): void;
on(type: 'simStateChange', options: { slotId: number }, callback: Callback<SimStateData>): void;
Added
ohos.telephony.observerobserveroff(type: 'cellularDataFlowChange', callback?: Callback<DataFlowType>): void;Added
ohos.telephony.observerobserveron(type: 'cellularDataFlowChange', callback: Callback<DataFlowType>): void;
on(type: 'cellularDataFlowChange', options: { slotId: number },callback: Callback<DataFlowType>): void;
Added
ohos.telephony.observerobserveroff(type: 'cellularDataConnectionStateChange',callback?: Callback<{ state: DataConnectState, network: RatType }>): void;Added
ohos.telephony.observerobserveron(type: 'cellularDataConnectionStateChange', callback: Callback<{ state: DataConnectState, network: RatType }>): void;
on(type: 'cellularDataConnectionStateChange', options: { slotId: number }, callback: Callback<{ state: DataConnectState, network: RatType }>): void;
Added
ohos.telephony.dataDataConnectStateDATA_STATE_SUSPENDED = 3Added
ohos.telephony.dataDataConnectStateDATA_STATE_CONNECTED = 2Added
ohos.telephony.dataDataConnectStateDATA_STATE_CONNECTING = 1Added
ohos.telephony.dataDataConnectStateDATA_STATE_DISCONNECTED = 0Added
ohos.telephony.dataDataConnectStateDATA_STATE_UNKNOWN = -1Added
ohos.telephony.dataDataFlowTypeDATA_FLOW_TYPE_DORMANT = 4Added
ohos.telephony.dataDataFlowTypeDATA_FLOW_TYPE_UP_DOWN = 3Added
ohos.telephony.dataDataFlowTypeDATA_FLOW_TYPE_UP = 2Added
ohos.telephony.dataDataFlowTypeDATA_FLOW_TYPE_DOWN = 1Added
ohos.telephony.dataDataFlowTypeDATA_FLOW_TYPE_NONE = 0Added
ohos.telephony.datadataisCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback<boolean>): void;
isCellularDataRoamingEnabled(slotId: number): Promise<boolean>;
Added
ohos.telephony.datadataisCellularDataEnabled(callback: AsyncCallback<boolean>): void;
isCellularDataEnabled(): Promise<boolean>;
Added
ohos.telephony.datadatagetCellularDataState(callback: AsyncCallback<DataConnectState>): void;
getCellularDataState(): Promise<DataConnectState>;
Added
ohos.telephony.datadatagetCellularDataFlowType(callback: AsyncCallback<DataFlowType>): void;
getCellularDataFlowType(): Promise<DataFlowType>;
Added
ohos.telephony.datadatagetDefaultCellularDataSlotId(callback: AsyncCallback<number>): void;
getDefaultCellularDataSlotId(): Promise<number>;
Added
ohos.telephony.callcallhasVoiceCapability(): boolean;Added
ohos.telephony.callcallmakeCall(phoneNumber: string, callback: AsyncCallback<void>): void;
makeCall(phoneNumber: string): Promise<void>;
Added
ohos.contactWebsitewebsite: stringAdded
ohos.contactSipAddresslabelId: numberAdded
ohos.contactSipAddresssipAddress: stringAdded
ohos.contactSipAddresslabelName: stringAdded
ohos.contactSipAddressstatic readonly INVALID_LABEL_ID: -1Added
ohos.contactSipAddressstatic readonly SIP_OTHER: 3Added
ohos.contactSipAddressstatic readonly SIP_WORK: 2Added
ohos.contactSipAddressstatic readonly SIP_HOME: 1Added
ohos.contactSipAddressstatic readonly CUSTOM_LABEL: 0Added
ohos.contactRelationlabelId: numberAdded
ohos.contactRelationrelationName: stringAdded
ohos.contactRelationlabelName: stringAdded
ohos.contactRelationstatic readonly INVALID_LABEL_ID: -1Added
ohos.contactRelationstatic readonly RELATION_SPOUSE: 14Added
ohos.contactRelationstatic readonly RELATION_SISTER: 13Added
ohos.contactRelationstatic readonly RELATION_RELATIVE: 12Added
ohos.contactRelationstatic readonly RELATION_REFERRED_BY: 11Added
ohos.contactRelationstatic readonly RELATION_PARTNER: 10Added
ohos.contactRelationstatic readonly RELATION_PARENT: 9Added
ohos.contactRelationstatic readonly RELATION_MOTHER: 8Added
ohos.contactRelationstatic readonly RELATION_MANAGER: 7Added
ohos.contactRelationstatic readonly RELATION_FRIEND: 6Added
ohos.contactRelationstatic readonly RELATION_FATHER: 5Added
ohos.contactRelationstatic readonly RELATION_DOMESTIC_PARTNER: 4Added
ohos.contactRelationstatic readonly RELATION_CHILD: 3Added
ohos.contactRelationstatic readonly RELATION_BROTHER: 2Added
ohos.contactRelationstatic readonly RELATION_ASSISTANT: 1Added
ohos.contactRelationstatic readonly CUSTOM_LABEL: 0Added
ohos.contactPostalAddresslabelId: numberAdded
ohos.contactPostalAddressstreet: stringAdded
ohos.contactPostalAddressregion: stringAdded
ohos.contactPostalAddresspostcode: stringAdded
ohos.contactPostalAddresspostalAddress: stringAdded
ohos.contactPostalAddresspobox: stringAdded
ohos.contactPostalAddressneighborhood: stringAdded
ohos.contactPostalAddresslabelName: stringAdded
ohos.contactPostalAddresscountry: stringAdded
ohos.contactPostalAddresscity: stringAdded
ohos.contactPostalAddressstatic readonly INVALID_LABEL_ID: -1Added
ohos.contactPostalAddressstatic readonly ADDR_OTHER: 3Added
ohos.contactPostalAddressstatic readonly ADDR_WORK: 2Added
ohos.contactPostalAddressstatic readonly ADDR_HOME: 1Added
ohos.contactPostalAddressstatic readonly CUSTOM_LABEL: 0Added
ohos.contactPortraituri: stringAdded
ohos.contactPhoneNumberlabelId: numberAdded
ohos.contactPhoneNumberphoneNumber: stringAdded
ohos.contactPhoneNumberlabelName: stringAdded
ohos.contactPhoneNumberstatic readonly INVALID_LABEL_ID: -1Added
ohos.contactPhoneNumberstatic readonly NUM_MMS: 20Added
ohos.contactPhoneNumberstatic readonly NUM_ASSISTANT: 19Added
ohos.contactPhoneNumberstatic readonly NUM_WORK_PAGER: 18Added
ohos.contactPhoneNumberstatic readonly NUM_WORK_MOBILE: 17Added
ohos.contactPhoneNumberstatic readonly NUM_TTY_TDD: 16Added
ohos.contactPhoneNumberstatic readonly NUM_TELEX: 15Added
ohos.contactPhoneNumberstatic readonly NUM_RADIO: 14Added
ohos.contactPhoneNumberstatic readonly NUM_OTHER_FAX: 13Added
ohos.contactPhoneNumberstatic readonly NUM_MAIN: 12Added
ohos.contactPhoneNumberstatic readonly NUM_ISDN: 11Added
ohos.contactPhoneNumberstatic readonly NUM_COMPANY_MAIN: 10Added
ohos.contactPhoneNumberstatic readonly NUM_CAR: 9Added
ohos.contactPhoneNumberstatic readonly NUM_CALLBACK: 8Added
ohos.contactPhoneNumberstatic readonly NUM_OTHER: 7Added
ohos.contactPhoneNumberstatic readonly NUM_PAGER: 6Added
ohos.contactPhoneNumberstatic readonly NUM_FAX_HOME: 5Added
ohos.contactPhoneNumberstatic readonly NUM_FAX_WORK: 4Added
ohos.contactPhoneNumberstatic readonly NUM_WORK: 3Added
ohos.contactPhoneNumberstatic readonly NUM_MOBILE: 2Added
ohos.contactPhoneNumberstatic readonly NUM_HOME: 1Added
ohos.contactPhoneNumberstatic readonly CUSTOM_LABEL: 0Added
ohos.contactOrganizationtitle: stringAdded
ohos.contactOrganizationname: stringAdded
ohos.contactNotenoteContent: stringAdded
ohos.contactNickNamenickName: stringAdded
ohos.contactNamenameSuffix: stringAdded
ohos.contactNamenamePrefix: stringAdded
ohos.contactNamemiddleNamePhonetic: stringAdded
ohos.contactNamemiddleName: stringAdded
ohos.contactNamegivenNamePhonetic: stringAdded
ohos.contactNamegivenName: stringAdded
ohos.contactNamefullName: stringAdded
ohos.contactNamefamilyNamePhonetic: stringAdded
ohos.contactNamefamilyName: stringAdded
ohos.contactImAddresslabelId: numberAdded
ohos.contactImAddresslabelName: stringAdded
ohos.contactImAddressimAddress: stringAdded
ohos.contactImAddressstatic readonly INVALID_LABEL_ID: -2Added
ohos.contactImAddressstatic readonly IM_JABBER: 7Added
ohos.contactImAddressstatic readonly IM_ICQ: 6Added
ohos.contactImAddressstatic readonly IM_QQ: 4Added
ohos.contactImAddressstatic readonly IM_SKYPE: 3Added
ohos.contactImAddressstatic readonly IM_YAHOO: 2Added
ohos.contactImAddressstatic readonly IM_MSN: 1Added
ohos.contactImAddressstatic readonly IM_AIM: 0Added
ohos.contactImAddressstatic readonly CUSTOM_LABEL: -1Added
ohos.contactHolderholderId: numberAdded
ohos.contactHolderreadonly displayName: stringAdded
ohos.contactHolderreadonly bundleName: stringAdded
ohos.contactGrouptitle: stringAdded
ohos.contactGroupgroupId: numberAdded
ohos.contactEventlabelId: numberAdded
ohos.contactEventlabelName: stringAdded
ohos.contactEventeventDate: stringAdded
ohos.contactEventstatic readonly INVALID_LABEL_ID: -1Added
ohos.contactEventstatic readonly EVENT_BIRTHDAY: 3Added
ohos.contactEventstatic readonly EVENT_OTHER: 2Added
ohos.contactEventstatic readonly EVENT_ANNIVERSARY: 1Added
ohos.contactEventstatic readonly CUSTOM_LABEL: 0Added
ohos.contactEmaillabelId: numberAdded
ohos.contactEmaildisplayName: stringAdded
ohos.contactEmaillabelName: stringAdded
ohos.contactEmailemail: stringAdded
ohos.contactEmailstatic readonly INVALID_LABEL_ID: -1Added
ohos.contactEmailstatic readonly EMAIL_OTHER: 3Added
ohos.contactEmailstatic readonly EMAIL_WORK: 2Added
ohos.contactEmailstatic readonly EMAIL_HOME: 1Added
ohos.contactEmailstatic readonly CUSTOM_LABEL: 0Added
ohos.contactAttributeATTR_WEBSITEAdded
ohos.contactAttributeATTR_SIP_ADDRESSAdded
ohos.contactAttributeATTR_RELATIONAdded
ohos.contactAttributeATTR_POSTAL_ADDRESSAdded
ohos.contactAttributeATTR_PORTRAITAdded
ohos.contactAttributeATTR_PHONEAdded
ohos.contactAttributeATTR_ORGANIZATIONAdded
ohos.contactAttributeATTR_NOTEAdded
ohos.contactAttributeATTR_NICKNAMEAdded
ohos.contactAttributeATTR_NAMEAdded
ohos.contactAttributeATTR_IMAdded
ohos.contactAttributeATTR_GROUP_MEMBERSHIPAdded
ohos.contactAttributeATTR_EMAILAdded
ohos.contactAttributeATTR_CONTACT_EVENTAdded
ohos.contactContactAttributesattributes: Attribute[]Added
ohos.contactContactorganization: OrganizationAdded
ohos.contactContactnote: NoteAdded
ohos.contactContactnickName: NickNameAdded
ohos.contactContactname: NameAdded
ohos.contactContactwebsites: Website[]Added
ohos.contactContactsipAddresses: SipAddress[]Added
ohos.contactContactrelations: Relation[]Added
ohos.contactContactpostalAddresses: PostalAddress[]Added
ohos.contactContactportrait: PortraitAdded
ohos.contactContactphoneNumbers: PhoneNumber[]Added
ohos.contactContactimAddresses: ImAddress[]Added
ohos.contactContactgroups: Group[]Added
ohos.contactContactevents: Event[]Added
ohos.contactContactemails: Email[]Added
ohos.contactContactcontactAttributes: ContactAttributesAdded
ohos.contactContactreadonly key: stringAdded
ohos.contactContactreadonly id: numberAdded
ohos.contactContactstatic readonly INVALID_CONTACT_ID: -1Added
ohos.contactcontactisMyCard(id: number, callback: AsyncCallback<boolean>): void;
isMyCard(id: number): Promise<boolean>;
Added
ohos.contactcontactisLocalContact(id: number, callback: AsyncCallback<boolean>): void;
isLocalContact(id: number): Promise<boolean>;
Added
ohos.contactcontactupdateContact(contact: Contact, callback: AsyncCallback<void>): void;
updateContact(contact: Contact, attrs: ContactAttributes, callback: AsyncCallback<void>): void;
updateContact(contact: Contact, attrs?: ContactAttributes): Promise<void>;
Added
ohos.contactcontactqueryMyCard(callback: AsyncCallback<Contact>): void;
queryMyCard(attrs: ContactAttributes, callback: AsyncCallback<Contact>): void;
queryMyCard(attrs?: ContactAttributes): Promise<Contact>;
Added
ohos.contactcontactqueryKey(id: number, callback: AsyncCallback<string>): void;
queryKey(id: number, holder: Holder, callback: AsyncCallback<string>): void;
queryKey(id: number, holder?: Holder): Promise<string>;
Added
ohos.contactcontactqueryHolders(callback: AsyncCallback<Array<Holder>>): void;
queryHolders(): Promise<Array<Holder>>;
Added
ohos.contactcontactqueryGroups(callback: AsyncCallback<Array<Group>>): void;
queryGroups(holder: Holder, callback: AsyncCallback<Array<Group>>): void;
queryGroups(holder?: Holder): Promise<Array<Group>>;
Added
ohos.contactcontactqueryContactsByPhoneNumber(phoneNumber: string, callback: AsyncCallback<Array<Contact>>): void;
queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, callback: AsyncCallback<Array<Contact>>): void;
queryContactsByPhoneNumber(phoneNumber: string, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void;
queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void;
queryContactsByPhoneNumber(phoneNumber: string, holder?: Holder, attrs?: ContactAttributes): Promise<Array<Contact>>;
Added
ohos.contactcontactqueryContactsByEmail(email: string, callback: AsyncCallback<Array<Contact>>): void;
queryContactsByEmail(email: string, holder: Holder, callback: AsyncCallback<Array<Contact>>): void;
queryContactsByEmail(email: string, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void;
queryContactsByEmail(email: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void;
queryContactsByEmail(email: string, holder?: Holder, attrs?: ContactAttributes): Promise<Array<Contact>>;
Added
ohos.contactcontactqueryContacts(callback: AsyncCallback<Array<Contact>>): void;
queryContacts(holder: Holder, callback: AsyncCallback<Array<Contact>>): void;
queryContacts(attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void;
queryContacts(holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void;
queryContacts(holder?: Holder, attrs?: ContactAttributes): Promise<Array<Contact>>;
Added
ohos.contactcontactqueryContact(key: string, callback: AsyncCallback<Contact>): void;
queryContact(key: string, holder: Holder, callback: AsyncCallback<Contact>): void;
queryContact(key: string, attrs: ContactAttributes, callback: AsyncCallback<Contact>): void;
queryContact(key: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Contact>): void;
queryContact(key: string, holder?: Holder, attrs?: ContactAttributes): Promise<Contact>;
Added
ohos.contactcontactdeleteContact(key: string, callback: AsyncCallback<void>): void;
deleteContact(key: string): Promise<void>;
Added
ohos.contactcontactselectContact(callback: AsyncCallback<Array<Contact>>): void;
selectContact(): Promise<Array<Contact>>;
Added
ohos.contactcontactaddContact(contact: Contact, callback: AsyncCallback<number>): void;
addContact(contact: Contact): Promise<number>;
Added

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)Readme

harmony(鸿蒙)Updates (OpenHarmony 3.1 Beta -> OpenHarmony 3.1 Release)

harmony(鸿蒙)JS API Changes of the Ability Framework

harmony(鸿蒙)JS API Changes of the Accessibility Subsystem

harmony(鸿蒙)JS API Changes of the Account Subsystem

harmony(鸿蒙)JS API Changes of the ArkUI Development Framework

harmony(鸿蒙)JS API Changes of the Power Management Subsystem

harmony(鸿蒙)JS API Changes of the Bundle Management Framework

harmony(鸿蒙)JS API Changes of the Communication Subsystem

harmony(鸿蒙)JS API Changes of the Utils Subsystem

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/c12e6b4d79b041bab450e08cead0eb8c