From 6fddde909ba7f76d7f6874eca4ddc448ea4c5a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E6=B3=BD=E6=82=9F?= Date: Fri, 21 Apr 2023 07:28:54 +0000 Subject: [PATCH 01/21] update api/@ohos.multimedia.image.d.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冯泽悟 --- api/@ohos.multimedia.image.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index b43ca07ff..c73149caa 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -14,6 +14,7 @@ */ import { AsyncCallback } from './@ohos.base'; +import type colorSpaceManager from './@ohos.graphics.colorSpaceManager.d.ts'; /** * @namespace image @@ -1323,6 +1324,25 @@ declare namespace image { */ crop(region: Region): Promise; + /** + * Get color space of pixel map. + * + * @returns { colorSpaceManager.ColorSpaceManager } If the operation fails, an error message is returned. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 10 + */ + getColorSpace(): colorSpaceManager.ColorSpaceManager; + + /** + * Set color space of pixel map. + * + * @param { colorSpaceManager.ColorSpaceManager } colorSpace The color space for pixel map. + * @returns { void } If the operation fails, an error message is returned. + * @syscap SystemCapability.Multimedia.Image.Core + * @since 10 + */ + setColorSpace(colorSpace: colorSpaceManager.ColorSpaceManager): void; + /** * Releases this PixelMap object. This method uses a callback to return the result. * From 6529b5076d47f4db908a20bfa72b66d2c5e71bc7 Mon Sep 17 00:00:00 2001 From: xiexiyun Date: Fri, 5 May 2023 03:03:12 +0000 Subject: [PATCH 02/21] enable request keyboard on focus Signed-off-by: xiexiyun Change-Id: I2aac5290bb21d78985ff974e69c98b80edcb54ff --- api/@internal/component/ets/search.d.ts | 11 +++++++++++ api/@internal/component/ets/text_area.d.ts | 11 +++++++++++ api/@internal/component/ets/text_input.d.ts | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/api/@internal/component/ets/search.d.ts b/api/@internal/component/ets/search.d.ts index e429b20e9..c8a89ec96 100644 --- a/api/@internal/component/ets/search.d.ts +++ b/api/@internal/component/ets/search.d.ts @@ -283,6 +283,17 @@ declare class SearchAttribute extends CommonMethod { * @since 9 */ textAlign(value: TextAlign): SearchAttribute; + + /** + * Sets whether request keyboard or not when on focus. + * @param { boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @crossplatform + * @since 10 + */ + enableKeyboardOnFocus(value: boolean): SearchAttribute; } /** diff --git a/api/@internal/component/ets/text_area.d.ts b/api/@internal/component/ets/text_area.d.ts index 757dc699b..535c1886c 100644 --- a/api/@internal/component/ets/text_area.d.ts +++ b/api/@internal/component/ets/text_area.d.ts @@ -177,6 +177,17 @@ declare class TextAreaAttribute extends CommonMethod { * @since 9 */ copyOption(value: CopyOptions): TextAreaAttribute; + + /** + * Sets whether request keyboard or not when on focus. + * @param { boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @returns { TextAreaInterface } Returns the instance of the TextAreaInterface. + * @crossplatform + * @since 10 + */ + enableKeyboardOnFocus(value: boolean): TextAreaInterface; } /** diff --git a/api/@internal/component/ets/text_input.d.ts b/api/@internal/component/ets/text_input.d.ts index 28c2eafda..df18f532c 100644 --- a/api/@internal/component/ets/text_input.d.ts +++ b/api/@internal/component/ets/text_input.d.ts @@ -348,6 +348,17 @@ declare class TextInputAttribute extends CommonMethod { * @since 10 */ caretPosition(value: number): TextInputAttribute; + + /** + * Sets whether request keyboard or not when on focus. + * @param { boolean } + * @default true + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @crossplatform + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + enableKeyboardOnFocus(value: boolean): TextInputAttribute; } /** From b4d37078922a8360c2533e8960ec6d754c1ac870 Mon Sep 17 00:00:00 2001 From: lin-jianwu Date: Tue, 9 May 2023 16:43:37 +0800 Subject: [PATCH 03/21] add player missing device define syscap Signed-off-by: lin-jianwu --- api/device-define/car.json | 2 ++ api/device-define/default.json | 2 ++ api/device-define/tablet.json | 2 ++ api/device-define/tv.json | 2 ++ api/device-define/wearable.json | 2 ++ 5 files changed, 10 insertions(+) diff --git a/api/device-define/car.json b/api/device-define/car.json index 3305a8b47..015fc3ba6 100644 --- a/api/device-define/car.json +++ b/api/device-define/car.json @@ -56,6 +56,8 @@ "SystemCapability.Multimedia.Media.VideoEncoder", "SystemCapability.Multimedia.Media.Spliter", "SystemCapability.Multimedia.Media.Muxer", + "SystemCapability.Multimedia.Media.AVPlayer", + "SystemCapability.Multimedia.Media.AVRecorder", "SystemCapability.Multimedia.AVSession.Core", "SystemCapability.Multimedia.AVSession.Manager", "SystemCapability.Multimedia.Audio.Core", diff --git a/api/device-define/default.json b/api/device-define/default.json index 35711fa37..bd06a22e1 100644 --- a/api/device-define/default.json +++ b/api/device-define/default.json @@ -62,6 +62,8 @@ "SystemCapability.Multimedia.Media.VideoEncoder", "SystemCapability.Multimedia.Media.Spliter", "SystemCapability.Multimedia.Media.Muxer", + "SystemCapability.Multimedia.Media.AVPlayer", + "SystemCapability.Multimedia.Media.AVRecorder", "SystemCapability.Multimedia.AVSession.Core", "SystemCapability.Multimedia.AVSession.Manager", "SystemCapability.Multimedia.Audio.Core", diff --git a/api/device-define/tablet.json b/api/device-define/tablet.json index fdcf502cf..da94dd66c 100644 --- a/api/device-define/tablet.json +++ b/api/device-define/tablet.json @@ -61,6 +61,8 @@ "SystemCapability.Multimedia.Media.VideoEncoder", "SystemCapability.Multimedia.Media.Spliter", "SystemCapability.Multimedia.Media.Muxer", + "SystemCapability.Multimedia.Media.AVPlayer", + "SystemCapability.Multimedia.Media.AVRecorder", "SystemCapability.Multimedia.AVSession.Core", "SystemCapability.Multimedia.AVSession.Manager", "SystemCapability.Multimedia.Audio.Core", diff --git a/api/device-define/tv.json b/api/device-define/tv.json index ca184d8e6..fc32899cf 100644 --- a/api/device-define/tv.json +++ b/api/device-define/tv.json @@ -53,6 +53,8 @@ "SystemCapability.Multimedia.Media.VideoEncoder", "SystemCapability.Multimedia.Media.Spliter", "SystemCapability.Multimedia.Media.Muxer", + "SystemCapability.Multimedia.Media.AVPlayer", + "SystemCapability.Multimedia.Media.AVRecorder", "SystemCapability.Multimedia.AVSession.Core", "SystemCapability.Multimedia.AVSession.Manager", "SystemCapability.Multimedia.Audio.Core", diff --git a/api/device-define/wearable.json b/api/device-define/wearable.json index dcea8dc1e..e09b7e2a4 100644 --- a/api/device-define/wearable.json +++ b/api/device-define/wearable.json @@ -53,6 +53,8 @@ "SystemCapability.Multimedia.Media.VideoEncoder", "SystemCapability.Multimedia.Media.Spliter", "SystemCapability.Multimedia.Media.Muxer", + "SystemCapability.Multimedia.Media.AVPlayer", + "SystemCapability.Multimedia.Media.AVRecorder", "SystemCapability.Multimedia.AVSession.Core", "SystemCapability.Multimedia.AVSession.Manager", "SystemCapability.Multimedia.Audio.Core", From 871fc9520ba13de785360e0e2a8f24e72471ee41 Mon Sep 17 00:00:00 2001 From: wangqing Date: Tue, 9 May 2023 20:07:19 +0800 Subject: [PATCH 04/21] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9EAPI=E6=94=B6?= =?UTF-8?q?=E9=9B=86=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangqing --- build-tools/collect_api/README_zh.md | 29 + build-tools/collect_api/collect_base_api.js | 758 ++++++++++++++++++++ build-tools/collect_api/package.json | 20 + 3 files changed, 807 insertions(+) create mode 100644 build-tools/collect_api/README_zh.md create mode 100644 build-tools/collect_api/collect_base_api.js create mode 100644 build-tools/collect_api/package.json diff --git a/build-tools/collect_api/README_zh.md b/build-tools/collect_api/README_zh.md new file mode 100644 index 000000000..64c373a0e --- /dev/null +++ b/build-tools/collect_api/README_zh.md @@ -0,0 +1,29 @@ +# 基础API解析工具 + +## 简介 + +该工具可用于解析d.ts文件中的API,并汇总成表格,提供给应用开发者 + +## 目录 + +``` +└─API #存放需要扫描的d.ts文件的目录 +``` + +## 使用方法 + +### 目录配置 + +新建API文件夹,放置d.ts文件。 + +### 安装 + +需要安装npm依赖环境,在package.json同级目录下执行:npm install。 + +### 使用工具 + +在package.json同级目录下执行:npm run collect。 + +## 相关文件夹 + +[collect_api](https://gitee.com/openharmony/interface_sdk-js/tree/master/build-tools/collect_api) \ No newline at end of file diff --git a/build-tools/collect_api/collect_base_api.js b/build-tools/collect_api/collect_base_api.js new file mode 100644 index 000000000..a41fa05f3 --- /dev/null +++ b/build-tools/collect_api/collect_base_api.js @@ -0,0 +1,758 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const fs = require('fs'); +const ts = require('typescript'); +const ExcelJS = require('exceljs') +const path = require('path'); +const { sys } = require('typescript'); +// 是否统计type类型API的开关,true表示统计 +const typeCollection = true; +// 是否不合并同名函数的开关,true不合并 +const isNotMerge = true; + +// 解析文件 文本内容并将结果push到列表中并去重 +function parse(files) { + const api = []; + const exportApi = []; + const returnDeclarationArr = new Set([]); + const hash = new Set([]); + const fileContentList = []; + files.forEach(file => { + let fileContent = fs.readFileSync(file, 'utf-8'); + fileContentList.push({ + fileName: path.basename(file).replace(/.d.ts$/g, '.ts'), + fileContent: fileContent, + fileRoot: file + }) + }); + fileContentList.forEach(item => { + const fileName = item.fileName.replace(/\.d.ts$/g, '.ts'); + let packageName = item.fileRoot.indexOf("component\\ets\\") >= 0 || + item.fileRoot.indexOf("component/ets/") >= 0 ? "ArkUI" : fileName.replace((/\@|.ts$/g), "").replace(/D:\\/g, "") + ts.transpileModule(item.fileContent, { + compilerOptions: { + "target": ts.ScriptTarget.ES2017 + }, + fileName: fileName, + transformers: { before: [getReturnDeclarationArr(packageName, exportApi, returnDeclarationArr)] } + }) + }); + + fileContentList.forEach(item => { + const fileName = item.fileName.replace(/\.d.ts$/g, '.ts'); + let packageName = item.fileRoot.indexOf("component\\ets\\") >= 0 || + item.fileRoot.indexOf("component/ets/") >= 0 ? "ArkUI" : fileName.replace(/\@|.ts$/g, "").replace(/D:\\/g, ""); + ts.transpileModule(item.fileContent, { + compilerOptions: { + "target": ts.ScriptTarget.ES2017 + }, + fileName: fileName, + transformers: { before: [processDeclarationSourceFile(packageName, api, exportApi, returnDeclarationArr, hash, item.fileRoot)] } + }) + }); + return api; +} + +// 获取返回值类型 +function visitAllNode(node, returnDeclarationArr) { + if ((ts.isMethodDeclaration(node) || ts.isFunctionDeclaration(node)) && node && node.type && + ts.isTypeReferenceNode(node.type)) { + returnDeclarationArr.add(node.type.typeName.getText()); + } + node.getChildren().forEach(item => { + visitAllNode(item, returnDeclarationArr) + }); +} + +// 获取导入Api的数组 +function getExportApi(node, packageName, exportApi) { + node.statements.forEach(stat => { + if (ts.isModuleDeclaration(stat)) { + if (stat.getText().indexOf('namespace') > 0) { + let apiInfo = { + isSystemApi: '公开API', + version: '', + deprecated: '', + permission: 'N/A', + sysCap: 'N/A', + model: '' + } + exportApi.push({ + packageName: packageName, + className: stat.name.escapedText.toString(), + methodName: '', + apiInfo: getApiInfo(stat, apiInfo) + }) + } + } + }); +} + +// 获取返回值类型和命名空间 +const getReturnDeclarationArr = (packageName, exportApi, returnDeclarationArr) => { + return (context) => { + return (node) => { + visitAllNode(node, returnDeclarationArr); + getExportApi(node, packageName, exportApi); + return node; + } + } +} + + +// 搜集API接口并去重 +function processDeclarationSourceFile(packageName, api, exportApi, returnDeclarationArr, hash, dtsPath) { + return (context) => { + return (node) => { + const statements = node.statements; + const currentClassFuncSet = new Set([]); + const currentTypeList = new Array(); + getCurrentTypeList(statements, currentTypeList); + + statements.forEach(stat => { + let apiInfo = { + isSystemApi: '公开API', + version: '', + deprecated: '', + permission: 'N/A', + sysCap: 'N/A', + model: '', + headimport: 'N/A', + endexport: 'N/A', + } + collectApi(packageName, api, stat, apiInfo, exportApi, returnDeclarationArr, hash, dtsPath, + currentTypeList, currentClassFuncSet); + }); + return node; + } + } +} + +function getCurrentTypeList(statements, currentTypeList) { + statements.forEach(stat => { + if (ts.isTypeAliasDeclaration(stat)) { + if (stat.type.types) { + let typeObj = { + name: stat.name.escapedText, + value: [] + } + stat.type.types.forEach(type => { + if (type.literal && type.literal.text) { + typeObj.value.push(type.literal.text); + } + }); + if (typeObj.value.length > 0) { + currentTypeList.push(typeObj); + } + } + } + }); +} + +function collectApi(packageName, api, stat, apiInfo, exportApi, returnDeclarationArr, hash, dtsPath, currentTypeList, + currentClassFuncSet) { + if (ts.isInterfaceDeclaration(stat)) { + collectInterfaceDeclaration(stat, packageName, api, exportApi, returnDeclarationArr, hash, apiInfo, + currentTypeList, dtsPath); + } else if (ts.isModuleDeclaration(stat)) { + collectModuleDeclaration(stat, packageName, api, exportApi, returnDeclarationArr, hash, apiInfo, + currentTypeList, dtsPath); + } else if (ts.isClassDeclaration(stat)) { + collectClassDeclaration(stat, packageName, api, exportApi, returnDeclarationArr, hash, apiInfo, + currentTypeList, dtsPath); + } else if (ts.isEnumDeclaration(stat)) { + collectEnumDeclaration(stat, packageName, api, exportApi, returnDeclarationArr, hash, apiInfo, + currentTypeList, dtsPath); + } else if (ts.isVariableStatement(stat)) { + const apiName = stat.declarationList.declarations[0].name.escapedText; + addApi(packageName, 'global', apiName, stat.getText().trim(), getApiInfo(stat, apiInfo), + 'Decorator', api, hash, dtsPath, 8); + } else { + collectSpecialApi(stat, packageName, api, hash, currentClassFuncSet, dtsPath, exportApi, apiInfo); + } +} + +function collectSpecialApi(stat, packageName, api, hash, currentClassFuncSet, dtsPath, exportApi, apiInfo) { + if (ts.isMethodDeclaration(stat) || ts.isMethodSignature(stat) || ts.isFunctionDeclaration(stat)) { + const methodName = stat.name.escapedText ? stat.name.escapedText.toString() : stat.name.text.toString(); + let className = ''; + exportApi.forEach(item => { + if (item.methodName === methodName && item.packageName === packageName) { + className = item.className + if (item.apiInfo) { + apiInfo = item.apiInfo; + } + } + }); + addFunctionOnOffApi(packageName, className, methodName, getApiInfo(stat, apiInfo), 'Method', api, + hash, currentClassFuncSet, stat, dtsPath); + } +} + +function collectInterfaceDeclaration(stat, packageName, api, exportApi, returnDeclarationArr, hash, apiInfo, currentTypeList, dtsPath) { + const className = stat.name.escapedText.toString(); + const interfaceChildren = stat.members; + let tmpApiInfo = getApiInfo(stat, apiInfo); + collectEachChildNode(interfaceChildren, packageName, className, 'Field', api, exportApi, returnDeclarationArr, hash, + tmpApiInfo, currentTypeList, dtsPath); +} + +function collectClassDeclaration(stat, packageName, api, exportApi, returnDeclarationArr, hash, apiInfo, currentTypeList, dtsPath) { + const className = stat.name.escapedText.toString(); + const classChildren = stat.members; + let tmpApiInfo = getApiInfo(stat, apiInfo); + collectEachChildNode(classChildren, packageName, className, 'Field', api, exportApi, returnDeclarationArr, hash, + tmpApiInfo, currentTypeList, dtsPath); +} + +function collectEnumDeclaration(stat, packageName, api, exportApi, returnDeclarationArr, hash, apiInfo, currentTypeList, dtsPath) { + const className = stat.name.escapedText.toString(); + const enumChildren = stat.members; + let tmpApiInfo = getApiInfo(stat, apiInfo); + collectEachChildNode(enumChildren, packageName, className, 'Enum', api, exportApi, returnDeclarationArr, hash, + tmpApiInfo, currentTypeList, dtsPath) +} + +function collectModuleDeclaration(stat, packageName, api, exportApi, returnDeclarationArr, hash, apiInfo, currentTypeList, dtsPath) { + const className = stat.name.escapedText ? stat.name.escapedText.toString() : stat.name.text.toString(); + const moduleChildren = stat.body.statements; + let tmpApiInfo = getApiInfo(stat, apiInfo); + collectEachChildNode(moduleChildren, packageName, className, 'Field', api, exportApi, returnDeclarationArr, hash, + tmpApiInfo, currentTypeList, dtsPath) +} + +function collectTypeApi(child, packageName, className, api, hash, apiInfo, dtsPath) { + let typeObj = { + name: child.name.escapedText, + value: [] + } + if (child.type.types) { + child.type.types?.forEach(type => { + collectTypeApiInTypes(type, apiInfo, child, api, hash, dtsPath, typeObj, packageName); + }); + } else if (child.type.members) { + child.type.members?.forEach(member => { + collectTypeApiInMembers(member, apiInfo, child, api, hash, dtsPath, typeObj, packageName, className); + }) + } + return typeObj; +} + +function collectTypeApiInTypes(type, apiInfo, child, api, hash, dtsPath, typeObj, packageName) { + if (type.literal && type.literal.text) { + typeObj.value.push(type.literal.text); + if (typeCollection && type.literal) { + let faterApiInfo = JSON.parse(JSON.stringify(apiInfo)); + addApi(packageName, child.name.escapedText, type.literal.text, child.getText(), + getApiInfo(child, faterApiInfo), 'Type', api, hash, dtsPath, 1); + } + } else { + if (type.getText() != '') { + typeObj.value.push(type.getText()); + if (typeCollection && type.literal) { + let faterApiInfo = JSON.parse(JSON.stringify(apiInfo)); + addApi(packageName, child.name.escapedText, type.getText(), child.getText(), + getApiInfo(child, faterApiInfo), 'Type', api, hash, dtsPath, 2); + } + } + } +} + +function collectTypeApiInMembers(member, apiInfo, child, api, hash, dtsPath, typeObj, packageName, className) { + member.type.types?.forEach(type => { + if (type.literal && type.literal.text) { + typeObj.value.push(type.literal.text); + if (typeCollection) { + let faterApiInfo = JSON.parse(JSON.stringify(apiInfo)); + addApi(packageName, child.name.escapedText, type.literal.text, child.getText(), + getApiInfo(child, faterApiInfo), 'Type', api, hash, dtsPath, 3); + } + } else { + if (type.getText() != '') { + typeObj.value.push(type.getText()); + if (typeCollection) { + let faterApiInfo = JSON.parse(JSON.stringify(apiInfo)); + addApi(packageName, className, child.name.escapedText, child.getText(), + getApiInfo(child, faterApiInfo), 'Type', api, hash, dtsPath, 4); + } + } + } + }); +} + +function collectEachChildNode(children, packageName, className, faterApiType, api, exportApi, returnDeclarationArr, + hash, apiInfo, currentTypeList, dtsPath) { + const currentClassFunSet = new Set([]); + children.forEach(child => { + if (ts.isTypeAliasDeclaration(child)) { + if (child.type) { + let typeObj = collectTypeApi(child, packageName, className, api, hash, apiInfo, dtsPath); + if (typeObj.value.length > 0) { + currentTypeList.push(typeObj) + } + } + } + }); + children.forEach(child => { + let faterApiInfo = JSON.parse(JSON.stringify(apiInfo)); + let apiType = new String(faterApiType); + if (/export.*\{.*\}/g.test(child.getText())) { + exportApi.push({ + packageName: packageName, + className: className, + methodName: child.getText().replace("export", '').replace('{', '').replace('}', '').replace(';', '').trim(), + apiInfo: faterApiInfo + }) + return + } + if (ts.isInterfaceDeclaration(child)) { + collectInterfaceDeclaration(child, packageName, api, exportApi, returnDeclarationArr, hash, faterApiInfo, currentTypeList, dtsPath); + } else if (ts.isModuleDeclaration(child)) { + collectModuleDeclaration(child, packageName, api, exportApi, returnDeclarationArr, hash, faterApiInfo, currentTypeList, dtsPath); + } else if (ts.isClassDeclaration(child)) { + collectClassDeclaration(child, packageName, api, exportApi, returnDeclarationArr, hash, faterApiInfo, currentTypeList, dtsPath); + } else if (ts.isEnumDeclaration(child)) { + collectEnumDeclaration(child, packageName, api, exportApi, returnDeclarationArr, hash, faterApiInfo, currentTypeList, dtsPath); + } else { + if ((ts.isMethodDeclaration(child) || ts.isMethodSignature(child) || ts.isFunctionDeclaration(child)) && + (child.name.escapedText === 'on' || child.name.escapedText === 'off') && child.parameters && child.parameters.length > 0) { + apiType = 'Method'; + collectSubscriptionTypeApi(child, apiType, packageName, className, faterApiType, api, currentTypeList, + hash, currentClassFunSet, dtsPath); + } else { + collectOtherApi(child, packageName, className, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath, returnDeclarationArr) + } + } + }); +} + +function collectOtherApi(child, packageName, className, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath, returnDeclarationArr) { + let methodName = ""; + if (isSpecialMethod(child)) { + if (child.name) { + methodName = child.name.getText(); + } else { + methodName = className; + } + apiType = 'Method' + } else if (ts.isPropertyDeclaration(child) || ts.isPropertySignature(child)) { + if (child.type && child.type.parameters) { + methodName = child.name.escapedText; + apiType = 'Method' + } else { + methodName = child.name.escapedText; + apiType = 'Field'; + } + } else { + if (child.name) { + methodName = child.name.getText(); + } + } + if (methodName !== "") { + addFunctionOnOffApi(packageName, className, methodName, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath); + } else { + if (child.getText().indexOf("constructor") === 0) { + methodName = 'constructor'; + apiType = 'Method'; + } else if (child.getText().indexOf("const") === 0) { + const infoObj = collectFieleOrConstant(apiType, methodName, child, returnDeclarationArr); + methodName = infoObj.methodName; + apiType = infoObj.apiType; + } else if (/\w+:\s*\w+/g.test(child.getText())) { + apiType = 'Field'; + methodName = child.getText().split(":")[0].trim(); + } + if (methodName != '') { + addApi(packageName, className, methodName, child.getText(), + getApiInfo(child, faterApiInfo), apiType, api, hash, dtsPath, 5); + } + } +} + +function isSpecialMethod(child){ + return ts.isMethodDeclaration(child) || ts.isMethodSignature(child) || ts.isFunctionDeclaration(child) || + ts.isCallSignatureDeclaration(child) || ts.isConstructSignatureDeclaration(child) || + ts.isIndexSignatureDeclaration(child); +} + +function collectFieleOrConstant(apiType, methodName, child, returnDeclarationArr) { + if (child.getText().replace("const", "").indexOf(":") > 0) { + if (returnDeclarationArr.has(child.getText().replace("const", "").split(":")[1].trim())) { + apiType = 'Field'; + } else { + apiType = 'Constant'; + } + methodName = child.getText().replace('const', "").split(":")[0].trim(); + } else if (child.getText().replace("const", "").indexOf("=") > 0) { + if (returnDeclarationArr.has(child.getText().replace("const", "").split("=")[1].trim())) { + apiType = 'Field'; + } else { + apiType = 'Constant'; + } + methodName = child.getText().replace('const', "").split("=")[0].trim(); + } + return { apiType, methodName }; +} + +function collectSubscriptionTypeApi(child, apiType, packageName, className, faterApiInfo, api, currentTypeList, + hash, currentClassFunSet, dtsPath) { + for (let i = 0; i < child.parameters.length; i++) { + const param = child.parameters[i]; + if (isCommonSubscriptionType(param)) { + if (param.type && param.type.literal && param.type.literal.text) { + collectTypeOrEventApi(packageName, className, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath, param); + } else if (param.type && param.type.types && param.type.types.length > 0) { + collectSpecialSubscriptionTypeApi(param, packageName, className, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath); + } else if (param.type && param.type.typeName && param.type.typeName.escapedText) { + inCurrentTypeListApi(packageName, className, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath, currentTypeList, param); + } else if (param.type && param.type.typeName && param.type.typeName.left && + param.type.typeName.right) { + let methodName = child.name.escapedText + '_' + param.type.typeName.left.escapedText + '_' + + param.type.typeName.right.escapedText; + addFunctionOnOffApi(packageName, className, methodName, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath); + } else { + let methodName = child.name.escapedText; + addFunctionOnOffApi(packageName, className, methodName, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath); + } + break; + } else { + let methodName = child.name.escapedText; + addFunctionOnOffApi(packageName, className, methodName, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath); + } + } +} + +function isCommonSubscriptionType(param) { + return param.name.escapedText === 'type' || param.name.escapedText === 'event' || + param.name.escapedText === 'eventType'; +} + +function collectSpecialSubscriptionTypeApi(param, packageName, className, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath) { + param.type.types.forEach(type => { + if (type.literal && type.literal.text) { + const methodName = child.name.escapedText + "_" + type.literal.text; + addFunctionOnOffApi(packageName, className, methodName, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath); + } + }); +} + +function inCurrentTypeListApi(packageName, className, faterApiInfo, apiType, api, hash, currentClassFunSet, child, + dtsPath, currentTypeList, param) { + if (currentTypeList && currentTypeList.length > 0) { + currentTypeList.forEach(type => { + if (type.name === param.type.typeName.escapedText) { + type.value.forEach(typeString => { + let methodName = child.name.escapedText + "_" + typeString; + addFunctionOnOffApi(packageName, className, methodName, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath); + }); + } + }); + } else { + let methodName = child.name.escapedText; + addFunctionOnOffApi(packageName, className, methodName, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath); + } +} + +function collectTypeOrEventApi(packageName, className, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath, param) { + const typeTextArr = param.getText().replace(/\s*/g, "").split(':'); + if (typeTextArr[0] === "type" || typeTextArr[0] === "event") { + let methodName = child.name.escapedText + '_' + param.type.literal.text; + addFunctionOnOffApi(packageName, className, methodName, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath); + } else { + let methodName = child.name.escapedText + '_' + param.type.literal.text; + addFunctionOnOffApi(packageName, className, methodName, faterApiInfo, apiType, api, + hash, currentClassFunSet, child, dtsPath); + } +} + +function addFunctionOnOffApi(packageName, className, methodName, apiInfo, apiType, api, + hash, currentClassFunSet, childNode, dtsPath) { + // 合并同名函数 + if (currentClassFunSet.has(methodName) && !isNotMerge) { + collectSameNameApiText(api, packageName, className, methodName, childNode); + } else { + notMergeSameNameFun(packageName, className, methodName, apiInfo, apiType, api, + hash, currentClassFunSet, childNode, dtsPath); + } +} + +function collectSameNameApiText(api, packageName, className, methodName, childNode) { + for (let i = 0; i < api.length; i++) { + const curApi = api[i]; + if (curApi.packageName === packageName && curApi.className === className && + curApi.methodName === methodName) { + if (curApi.methodText.indexOf(`${childNode.getText().replace('declare', '').trim()}`) < 0) { + curApi.methodText += `\n${childNode.getText().replace('declare', '').replace(/\r|\n/ig, '').trim()}`; + break; + } + } + } +} + +function notMergeSameNameFun(packageName, className, methodName, apiInfo, apiType, api, + hash, currentClassFunSet, childNode, dtsPath) { + if (!currentClassFunSet.has(methodName)) { + currentClassFunSet.add(methodName); + addApi(packageName, className, methodName, childNode.getText().replace('declare', '').trim(), + getApiInfo(childNode, apiInfo), apiType, api, hash, dtsPath, 6); + } else { + if (childNode.getFullText().indexOf('\/**') >= 0) { + addApi(packageName, className, methodName, childNode.getText().replace('declare', '').trim(), + getApiInfo(childNode, apiInfo), apiType, api, hash, dtsPath, 7); + } else { + let firstApiInfo = {}; + handleSameNameApiJsDoc(api, firstApiInfo, packageName, className, methodName); + addApi(packageName, className, methodName, childNode.getText().replace('declare', '').trim(), + firstApiInfo, apiType, api, hash, dtsPath, 8); + } + } +} + +function handleSameNameApiJsDoc(api, firstApiInfo, packageName, className, methodName) { + for (let i = 0; i < api.length; i++) { + const curApi = api[i]; + if (curApi.packageName === packageName && curApi.className === className && + curApi.methodName === methodName) { + firstApiInfo.isSystemApi = curApi.isSystemApi; + firstApiInfo.version = curApi.version; + firstApiInfo.sysCap = curApi.sysCap; + firstApiInfo.permission = curApi.permission; + firstApiInfo.model = curApi.model; + firstApiInfo.deprecated = curApi.deprecated; + } + } +} + +function getApiInfo(node, apiInfo) { + const notesStr = node.getFullText().replace(node.getText(), ""); + apiInfo.model = getModelInfo(notesStr); + apiInfo.errorCode = getErrorCode(notesStr); + apiInfo.deprecated = getDeprecatedInfo(notesStr); + apiInfo.permission = getPermissionInfo(notesStr); + apiInfo.isSystemApi = getSystemApi(notesStr); + apiInfo.version = getSinceVersion(notesStr); + apiInfo.sysCap = getSyscap(notesStr); + apiInfo.formInfo = isForm(notesStr); + apiInfo.isCrossPlatform = isCrossPlatform(notesStr); + return apiInfo; +} + +function getSystemApi(notesStr) { + let isSystemApi = ''; + if (/\@[S|s][Y|y][S|s][T|t][E|e][M|m][A|a][P|p][I|i]/g.test(notesStr)) { + isSystemApi = '系统API'; + } else { + isSystemApi = '公开API'; + } +} + +function getSinceVersion(notesStr) { + let version; + if (/\@[S|s][I|i][N|n][C|c][E|e]\s*(\d+)/g.test(notesStr)) { + notesStr.replace(/\@[S|s][I|i][N|n][C|c][E|e]\s*(\d+)/g, (versionInfo) => { + version = versionInfo.replace(/\@[S|s][I|i][N|n][C|c][E|e]/g, '').trim(); + }) + } else { + version = 'N/A'; + } + return version; +} + +function getSyscap(notesStr) { + let syscap = ''; + if (/\@[S|s][Y|y][S|s][C|c][A|a][P|p]\s*((\w|\.|\/|\{|\@|\}|\s)+)/g.test(notesStr)) { + notesStr.replace(/\@[S|s][Y|y][S|s][C|c][A|a][P|p]\s*((\w|\.|\/|\{|\@|\}|\s)+)/g, sysCapInfo => { + syscap = sysCapInfo.replace(/\@[S|s][Y|y][S|s][C|c][A|a][P|p]/g, '').trim(); + }) + } + return syscap; +} + +function isForm(notesStr) { + let formInfo = ''; + if (/\@form/g.test(notesStr)) { + formInfo = '是'; + } else { + formInfo = '否'; + } + return formInfo; +} + +function getPermissionInfo(notesStr) { + let permission = '' + if (/\@[P|p][E|e][R|r][M|m][I|i][S|s][S|s][I|i][O|o][N|n]\s*((\w|\.|\/|\{|\@|\}|\s)+)/g.test(notesStr)) { + notesStr.replace(/\@[P|p][E|e][R|r][M|m][I|i][S|s][S|s][I|i][O|o][N|n]\s*((\w|\.|\/|\{|\@|\}|\s)+)/g, + permissionInfo => { + permission = permissionInfo.replace( + /\@[P|p][E|e][R|r][M|m][I|i][S|s][S|s][I|i][O|o][N|n]/g, '').trim(); + return permission; + }) + } else { + permission = 'N/A'; + } + return permission; +} + +function getDeprecatedInfo(notesStr) { + let deprecated = ''; + if (/\@[D|d][E|e][P|p][R|r][E|e][C|c][A|a][T|t][E|e][D|d].*[S|s][I|i][N|n][C|c][E|e]\s*(\d+)/g.test(notesStr)) { + notesStr.replace(/\@[D|d][E|e][P|p][R|r][E|e][C|c][A|a][T|t][E|e][D|d].*[S|s][I|i][N|n][C|c][E|e]\s*(\d+)/g, + deprecatedInfo => { + deprecated = deprecatedInfo.replace( + /\@[D|d][E|e][P|p][R|r][E|e][C|c][A|a][T|t][E|e][D|d].*[S|s][I|i][N|n][C|c][E|e]\s*/g, '').trim(); + + }) + } else { + deprecated = 'N/A'; + } + return deprecated; +} + +function getErrorCode(notesStr) { + let errorCode = ''; + if (/\@throws { BusinessError } \d{2,18}/g.test(notesStr)) { + notesStr.replace(/\@throws { BusinessError } \d{2,18}/g, (code) => { + if (errorCode === '') { + errorCode += `${code.replace(/\@throws { BusinessError } /, '')}`; + } else { + errorCode += `,${code.replace(/\@throws { BusinessError } /, '')}`; + } + }) + } else { + errorCode = 'N/A'; + } + return errorCode; +} + +function getModelInfo(notesStr) { + let model = ''; + if (/\@[F|f][A|a][M|m][O|o][D|d][E|e][L|l][O|o][N|n][L|l][Y|y]/g.test(notesStr)) { + notesStr.replace(/\@[F|f][A|a][M|m][O|o][D|d][E|e][L|l][O|o][N|n][L|l][Y|y]/g, modelInfo => { + model = modelInfo; + }) + } else if (/\@[S|s][T|t][A|a][G|g][E|e][M|m][O|o][D|d][E|e][L|l][O|o][N|n][L|l][Y|y]/g.test(notesStr)) { + notesStr.replace(/\@[S|s][T|t][A|a][G|g][E|e][M|m][O|o][D|d][E|e][L|l][O|o][N|n][L|l][Y|y]/g, modelInfo => { + model = modelInfo; + }) + } else { + model = 'N/A'; + } + return model; +} + +function isCrossPlatform(notesStr) { + let isCrossPlatform = ''; + if (/\@crossplatform/g.test(notesStr)) { + isCrossPlatform = '是'; + } else { + isCrossPlatform = '否'; + } + return isCrossPlatform; +} + +function addApi(packageName, className, methodName, methodText, apiInfo, apiType, api, hash, dtsPath, type) { + let recard = isNotMerge ? `${packageName}.${className}/${methodName}/${methodText}` : + `${packageName}.${className}/${methodName}` + if (!hash.has(recard)) { + hash.add(recard); + api.push({ + packageName: packageName, + className: className, + methodName: methodName, + methodText: methodText.replace(/export\s/g, ""), + isSystemApi: apiInfo.isSystemApi, + version: apiInfo.version, + deprecated: apiInfo.deprecated, + apiType: apiType, + sysCap: apiInfo.sysCap, + permission: apiInfo.permission, + model: apiInfo.model, + dtsPath: dtsPath, + errorCode: apiInfo.errorCode, + formInfo: apiInfo.formInfo, + isCrossPlatform: apiInfo.isCrossPlatform + }) + } +} + +function readFile(dir, utFiles) { + try { + const files = fs.readdirSync(dir); + files.forEach((element) => { + const filePath = path.join(dir, element); + const status = fs.statSync(filePath); + if (status.isDirectory()) { + readFile(filePath, utFiles); + } else { + if (/\.d\.ts/.test(filePath)) { + utFiles.push(filePath) + } + } + }) + } catch (e) { + console.error('ETS ERROR: ' + e); + } +} + +function exportData() { + const dir = path.resolve(__dirname, './API'); + let fileList = []; + readFile(dir, fileList); + let api = parse(fileList); + excel(api); +} + +async function excel(api) { + let buffer = await getExcelBuffer(api) + fs.writeFile('Js_Api.xlsx', buffer, function (err) { + if (err) { + console.error(err); + return; + } + }); +} + +async function getExcelBuffer(api) { + const workbook = new ExcelJS.Workbook(); + const sheet = workbook.addWorksheet('Js Api', { views: [{ xSplit: 1 }] }); + sheet.getRow(1).values = ['模块名', '类名', '方法名', '函数', '类型', 'SysCap', + '权限', '支持起始版本', '访问级别', '是否为卡片', '是否支持跨平台'] + for (let i = 1; i <= api.length; i++) { + const apiData = api[i - 1]; + sheet.getRow(i + 1).values = [apiData.packageName, apiData.className, apiData.methodName, + apiData.methodText, apiData.apiType, apiData.sysCap, apiData.permission, + apiData.version, apiData.isSystemApi, apiData.formInfo, apiData.isCrossPlatform] + } + const buffer = await workbook.xlsx.writeBuffer(); + return buffer; +} + +exportData(); \ No newline at end of file diff --git a/build-tools/collect_api/package.json b/build-tools/collect_api/package.json new file mode 100644 index 000000000..232b3a08d --- /dev/null +++ b/build-tools/collect_api/package.json @@ -0,0 +1,20 @@ +{ + "name": "test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "collect": "node collect_base_api.js" + }, + "author": "", + "license": "ISC", + "dependencies": { + "exceljs": "^4.3.0", + "fs": "0.0.1-security", + "path": "^0.12.7", + "typescript": "^4.8.2" + }, + "devDependencies": { + "@types/node": "^18.11.9" + } +} From 48ab799dbdb6095f515a7ff28421a8d466e4086a Mon Sep 17 00:00:00 2001 From: SubmarinePhantom Date: Sat, 13 May 2023 11:19:57 +0800 Subject: [PATCH 05/21] =?UTF-8?q?js=20doc=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SubmarinePhantom --- api/@ohos.telephony.call.d.ts | 2793 +++++++++++++++++++++++------ api/@ohos.telephony.data.d.ts | 345 +++- api/@ohos.telephony.observer.d.ts | 556 ++++-- api/@ohos.telephony.radio.d.ts | 2261 ++++++++++++++++++++--- api/@ohos.telephony.sim.d.ts | 2422 ++++++++++++++++++++----- api/@ohos.telephony.sms.d.ts | 2278 +++++++++++++++++++++-- 6 files changed, 9022 insertions(+), 1633 deletions(-) diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 9dbea78ea..72bc068b5 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -18,38 +18,75 @@ import { AsyncCallback, Callback } from "./@ohos.base"; /** * Provides methods related to call management. * - * @since 6 + * @namespace call * @syscap SystemCapability.Telephony.CallManager + * @since 6 */ declare namespace call { /** * Makes a call. * - * @param phoneNumber Indicates the called number. - * @param options Indicates additional information carried in the call. - * @param callback Returns {@code true} if the call request is successful; returns {@code false} otherwise. + * @permission ohos.permission.PLACE_CALL + * @param { string } phoneNumber - Indicates the called number. + * @param { AsyncCallback } callback - Indicates the callback for getting the result of the call. + * Returns {@code true} if the call request is successful; returns {@code false} otherwise. * Note that the value {@code true} indicates only the successful processing of the request; it does not mean * that the call is or can be connected. - * @permission ohos.permission.PLACE_CALL + * @syscap SystemCapability.Telephony.CallManager + * @since 6 * @deprecated since 9 * @useinstead telephony.call#dialCall */ function dial(phoneNumber: string, callback: AsyncCallback): void; + + /** + * Makes a call. + * + * @permission ohos.permission.PLACE_CALL + * @param { string } phoneNumber - Indicates the called number. + * @param { DialOptions } options - Indicates additional information carried in the call. + * @param { AsyncCallback } callback - Indicates the callback for getting the result of the call. + * Returns {@code true} if the call request is successful; returns {@code false} otherwise. + * Note that the value {@code true} indicates only the successful processing of the request; it does not mean + * that the call is or can be connected. + * @syscap SystemCapability.Telephony.CallManager + * @since 6 + * @deprecated since 9 + * @useinstead telephony.call#dialCall + */ function dial(phoneNumber: string, options: DialOptions, callback: AsyncCallback): void; + + /** + * Makes a call. + * + * @permission ohos.permission.PLACE_CALL + * @param { string } phoneNumber - Indicates the called number. + * @param { DialOptions } options - Indicates additional information carried in the call. + * @returns { Promise } Returns the result of the call. + * Returns {@code true} if the call request is successful; returns {@code false} otherwise. + * Note that the value {@code true} indicates only the successful processing of the request; it does not mean + * that the call is or can be connected. + * @syscap SystemCapability.Telephony.CallManager + * @since 6 + * @deprecated since 9 + * @useinstead telephony.call#dialCall + */ function dial(phoneNumber: string, options?: DialOptions): Promise; /** * Makes a call. * * @permission ohos.permission.PLACE_CALL - * @param phoneNumber Indicates the called number. - * @param callback - the callback of dialCall. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } phoneNumber - Indicates the called number. + * @param { AsyncCallback } callback - The callback of dialCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -59,15 +96,17 @@ declare namespace call { * Makes a call. * * @permission ohos.permission.PLACE_CALL - * @param phoneNumber Indicates the called number. - * @param options Indicates additional information carried in the call. - * @param callback - the callback of dialCall. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } phoneNumber - Indicates the called number. + * @param { DialCallOptions } options - Indicates additional information carried in the call. + * @param { AsyncCallback } callback - The callback of dialCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -77,15 +116,17 @@ declare namespace call { * Makes a call. * * @permission ohos.permission.PLACE_CALL - * @param phoneNumber Indicates the called number. - * @param options Indicates additional information carried in the call. - * @returns { void | Promise } No callback return Promise otherwise return void. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } phoneNumber - Indicates the called number. + * @param { DialCallOptions } options - Indicates additional information carried in the call. + * @returns { Promise } The promise returned by the dialCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -94,25 +135,51 @@ declare namespace call { /** * Go to the dial screen and the called number is displayed. * - * @param phoneNumber Indicates the called number. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } phoneNumber - Indicates the called number. + * @param { AsyncCallback } callback - The callback of makeCall. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. * @syscap SystemCapability.Applications.Contacts * @since 7 */ function makeCall(phoneNumber: string, callback: AsyncCallback): void; + + /** + * Go to the dial screen and the called number is displayed. + * + * @param { string } phoneNumber - Indicates the called number. + * @returns { Promise } The promise returned by the makeCall. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Applications.Contacts + * @since 7 + */ function makeCall(phoneNumber: string): Promise; /** * Checks whether a call is ongoing. * - * @param callback Returns {@code true} if at least one call is not in the {@link CallState#CALL_STATE_IDLE} - * state; returns {@code false} otherwise. + * @param { AsyncCallback } callback - The callback of hasCall. Returns {@code true} if at least one call is + * not in the {@link CallState#CALL_STATE_IDLE} state; returns {@code false} otherwise. + * @syscap SystemCapability.Telephony.CallManager + * @since 6 */ function hasCall(callback: AsyncCallback): void; + + /** + * Checks whether a call is ongoing. + * + * @returns { Promise } Returns {@code true} if at least one call is not + * in the {@link CallState#CALL_STATE_IDLE} state; returns {@code false} otherwise. + * @syscap SystemCapability.Telephony.CallManager + * @since 6 + */ function hasCall(): Promise; /** @@ -123,9 +190,24 @@ declare namespace call { * {@code CallState#CALL_STATE_OFFHOOK}. * In other cases, the system returns {@code CallState#CALL_STATE_IDLE}. * - * @param callback Returns the call state. + * @param { AsyncCallback } callback - Indicates the callback for getting the call state. + * @syscap SystemCapability.Telephony.CallManager + * @since 6 */ function getCallState(callback: AsyncCallback): void; + + /** + * Obtains the call state. + * + *

If an incoming call is ringing or waiting, the system returns {@code CallState#CALL_STATE_RINGING}. + * If at least one call is in the active, hold, or dialing state, the system returns + * {@code CallState#CALL_STATE_OFFHOOK}. + * In other cases, the system returns {@code CallState#CALL_STATE_IDLE}. + * + * @returns { Promise } Returns the call state. + * @syscap SystemCapability.Telephony.CallManager + * @since 6 + */ function getCallState(): Promise; /** @@ -134,16 +216,36 @@ declare namespace call { *

If an incoming call is ringing, the phone stops ringing. Otherwise, this method does not function. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of muteRinger. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function muteRinger(callback: AsyncCallback): void; + + /** + * Stops the ringtone. + * + *

If an incoming call is ringing, the phone stops ringing. Otherwise, this method does not function. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @returns { Promise } The promise returned by the muteRinger. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function muteRinger(): Promise; /** @@ -153,7 +255,8 @@ 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. * - * @returns Returns {@code true} if the device supports voice calls; returns {@code false} otherwise. + * @returns { boolean } Returns {@code true} if the device supports voice calls; returns {@code false} otherwise. + * @syscap SystemCapability.Telephony.CallManager * @since 7 */ function hasVoiceCapability(): boolean; @@ -161,18 +264,51 @@ declare namespace call { /** * Checks whether a phone number is on the emergency number list. * - * @param phoneNumber Indicates the phone number to check. - * @param callback Returns {@code true} if the phone number is on the emergency number list; - * returns {@code false} otherwise. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } phoneNumber - Indicates the phone number to check. + * @param { AsyncCallback } callback - Indicates the callback for isEmergencyPhoneNumber. + * Returns {@code true} if the phone number is on the emergency number list. Returns {@code false} otherwise. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @since 7 */ function isEmergencyPhoneNumber(phoneNumber: string, callback: AsyncCallback): void; + + /** + * Checks whether a phone number is on the emergency number list. + * + * @param { string } phoneNumber - Indicates the phone number to check. + * @param { EmergencyNumberOptions } options - Indicates the additional information for emergency numbers. + * @param { AsyncCallback } callback - Indicates the callback for isEmergencyPhoneNumber. + * Returns {@code true} if the phone number is on the emergency number list. Returns {@code false} otherwise. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @since 7 + */ function isEmergencyPhoneNumber(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback): void; + + /** + * Checks whether a phone number is on the emergency number list. + * + * @param { string } phoneNumber - Indicates the phone number to check. + * @param { EmergencyNumberOptions } options - Indicates the additional information for emergency numbers. + * @returns { Promise } Returns {@code true} if the phone number is on the emergency number list. + * Returns {@code false} otherwise. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @since 7 + */ function isEmergencyPhoneNumber(phoneNumber: string, options?: EmergencyNumberOptions): Promise; /** @@ -181,47 +317,106 @@ declare namespace call { * + 4-digit area code + 4-digit subscriber number. After the formatting, * each part is separated by a space. * - * @param phoneNumber Indicates the phone number to format. - * @param options countryCode option - * @param callback Returns the phone number after being formatted; returns an empty string if the input phone number is invalid. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } phoneNumber - Indicates the phone number to format. + * @param { AsyncCallback } callback - Indicates the callback to obtain a formatted phone number. + * Returns an empty string if the input phone number is invalid. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @since 7 */ function formatPhoneNumber(phoneNumber: string, callback: AsyncCallback): void; + + /** + * Formats a phone number according to the Chinese Telephone Code Plan. Before the formatting, + * a phone number is in the format of country code (if any) + 3-digit service provider code + * + 4-digit area code + 4-digit subscriber number. After the formatting, + * each part is separated by a space. + * + * @param { string } phoneNumber - Indicates the phone number to format. + * @param { NumberFormatOptions } options - Indicates the country code option. + * @param { AsyncCallback } callback - Indicates the callback to obtain a formatted phone number. + * Returns an empty string if the input phone number is invalid. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @since 7 + */ function formatPhoneNumber(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback): void; + + /** + * Formats a phone number according to the Chinese Telephone Code Plan. Before the formatting, + * a phone number is in the format of country code (if any) + 3-digit service provider code + * + 4-digit area code + 4-digit subscriber number. After the formatting, + * each part is separated by a space. + * + * @param { string } phoneNumber - Indicates the phone number to format. + * @param { NumberFormatOptions } options - Indicates the country code option. + * @returns { Promise } Returns the phone number after being formatted. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @since 7 + */ function formatPhoneNumber(phoneNumber: string, options?: NumberFormatOptions): Promise; /** * Formats a phone number into an E.164 representation. * - * @param phoneNumber Indicates the phone number to format. - * @param countryCode Indicates a two-digit country code defined in ISO 3166-1. - * @param callback Returns an E.164 number; returns an empty string if the input phone number is invalid. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } phoneNumber - Indicates the phone number to format. + * @param { string } countryCode - Indicates a two-digit country code defined in ISO 3166-1. + * @param { AsyncCallback } callback - Returns an E.164 number. + * Returns an empty string if the input phone number is invalid. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @since 7 */ function formatPhoneNumberToE164(phoneNumber: string, countryCode: string, callback: AsyncCallback): void; + + /** + * Formats a phone number into an E.164 representation. + * + * @param { string } phoneNumber - Indicates the phone number to format. + * @param { string } countryCode - Indicates a two-digit country code defined in ISO 3166-1. + * @returns { Promise } Returns an E.164 number. + * Returns an empty string if the input phone number is invalid. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @since 7 + */ function formatPhoneNumberToE164(phoneNumber: string, countryCode: string): Promise; /** * Answers the incoming call. * - * @param callId Indicates the identifier of the call to answer. * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } callId - Indicates the identifier of the call to answer. + * @param { AsyncCallback } callback - The callback of answerCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -230,14 +425,17 @@ declare namespace call { /** * Answers the incoming call. * - * @param callId Indicates the identifier of the call to answer. * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } callId - Indicates the identifier of the call to answer. + * @returns { Promise } The promise returned by the answerCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -247,12 +445,15 @@ declare namespace call { * Answers the incoming call without callId. * * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of answerCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -261,14 +462,17 @@ declare namespace call { /** * Hang up the foreground call. * - * @param callId Indicates the identifier of the call to hangup. * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } callId - Indicates the identifier of the call to hangup. + * @param { AsyncCallback } callback - The callback of hangUpCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -277,14 +481,17 @@ declare namespace call { /** * Hang up the foreground call. * - * @param callId Indicates the identifier of the call to hangup. * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } callId - Indicates the identifier of the call to hangup. + * @returns { Promise } The promise returned by the hangUpCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -294,12 +501,15 @@ declare namespace call { * Hang up the foreground call without callId. * * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of hangUpCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -308,65 +518,75 @@ declare namespace call { /** * Reject the incoming call. * - * @param callId Indicates the identifier of the call to reject. - * @param options Indicates the text message to reject. * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } callId - Indicates the identifier of the call to reject. + * @param { AsyncCallback } callback - The callback of rejectCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ function rejectCall(callId: number, callback: AsyncCallback): void; /** - * Reject the incoming call. - * - * @param callId Indicates the identifier of the call to reject. - * @param options Indicates the text message to reject. - * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. - * @systemapi Hide this for inner system use. - * @since 9 - */ + * Reject the incoming call. + * + * @permission ohos.permission.ANSWER_CALL + * @param { number } callId - Indicates the identifier of the call to reject. + * @param { RejectMessageOptions } options - Indicates the text message to reject. + * @param { AsyncCallback } callback - The callback of rejectCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 9 + */ function rejectCall(callId: number, options: RejectMessageOptions, callback: AsyncCallback): void; /** - * Reject the incoming call. - * - * @param callId Indicates the identifier of the call to reject. - * @param options Indicates the text message to reject. - * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. - * @systemapi Hide this for inner system use. - * @since 9 - */ + * Reject the incoming call. + * + * @permission ohos.permission.ANSWER_CALL + * @param { number } callId - Indicates the identifier of the call to reject. + * @param { RejectMessageOptions } options - Indicates the text message to reject. + * @returns { Promise } The promise returned by the rejectCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 9 + */ function rejectCall(callId?: number, options?: RejectMessageOptions): Promise; /** * Reject the incoming call without callId. * - * @param options Indicates the text message to reject. * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of rejectCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -375,14 +595,17 @@ declare namespace call { /** * Reject the incoming call without callId. * - * @param options Indicates the text message to reject. * @permission ohos.permission.ANSWER_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { RejectMessageOptions } options - Indicates the text message to reject. + * @param { AsyncCallback } callback - The callback of rejectCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -392,212 +615,454 @@ declare namespace call { * Keep a call on hold. * * @permission ohos.permission.ANSWER_CALL - * @param callId Indicates the identifier of the call. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } callId - Indicates the identifier of the call. + * @param { AsyncCallback } callback - The callback of holdCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function holdCall(callId: number, callback: AsyncCallback): void; + + /** + * Keep a call on hold. + * + * @permission ohos.permission.ANSWER_CALL + * @param { number } callId - Indicates the identifier of the call. + * @returns { Promise } The promise returned by the holdCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function holdCall(callId: number): Promise; /** * Cancel call hold status. * * @permission ohos.permission.ANSWER_CALL - * @param callId Indicates the identifier of the call. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } callId - Indicates the identifier of the call. + * @param { AsyncCallback } callback - The callback of unHoldCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function unHoldCall(callId: number, callback: AsyncCallback): void; + + /** + * Keep a call on hold. + * + * @permission ohos.permission.ANSWER_CALL + * @param { number } callId - Indicates the identifier of the call. + * @returns { Promise } The promise returned by the unHoldCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function unHoldCall(callId: number): Promise; /** * Switch call. * * @permission ohos.permission.ANSWER_CALL - * @param callId Indicates the identifier of the call. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } callId - Indicates the identifier of the call. + * @param { AsyncCallback } callback - The callback of switchCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function switchCall(callId: number, callback: AsyncCallback): void; + + /** + * Switch call. + * + * @permission ohos.permission.ANSWER_CALL + * @param { number } callId - Indicates the identifier of the call. + * @returns { Promise } The promise returned by the switchCall. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function switchCall(callId: number): Promise; /** * Merge calls, merge two calls into conference calls. * - * @param callId Indicates the identifier of the call. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { number } callId - Indicates the identifier of the call. + * @param { AsyncCallback } callback - The callback of combineConference. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function combineConference(callId: number, callback: AsyncCallback): void; + + /** + * Merge calls, merge two calls into conference calls. + * + * @param { number } callId - Indicates the identifier of the call. + * @returns { Promise } The promise returned by the combineConference. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function combineConference(callId: number): Promise; /** * Get the main call Id. * - * @param callId Indicates the identifier of the call. - * @returns Returns the main call id. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { number } callId - Indicates the identifier of the call. + * @param { AsyncCallback } callback - Indicates the callback for getting the main call id. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function getMainCallId(callId: number, callback: AsyncCallback): void; + + /** + * Get the main call Id. + * + * @param { number } callId - Indicates the identifier of the call. + * @returns { Promise } Returns the main call id. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function getMainCallId(callId: number): Promise; /** * Get the list of sub-call Ids. * - * @param callId Indicates the identifier of the call. - * @returns Returns the list of sub call ids. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { number } callId - Indicates the identifier of the call. + * @param { AsyncCallback> } callback - Indicates the callback for getting the list of sub call ids. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function getSubCallIdList(callId: number, callback: AsyncCallback>): void; + + /** + * Get the list of sub-call Ids. + * + * @param { number } callId - Indicates the identifier of the call. + * @returns { Promise> } Returns the list of sub call ids. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function getSubCallIdList(callId: number): Promise>; /** * Get the call Id list of the conference. * - * @param callId Indicates the identifier of the call. - * @param callback Returns the call id list of conference calls. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { number } callId - Indicates the identifier of the call. + * @param { AsyncCallback> } callback - Indicates the callback for getting + * the call id list of conference calls. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function getCallIdListForConference(callId: number, callback: AsyncCallback>): void; + + /** + * Get the call Id list of the conference. + * + * @param { number } callId - Indicates the identifier of the call. + * @returns { Promise> } Returns the call id list of conference calls. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function getCallIdListForConference(callId: number): Promise>; /** * Get call waiting status. * * @permission ohos.permission.GET_TELEPHONY_STATE - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns call waiting status. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { AsyncCallback } callback - Indicates the callback for getting the call waiting status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function getCallWaitingStatus(slotId: number, callback: AsyncCallback): void; + + /** + * Get call waiting status. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the callback for getting the call waiting status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function getCallWaitingStatus(slotId: number): Promise; /** * Set call waiting. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param activate Indicates whether to activate or call wait. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { boolean } activate - Indicates whether to activate or call wait. + * @param { AsyncCallback } callback - The callback of setCallWaiting. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function setCallWaiting(slotId: number, activate: boolean, callback: AsyncCallback): void; + + /** + * Set call waiting. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { boolean } activate - Indicates whether to activate or call wait. + * @returns { Promise } The promise returned by the setCallWaiting. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function setCallWaiting(slotId: number, activate: boolean): Promise; /** * Start DTMF(Dual Tone Multi Frequency). * - * @param callId Indicates the identifier of the call. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { number } callId - Indicates the identifier of the call. + * @param { string } character - Indicates the characters sent. + * @param { AsyncCallback } callback - The callback of startDTMF. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function startDTMF(callId: number, character: string, callback: AsyncCallback): void; + + /** + * Start DTMF(Dual Tone Multi Frequency). + * + * @param { number } callId - Indicates the identifier of the call. + * @param { string } character - Indicates the characters sent. + * @returns { Promise } The promise returned by the startDTMF. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function startDTMF(callId: number, character: string): Promise; /** * Stop DTMF(Dual Tone Multi Frequency). * - * @param callId Indicates the identifier of the call. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { number } callId - Indicates the identifier of the call. + * @param { AsyncCallback } callback - The callback of stopDTMF. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function stopDTMF(callId: number, callback: AsyncCallback): void; + + /** + * Stop DTMF(Dual Tone Multi Frequency). + * + * @param { number } callId - Indicates the identifier of the call. + * @returns { Promise } The promise returned by the stopDTMF. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function stopDTMF(callId: number): Promise; /** * Judge whether the emergency call is in progress. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param callback Returns {@code true} if the call is in emergency; returns {@code false} otherwise. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of isInEmergencyCall. + * Returns {@code true} if the call is in emergency; returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ function isInEmergencyCall(callback: AsyncCallback): void; + + /** + * Judge whether the emergency call is in progress. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @returns { Promise } Returns {@code true} if the call is in emergency; returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ function isInEmergencyCall(): Promise; /** * Subscribe to the callDetailsChange event. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param callback Return the result of call details. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - callDetailsChange. + * @param { Callback } callback - Indicates the callback for getting the result of call details. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ @@ -607,13 +1072,17 @@ declare namespace call { * Unsubscribe from the callDetailsChange event. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param callback Cancel call details registration. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - callDetailsChange. + * @param { Callback } callback - Indicates the callback to unsubscribe from + * the callDetailsChange event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ @@ -623,13 +1092,16 @@ declare namespace call { * Subscribe to the callEventChange event. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param callback Return the call event id. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - callEventChange. + * @param { Callback } callback - Indicates the callback for getting the call event id. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -639,13 +1111,16 @@ declare namespace call { * Unsubscribe from the callEventChange event. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param callback Cancel call event registration. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - callEventChange. + * @param { Callback } callback - Indicates the callback to unsubscribe from the callEventChange event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -655,13 +1130,16 @@ declare namespace call { * Subscribe to the callDisconnectedCause event. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param callback Return the call disconnection reason. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - callDisconnectedCause. + * @param { Callback } callback - Indicates the callback for getting the call disconnection reason. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -671,13 +1149,17 @@ declare namespace call { * Unsubscribe from the callDisconnectedCause event. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param callback Cancel the call disconnection reason registration. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - callDisconnectedCause. + * @param { Callback } callback - Indicates the callback used to cancel + * the registration monitoring for obtaining the call end reason. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -686,15 +1168,17 @@ declare namespace call { /** * Subscribe to the mmiCodeResult event. * - * @param type Indicates the observer type. - * @param callback Return the result of MMI code. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - mmiCodeResult. + * @param { Callback } callback - Indicates the callback for getting the result of MMI code. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -703,15 +1187,17 @@ declare namespace call { /** * Unsubscribe from the mmiCodeResult event. * - * @param type Indicates the observer type. - * @param callback Return the result of MMI code. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - mmiCodeResult. + * @param { Callback } callback - Indicates the callback used to cancel getting mmicode registered listening. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -756,166 +1242,344 @@ declare namespace call { /** * Judge whether to allow another new call. * - * @param callback Returns {@code true} If the device currently allows new calls; returns {@code false} otherwise. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of isNewCallAllowed. Returns {@code true} if + * the device currently allows new calls; returns {@code false} otherwise. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function isNewCallAllowed(callback: AsyncCallback): void; + + /** + * Judge whether to allow another new call. + * + * @returns { Promise } Returns {@code true} If the device currently allows new calls. + * Returns {@code false} otherwise. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function isNewCallAllowed(): Promise; /** * Split conference call. * - * @param callId Indicates the identifier of the call. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } callId - Indicates the identifier of the call. + * @param { AsyncCallback } callback - The callback of separateConference. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function separateConference(callId: number, callback: AsyncCallback): void; + + /** + * Split conference call. + * + * @param { number } callId - Indicates the identifier of the call. + * @returns { Promise } The promise returned by the separateConference. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function separateConference(callId: number): Promise; /** * Get call barring status. * * @permission ohos.permission.GET_TELEPHONY_STATE - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param type Indicates which type of call restriction to obtain. - * @param callback Returns call restriction status. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { CallRestrictionType } type - Indicates which type of call restriction to obtain. + * @param { AsyncCallback } callback - Indicates the callback for getting the call restriction status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function getCallRestrictionStatus(slotId: number, type: CallRestrictionType, callback: AsyncCallback): void; + + /** + * Get call barring status. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { CallRestrictionType } type - Indicates which type of call restriction to obtain. + * @returns { Promise } Returns the call restriction status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function getCallRestrictionStatus(slotId: number, type: CallRestrictionType): Promise; /** * Set call barring status. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param info Indicates the set call restriction information. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { CallRestrictionInfo } info - Indicates the set call restriction information. + * @param { AsyncCallback } callback - The callback of setCallRestriction. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function setCallRestriction(slotId: number, info: CallRestrictionInfo, callback: AsyncCallback): void; + + /** + * Set call barring status. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { CallRestrictionInfo } info - Indicates the set call restriction information. + * @returns { Promise } The promise returned by the setCallRestriction. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function setCallRestriction(slotId: number, info: CallRestrictionInfo): Promise; /** * Get call forwarding information. * * @permission ohos.permission.GET_TELEPHONY_STATE - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param type Indicates which type of call forwarding to obtain. - * @param callback Returns call forwarding status. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { CallTransferType } type - Indicates which type of call forwarding to obtain. + * @param { AsyncCallback } callback - Indicates the callback for getting the call forwarding status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function getCallTransferInfo(slotId: number, type: CallTransferType, callback: AsyncCallback): void; + + /** + * Get call forwarding information. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { CallTransferType } type - Indicates which type of call forwarding to obtain. + * @returns { Promise } Returns the call forwarding status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function getCallTransferInfo(slotId: number, type: CallTransferType): Promise; /** * Set call forwarding information. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param info Indicates the set call forwarding information. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. + * @param { CallTransferInfo } info - Indicates the set call forwarding information. + * @param { AsyncCallback } callback - The callback of setCallTransfer. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function setCallTransfer(slotId: number, info: CallTransferInfo, callback: AsyncCallback): void; + + /** + * Set call forwarding information. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { CallTransferInfo } info - Indicates the set call forwarding information. + * @returns { Promise } The promise returned by the setCallTransfer. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function setCallTransfer(slotId: number, info: CallTransferInfo): Promise; /** - * Judge whether the bell is ringing. + * Judge whether there is a ringing call. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param callback Returns {@code true} if the device is ringing; returns {@code false} otherwise. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of isRinging. + * Returns {@code true} if the device is ringing; returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function isRinging(callback: AsyncCallback): void; + + /** + * Judge whether there is a ringing call. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @returns { Promise } Returns {@code true} if the device is ringing; returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function isRinging(): Promise; /** * Set mute during a call. * - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of setMuted. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function setMuted(callback: AsyncCallback): void; + + /** + * Set mute during a call. + * + * @returns { Promise } The promise returned by the setMuted. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function setMuted(): Promise; /** * Unmute during a call. * - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of cancelMuted. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function cancelMuted(callback: AsyncCallback): void; + + /** + * Unmute during a call. + * + * @returns { Promise } The promise returned by the cancelMuted. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function cancelMuted(): Promise; /** * Set the audio device. * - * @param device Indicates the device of audio. - * @param callback Returns {@code true} if the request is successful; returns {@code false} otherwise. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AudioDevice } device - Indicates the device of audio. + * @param { AsyncCallback } callback - The callback of setAudioDevice. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -941,103 +1605,226 @@ declare namespace call { /** * Set the audio device with options. * - * @param device Indicates the device of audio. - * @param options Indicates additional information, such as address of bluetooth. - * @param callback Returns {@code true} if the request is successful; returns {@code false} otherwise. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AudioDevice } device - Indicates the device of audio. + * @param { AudioDeviceOptions } options - Indicates additional information, such as address of bluetooth. + * @param { AsyncCallback } callback - The callback of setAudioDevice. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ function setAudioDevice(device: AudioDevice, options: AudioDeviceOptions, callback: AsyncCallback): void; + + /** + * Set the audio device with options. + * + * @param { AudioDevice } device - Indicates the device of audio. + * @param { AudioDeviceOptions } options - Indicates additional information, such as address of bluetooth. + * @returns { Promise } The promise returned by the setAudioDevice. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 9 + */ function setAudioDevice(device: AudioDevice, options?: AudioDeviceOptions): Promise; /** * Join the conference call. * - * @param mainCallId Indicates the identifier of the main call. - * @param callNumberList Indicates a call list. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } mainCallId - Indicates the identifier of the main call. + * @param { Array } callNumberList - Indicates a call list. + * @param { AsyncCallback } callback - The callback of joinConference. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function joinConference(mainCallId: number, callNumberList: Array, callback: AsyncCallback): void; + + /** + * Join the conference call. + * + * @param { number } mainCallId - Indicates the identifier of the main call. + * @param { Array } callNumberList - Indicates a call list. + * @returns { Promise } The promise returned by the joinConference. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function joinConference(mainCallId: number, callNumberList: Array): Promise; /** * Update Ims call mode. * - * @param callId Indicates the identifier of the call. - * @param mode Indicates the mode of the ims call. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } callId - Indicates the identifier of the call. + * @param { ImsCallMode } mode - Indicates the mode of the ims call. + * @param { AsyncCallback } callback - The callback of updateImsCallMode. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function updateImsCallMode(callId: number, mode: ImsCallMode, callback: AsyncCallback): void; + + /** + * Update Ims call mode. + * + * @param { number } callId - Indicates the identifier of the call. + * @param { ImsCallMode } mode - Indicates the mode of the ims call. + * @returns { Promise } The promise returned by the updateImsCallMode. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function updateImsCallMode(callId: number, mode: ImsCallMode): Promise; /** * Turn on Ims switch. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param slotId Indicates the card slot index number, + * @param { number } 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} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of enableImsSwitch. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function enableImsSwitch(slotId: number, callback: AsyncCallback): void; + + /** + * Turn on Ims switch. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @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 } The promise returned by the enableImsSwitch. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function enableImsSwitch(slotId: number): Promise; /** * Turn off Ims switch. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param slotId Indicates the card slot index number, + * @param { number } 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} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of disableImsSwitch. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function disableImsSwitch(slotId: number, callback: AsyncCallback): void; + + /** + * Turn off Ims switch. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @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 } The promise returned by the disableImsSwitch. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function disableImsSwitch(slotId: number): Promise; /** * Judge whether the Ims switch is enabled. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns {@code true} If the ims switch is on; returns {@code false} otherwise. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of isImsSwitchEnabled. + * Returns {@code true} If the ims switch is on; returns {@code false} otherwise. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ function isImsSwitchEnabled(slotId: number, callback: AsyncCallback): void; + + /** + * Judge whether the Ims switch is enabled. + * + * @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 } Returns {@code true} If the ims switch is on; returns {@code false} otherwise. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ function isImsSwitchEnabled(slotId: number): Promise; /** @@ -1240,14 +2027,57 @@ declare namespace call { * @since 8 */ export enum ImsCallMode { + /** + * Indicates audio only calls. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_MODE_AUDIO_ONLY = 0, + + /** + * Indicates that only calls are sent. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_MODE_SEND_ONLY, + + /** + * Indicates receiving only calls. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_MODE_RECEIVE_ONLY, + + /** + * Indicates permission to send and receive calls. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_MODE_SEND_RECEIVE, + + /** + * Indicates a pause in video calls. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_MODE_VIDEO_PAUSED, } /** + * Indicates the device of audio. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1262,14 +2092,57 @@ declare namespace call { * @since 8 */ export enum AudioDevice { + /** + * Indicates device earpiece. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ DEVICE_EARPIECE, + + /** + * Indicator device speaker. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ DEVICE_SPEAKER, + + /** + * Indicates a wired headset device. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ DEVICE_WIRED_HEADSET, + + /** + * Indicates a Bluetooth device. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ DEVICE_BLUETOOTH_SCO, + + /** + * Indicates a microphone device. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ DEVICE_MIC, } /** + * Indicates the type of call restriction. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1302,17 +2175,84 @@ declare namespace call { * @since 8 */ export enum CallRestrictionType { + /** + * Indicates restrict all incoming calls. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ RESTRICTION_TYPE_ALL_INCOMING = 0, + + /** + * Indicates restrict all outgoing calls. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ RESTRICTION_TYPE_ALL_OUTGOING, + + /** + * Indicates restrict international calls. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ RESTRICTION_TYPE_INTERNATIONAL, + + /** + * Indicates restrict international roaming calls. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ RESTRICTION_TYPE_INTERNATIONAL_EXCLUDING_HOME, + + /** + * Indicates restrict roaming calls. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ RESTRICTION_TYPE_ROAMING_INCOMING, + + /** + * Indicates restrict all calls. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ RESTRICTION_TYPE_ALL_CALLS, + + /** + * Indicates restrict all outgoing services. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ RESTRICTION_TYPE_OUTGOING_SERVICES, + + /** + * Indicates restrict all incoming services. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ RESTRICTION_TYPE_INCOMING_SERVICES, } /** + * Indicates the information of call transfer. + * + * @interface CallTransferInfo + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -1320,6 +2260,9 @@ declare namespace call { /** * Phone number. * + * @type { string } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ transferNum: string; @@ -1327,6 +2270,9 @@ declare namespace call { /** * Call forwarding type. * + * @type { CallTransferType } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ type: CallTransferType; @@ -1334,6 +2280,9 @@ declare namespace call { /** * Call forwarding setting type. * + * @type { CallTransferSettingType } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ settingType: CallTransferSettingType; @@ -1341,6 +2290,9 @@ declare namespace call { /** * Start time hours. * + * @type { ?number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ startHour?: number; @@ -1348,6 +2300,9 @@ declare namespace call { /** * Start time minutes. * + * @type { ?number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ startMinute?: number; @@ -1355,6 +2310,9 @@ declare namespace call { /** * End time hours. * + * @type { ?number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ endHour?: number; @@ -1362,287 +2320,858 @@ declare namespace call { /** * End time minutes. * + * @type { ?number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ endMinute?: number; } /** + * Indicates the type of call transfer. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ export enum CallTransferType { + /** + * Indicates transfer the call unconditionally. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ TRANSFER_TYPE_UNCONDITIONAL = 0, + + /** + * Indicates transfer the call when busy. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ TRANSFER_TYPE_BUSY, + + /** + * Indicates transfer the call when no reply. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ TRANSFER_TYPE_NO_REPLY, + + /** + * Indicates transfer the call when unreachable. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ TRANSFER_TYPE_NOT_REACHABLE, } /** + * Indicates the type of call transfer setting. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ export enum CallTransferSettingType { + /** + * Indicates disable the call transfer. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_TRANSFER_DISABLE = 0, + + /** + * Indicates enable the call transfer. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_TRANSFER_ENABLE = 1, + + /** + * Indicates register the call transfer. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_TRANSFER_REGISTRATION = 3, + + /** + * Indicates erasure the call transfer. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_TRANSFER_ERASURE = 4, } /** + * Indicates the options of call attribute. + * + * @interface CallAttributeOptions + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ export interface CallAttributeOptions { + /** + * Indicates the number of account. + * + * @type { string } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ accountNumber: string; + + /** + * Indicates if the call is start with speaker. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ speakerphoneOn: boolean; + + /** + * Indicates the id of account. + * + * @type { number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ accountId: number; + + /** + * Indicates the type of video state. + * + * @type { VideoStateType } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ videoState: VideoStateType; + + /** + * Indicates the start time. + * + * @type { number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ startTime: number; + + /** + * Indicates if this is an emergency call. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ isEcc: boolean; + + /** + * Indicates the type of call. + * + * @type { CallType } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ callType: CallType; + + /** + * Indicates the id of call. + * + * @type { number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ callId: number; + + /** + * Indicates the detailed state of call. + * + * @type { DetailedCallState } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ callState: DetailedCallState; + + /** + * Indicates the state of conference. + * + * @type { ConferenceState } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ conferenceState: ConferenceState; } /** + * Indicates the state of conference call. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ export enum ConferenceState { + /** + * Indicates the state is idle. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ TEL_CONFERENCE_IDLE = 0, + + /** + * Indicates the state is active. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ TEL_CONFERENCE_ACTIVE, + + /** + * Indicates the state is disconnecting. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ TEL_CONFERENCE_DISCONNECTING, + + /** + * Indicates the state is disconnected. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ TEL_CONFERENCE_DISCONNECTED, } /** + * Indicates the type of call. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ export enum CallType { - TYPE_CS = 0, // CS - TYPE_IMS = 1, // IMS - TYPE_OTT = 2, // OTT - TYPE_ERR_CALL = 3, // OTHER + /** + * Indicates the call type is CS. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ + TYPE_CS = 0, + + /** + * Indicates the call type is IMS. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ + TYPE_IMS = 1, + + /** + * Indicates the call type is OTT. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ + TYPE_OTT = 2, + + /** + * Indicates the call type is OTHER. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ + TYPE_ERR_CALL = 3, } /** + * Indicates the type of video state. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ export enum VideoStateType { - TYPE_VOICE = 0, // Voice - TYPE_VIDEO, // Video + /** + * Indicates the call is in voice state. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ + TYPE_VOICE = 0, + + /** + * Indicates the call is in video state. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ + TYPE_VIDEO, } /** + * Indicates the detailed state of call. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ export enum DetailedCallState { + /** + * Indicates the call is active. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ CALL_STATUS_ACTIVE = 0, + + /** + * Indicates the call is holding. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ CALL_STATUS_HOLDING, + + /** + * Indicates the call is dialing. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ CALL_STATUS_DIALING, + + /** + * Indicates the call is alerting. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ CALL_STATUS_ALERTING, + + /** + * Indicates the call is incoming. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ CALL_STATUS_INCOMING, + + /** + * Indicates the call is waiting. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ CALL_STATUS_WAITING, + + /** + * Indicates the call is disconnected. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ CALL_STATUS_DISCONNECTED, + + /** + * Indicates the call is disconnecting. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ CALL_STATUS_DISCONNECTING, + + /** + * Indicates the call is idle. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ CALL_STATUS_IDLE, } /** + * Indicates the information of call restriction. + * + * @interface CallRestrictionInfo + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ export interface CallRestrictionInfo { + /** + * Indicates the type of call restriction. + * + * @type { CallRestrictionType } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ type: CallRestrictionType; + + /** + * Indicates the password required to set call restrictions. + * + * @type { string } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ password: string; + + /** + * Indicates the mode of call restriction. + * + * @type { CallRestrictionMode } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ mode: CallRestrictionMode; } /** + * Indicates the mode of call restriction. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ export enum CallRestrictionMode { + /** + * Indicates call restriction is deactivated. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ RESTRICTION_MODE_DEACTIVATION = 0, + + /** + * Indicates call restriction is activated. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ RESTRICTION_MODE_ACTIVATION, } /** + * Indicates the options of call event. + * + * @interface CallEventOptions + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ export interface CallEventOptions { + /** + * Indicates the event ID of call ability. + * + * @type { CallAbilityEventId } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ eventId: CallAbilityEventId, } /** + * Indicates the event ID of call ability. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ export enum CallAbilityEventId { + /** + * Indicates there is no available carrier during dialing. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ EVENT_DIAL_NO_CARRIER = 1, + + /** + * Indicates invalid FDN. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ EVENT_INVALID_FDN_NUMBER, } + /** + * Indicates the states of call. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager + * @since 6 + */ export enum CallState { /** * Indicates an invalid state, which is used when the call state fails to be obtained. + * + * @syscap SystemCapability.Telephony.CallManager + * @since 6 */ CALL_STATE_UNKNOWN = -1, /** * Indicates that there is no ongoing call. + * + * @syscap SystemCapability.Telephony.CallManager + * @since 6 */ CALL_STATE_IDLE = 0, /** * Indicates that an incoming call is ringing or waiting. + * + * @syscap SystemCapability.Telephony.CallManager + * @since 6 */ CALL_STATE_RINGING = 1, /** - * Indicates that a least one call is in the dialing, active, or hold state, and there is no new incoming call - * ringing or waiting. + * Indicates that a least one call is in the dialing, active, or hold state, and there is no new + * incoming call ringing or waiting. + * + * @syscap SystemCapability.Telephony.CallManager + * @since 6 */ CALL_STATE_OFFHOOK = 2 } + /** + * Indicates the options of placing a call. + * + * @interface DialOptions + * @syscap SystemCapability.Telephony.CallManager + * @since 6 + */ export interface DialOptions { /** - * boolean means whether the call to be made is a video call. The value {@code false} indicates a voice call. + * Indicates whether the call to be made is a video call. The value {@code false} indicates + * a voice call. + * + * @type { ?boolean } + * @syscap SystemCapability.Telephony.CallManager + * @since 6 */ extras?: boolean; /** - * @systemapi Hide this for inner system use. + * Indicates the card slot index number, ranging from 0 to the maximum card slot index number + * supported by the device. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.CallManager * @since 8 */ accountId?: number; /** - * @systemapi Hide this for inner system use. + * Indicates the type of Video state. + * + * @type { ?VideoStateType } + * @syscap SystemCapability.Telephony.CallManager * @since 8 */ videoState?: VideoStateType; /** - * @systemapi Hide this for inner system use. + * Indicates the scenario of the call to be made. + * + * @type { ?DialScene } + * @syscap SystemCapability.Telephony.CallManager * @since 8 */ dialScene?: DialScene; /** - * @systemapi Hide this for inner system use. + * Indicates the type of the call to be made. + * + * @type { ?DialType } + * @syscap SystemCapability.Telephony.CallManager * @since 8 */ dialType?: DialType; } /** + * Indicates the options for initiating a call. + * + * @interface DialCallOptions + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ export interface DialCallOptions { /** + * Indicates the card slot index number, ranging from 0 to the maximum card slot index number + * supported by the device. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. + * @since 9 */ accountId?: number; /** + * Indicates the type of Video state. + * + * @type { ?VideoStateType } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. + * @since 9 */ videoState?: VideoStateType; /** + * Indicates the scenario of the call. + * + * @type { ?VideoStateType } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. + * @since 9 */ dialScene?: DialScene; /** + * Indicates the type of the call. + * + * @type { ?VideoStateType } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. + * @since 9 */ dialType?: DialType; } /** + * Indicates the scenarios of the call to be made. + * + * @enum {number} + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ export enum DialScene { + /** + * Indicates this is a common call. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_NORMAL = 0, + + /** + * Indicates this is a privileged call. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_PRIVILEGED = 1, + + /** + * Indicates this is an emergency call. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ CALL_EMERGENCY = 2, } /** + * Indicates the types of the call to be made. + * + * @enum {number} + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ export enum DialType { + /** + * Indicates this is a carrier call. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ DIAL_CARRIER_TYPE = 0, + + /** + * Indicates this is a call to play voice mail. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ DIAL_VOICE_MAIL_TYPE = 1, + + /** + * Indicates this is an OTT call. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 8 + */ DIAL_OTT_TYPE = 2, } /** + * Indicates the options for call rejection message. + * + * @interface RejectMessageOptions + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ export interface RejectMessageOptions { + /** + * Indicates the content of call rejection message. + * + * @type { string } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 7 + */ messageContent: string; } /** + * Indicates the result of call transfer. + * + * @interface CallTransferResult + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ export interface CallTransferResult { /** - * Call forwarding status. + * Indicates the status of call forwarding. * + * @type { TransferStatus } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ status: TransferStatus; /** - * Call forwarding phone number. + * Indicates the phone number of call forwarding. * + * @type { string } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ number: string; /** - * Start time hours. + * Indicates the start time hours of call forwarding. * + * @type { number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ startHour: number; /** - * Start time minutes. + * Indicates the start time minutes of call forwarding. * + * @type { number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ startMinute: number; /** - * End time hours. + * Indicates the end time hours of call forwarding. * + * @type { number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ endHour: number; /** - * End time minutes. + * Indicates the end time minutes of call forwarding. * + * @type { number } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ endMinute: number; } /** + * Indicates the status of call waiting. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 7 */ @@ -1650,6 +3179,8 @@ declare namespace call { /** * Indicates that call waiting is not enabled. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 7 */ CALL_WAITING_DISABLE = 0, @@ -1657,12 +3188,18 @@ declare namespace call { /** * Indicates that call waiting is enabled. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 7 */ CALL_WAITING_ENABLE = 1 } /** + * Indicates the status of call restriction. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -1670,6 +3207,8 @@ declare namespace call { /** * Indicates that call barring is not enabled. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ RESTRICTION_DISABLE = 0, @@ -1677,12 +3216,18 @@ declare namespace call { /** * Indicates that call barring is enabled. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ RESTRICTION_ENABLE = 1 } /** + * Indicates the status of call transfer. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -1690,6 +3235,8 @@ declare namespace call { /** * Indicates that call forwarding is not enabled. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ TRANSFER_DISABLE = 0, @@ -1697,36 +3244,55 @@ declare namespace call { /** * Indicates that call forwarding is enabled. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ TRANSFER_ENABLE = 1 } /** + * Indicates the option for determining if a number is an emergency number for specified slot. + * + * @interface EmergencyNumberOptions + * @syscap SystemCapability.Telephony.CallManager * @since 7 */ export interface EmergencyNumberOptions { /** - * Indicates sim card slot number. + * Indicates the card slot index number, ranging from 0 to the + * maximum card slot index number supported by the device. * + * @type { ?number } + * @syscap SystemCapability.Telephony.CallManager * @since 7 */ slotId?: number; } /** + * Indicates the option for number formatting. + * + * @interface NumberFormatOptions + * @syscap SystemCapability.Telephony.CallManager * @since 7 */ export interface NumberFormatOptions { /** * Indicates the country code. * + * @type { ?string } + * @syscap SystemCapability.Telephony.CallManager * @since 7 */ countryCode?: string; } /** + * The option for audio device. + * + * @interface AudioDeviceOptions + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -1734,12 +3300,19 @@ declare namespace call { /** * Indicates the bluetooth device address. * + * @type { ?string } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ bluetoothAddress?: string; } /** + * Indicates the MMI code result. + * + * @interface MmiCodeResults + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ @@ -1747,6 +3320,9 @@ declare namespace call { /** * Indicates the result of MMI code. * + * @type { MmiCodeResult } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ result: MmiCodeResult; @@ -1754,599 +3330,786 @@ declare namespace call { /** * Indicates the message of MMI code. * + * @type { string } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ message: string; } /** + * Indicates the MMI code result. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ export enum MmiCodeResult { /** Indicates the result of MMI code with successfully. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ MMI_CODE_SUCCESS = 0, /** Indicates the result of MMI code with failed. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ MMI_CODE_FAILED = 1 } /** + * Indicates the causes of call disconnection. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ export enum DisconnectedReason { /** - * Unassigned number. + * Indicates the call disconnect due to unassigned number. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ UNASSIGNED_NUMBER = 1, /** - * No route to destination. + * Indicates the call disconnect due to no route to destination. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ NO_ROUTE_TO_DESTINATION = 3, /** - * Channel unacceptable. + * Indicates the call disconnect due to channel unacceptable. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ CHANNEL_UNACCEPTABLE = 6, /** - * Operator determined barring. + * Indicates the call disconnect due to operator determined barring. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ OPERATOR_DETERMINED_BARRING = 8, /** - * Call completed elsewhere. + * Indicates the call disconnect due to call completed elsewhere. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ CALL_COMPLETED_ELSEWHERE = 13, /** - * Normal call clearing. + * Indicates the call disconnect due to normal call clearing. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ NORMAL_CALL_CLEARING = 16, /** - * User busy. + * Indicates the call disconnect due to user busy. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ USER_BUSY = 17, /** - * No user responding. + * Indicates the call disconnect due to no user responding. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ NO_USER_RESPONDING = 18, /** - * User alerting, no answer. + * Indicates the call disconnect due to user alerting, no answer. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ USER_ALERTING_NO_ANSWER = 19, /** - * Call rejected. + * Indicates the call disconnect due to call rejected. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ CALL_REJECTED = 21, /** - * Number changed. + * Indicates the call disconnect due to number changed. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ NUMBER_CHANGED = 22, /** - * Call rejected due to feature at the destination. + * Indicates the call rejected due to feature at the destination. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ CALL_REJECTED_DUE_TO_FEATURE_AT_THE_DESTINATION = 24, /** - * Pre-emption. + * Indicates the call disconnect due to pre-emption. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ FAILED_PRE_EMPTION = 25, /** - * Non selected user clearing. + * Indicates the call disconnect due to non selected user clearing. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ NON_SELECTED_USER_CLEARING = 26, /** - * Destination out of order. + * Indicates the call disconnect due to destination out of order. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ DESTINATION_OUT_OF_ORDER = 27, /** - * Invalid number format. + * Indicates the call disconnect due to invalid number format. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ INVALID_NUMBER_FORMAT = 28, /** - * Facility rejected. + * Indicates the call disconnect due to facility rejected. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ FACILITY_REJECTED = 29, /** - * Response to status enquiry. + * Indicates the call disconnect due to response to status enquiry. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RESPONSE_TO_STATUS_ENQUIRY = 30, /** - * Normal, unspecified. + * Indicates the call disconnected normally, no specified cause. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ NORMAL_UNSPECIFIED = 31, /** - * No circuit/channel available. + * Indicates the call disconnect due to no circuit/channel available. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ NO_CIRCUIT_CHANNEL_AVAILABLE = 34, /** - * Network out of order. + * Indicates the call disconnect due to network out of order. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ NETWORK_OUT_OF_ORDER = 38, /** - * Temporary failure. + * Indicates the call disconnect due to temporary failure. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ TEMPORARY_FAILURE = 41, /** - * Switching equipment congestion. + * Indicates the call disconnect due to switching equipment congestion. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ SWITCHING_EQUIPMENT_CONGESTION = 42, /** - * Access information discarded. + * Indicates the call disconnect due to access information discarded. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ ACCESS_INFORMATION_DISCARDED = 43, /** - * Requested circuit/channel not available. + * Indicates the call disconnect due to requested circuit/channel not available. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ REQUEST_CIRCUIT_CHANNEL_NOT_AVAILABLE = 44, /** - * Resources unavailable unspecified. + * Indicates the call disconnect due to resources unavailable unspecified. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RESOURCES_UNAVAILABLE_UNSPECIFIED = 47, /** - * Quality of service unavailable. + * Indicates the call disconnect due to quality of service unavailable. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ QUALITY_OF_SERVICE_UNAVAILABLE = 49, /** - * Requested facility not subscribed. + * Indicates the call disconnect due to requested facility not subscribed. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ REQUESTED_FACILITY_NOT_SUBSCRIBED = 50, /** - * Incoming calls barred within the CUG. + * Indicates the call disconnect due to incoming calls barred within the CUG. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ INCOMING_CALLS_BARRED_WITHIN_THE_CUG = 55, /** - * Bearer capability not authorized. + * Indicates the call disconnect due to bearer capability not authorized. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ BEARER_CAPABILITY_NOT_AUTHORIZED = 57, /** - * Bearer capability not presently available. + * Indicates the call disconnect due to bearer capability not presently available. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE = 58, /** - * Service or option not available, unspecified. + * Indicates the call disconnect due to service or option not available, unspecified. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ SERVICE_OR_OPTION_NOT_AVAILABLE_UNSPECIFIED = 63, /** - * Bearer service not implemented. + * Indicates the call disconnect due to bearer service not implemented. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ BEARER_SERVICE_NOT_IMPLEMENTED = 65, /** - * ACM equal to or greater than the maximum value. + * Indicates the call disconnect due to ACM equal to or greater than the maximum value. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ ACM_EQUALTO_OR_GREATER_THAN_THE_MAXIMUM_VALUE = 68, /** - * Requested facility not implemented. + * Indicates the call disconnect due to requested facility not implemented. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ REQUESTED_FACILITY_NOT_IMPLEMENTED = 69, /** - * Only restricted digital info BC available. + * Indicates the call disconnect due to only restricted digital info BC available. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ ONLY_RESTRICTED_DIGITAL_INFO_BEARER_CAPABILITY_IS_AVAILABLE = 70, /** - * Service or option not implemented, unspecified. + * Indicates the call disconnect due to service or option not implemented, unspecified. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ SERVICE_OR_OPTION_NOT_IMPLEMENTED_UNSPECIFIED = 79, /** - * Invalid transaction identifier value. + * Indicates the call disconnect due to invalid transaction identifier value. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ INVALID_TRANSACTION_IDENTIFIER_VALUE = 81, /** - * User not member of CUG. + * Indicates the call disconnect due to user not member of CUG. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ USER_NOT_MEMBER_OF_CUG = 87, /** - * Incompatible destination. + * Indicates the call disconnect due to incompatible destination. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ INCOMPATIBLE_DESTINATION = 88, /** - * Invalid transit network selection. + * Indicates the call disconnect due to invalid transit network selection. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ INVALID_TRANSIT_NETWORK_SELECTION = 91, /** - * Semantically incorrect message. + * Indicates the call disconnect due to semantically incorrect message. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ SEMANTICALLY_INCORRECT_MESSAGE = 95, /** - * Invalid mandatory information. + * Indicates the call disconnect due to invalid mandatory information. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ INVALID_MANDATORY_INFORMATION = 96, /** - * Msg type non-existent or not implemented. + * Indicates the call disconnect due to msg type non-existent or not implemented. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED = 97, /** - * Msg type not compatible with protocol state. + * Indicates the call disconnect due to msg type not compatible with protocol state. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, /** - * IE non-existent or not implemented. + * Indicates the call disconnect due to IE non-existent or not implemented. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED = 99, /** - * Conditional IE error. + * Indicates the call disconnect due to conditional IE error. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ CONDITIONAL_IE_ERROR = 100, /** - * Message not compatible with protocol state. + * Indicates the call disconnect due to message not compatible with protocol state. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, /** - * Recovery on timer expiry timer number. + * Indicates the call disconnect due to recovery on timer expiry timer number. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RECOVERY_ON_TIMER_EXPIRED = 102, /** - * Protocol error, unspecified. + * Indicates the call disconnect due to protocol error, unspecified. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ PROTOCOL_ERROR_UNSPECIFIED = 111, /** - * Interworking, unspecified. + * Indicates the call disconnect due to interworking, unspecified. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ INTERWORKING_UNSPECIFIED = 127, /** - * Call barred. + * Indicates the call disconnect due to call barred. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ CALL_BARRED = 240, /** - * FDN blocked. + * Indicates the call disconnect due to FDN blocked. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ FDN_BLOCKED = 241, /** - * IMSI in VLR is unknown. + * Indicates the call disconnect due to IMSI in VLR is unknown. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ IMSI_UNKNOWN_IN_VLR = 242, /** - * IMEI not accepted. + * Indicates the call disconnect due to IMEI not accepted. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ IMEI_NOT_ACCEPTED = 243, /** - * Dial modified to USSD. + * Indicates the call disconnect due to dial modified to USSD. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ DIAL_MODIFIED_TO_USSD = 244, /** - * Dial modified to SS. + * Indicates the call disconnect due to dial modified to SS. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ DIAL_MODIFIED_TO_SS = 245, /** - * Dial modified to dial. + * Indicates the call disconnect due to dial modified to dial. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ DIAL_MODIFIED_TO_DIAL = 246, /** - * Radio off. + * Indicates the call disconnect due to Radio off. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RADIO_OFF = 247, /** - * Out of service. + * Indicates the call disconnect due to out of service. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ OUT_OF_SERVICE = 248, /** - * Invalid SIM. + * Indicates the call disconnect due to invalid SIM. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ NO_VALID_SIM = 249, /** - * Radio internal error. + * Indicates the call disconnect due to radio internal error. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RADIO_INTERNAL_ERROR = 250, /** - * Network response timeout. + * Indicates the call disconnect due to network response timeout. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ NETWORK_RESP_TIMEOUT = 251, /** - * Network reject. + * Indicates the call disconnect due to network reject. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ NETWORK_REJECT = 252, /** - * Radio access failure. + * Indicates the call disconnect due to radio access failure. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RADIO_ACCESS_FAILURE = 253, /** - * Radio link failure. + * Indicates the call disconnect due to radio link failure. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RADIO_LINK_FAILURE = 254, /** - * Radio link lost. + * Indicates the call disconnect due to radio link lost. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RADIO_LINK_LOST = 255, /** - * Radio uplink failure. + * Indicates the call disconnect due to radio uplink failure. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RADIO_UPLINK_FAILURE = 256, /** - * Radio setup failure. + * Indicates the call disconnect due to radio setup failure. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RADIO_SETUP_FAILURE = 257, /** - * Radio release normal. + * Indicates the call disconnect due to radio release normal. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RADIO_RELEASE_NORMAL = 258, /** - * Radio release abnormal. + * Indicates the call disconnect due to radio release abnormal. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ RADIO_RELEASE_ABNORMAL = 259, /** - * Access class blocked. + * Indicates the call disconnect due to access class blocked. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ ACCESS_CLASS_BLOCKED = 260, /** - * Network detach. + * Indicates the call disconnect due to network detach. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 9 */ NETWORK_DETACH = 261, /** - * Invalid parameter. + * Indicates the call disconnect due to invalid parameter. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ INVALID_PARAMETER = 1025, /** - * Sim not exit. + * Indicates the call disconnect due to sim not exit. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ SIM_NOT_EXIT = 1026, /** - * Sim pin need. + * Indicates the call disconnect due to sim pin need. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ SIM_PIN_NEED = 1027, /** - * Call Not allow. + * Indicates the call disconnect due to call not allow. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ CALL_NOT_ALLOW = 1029, /** - * Sim invalid. + * Indicates the call disconnect due to sim invalid. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ SIM_INVALID = 1045, /** - * Unknown error. + * Indicates the call disconnect due to unknown error. * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ UNKNOWN = 1279, } /** + * Indicates the cause of a call disconnection. + * + * @interface DisconnectedDetails + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 */ export interface DisconnectedDetails { /** * Indicates the reason for ending the call. + * + * @type { DisconnectedReason } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 9 */ reason: DisconnectedReason; /** * Indicates the message for ending the call. + * + * @type { string } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 9 */ message: string; } diff --git a/api/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts index abeed468d..c9f97f463 100644 --- a/api/@ohos.telephony.data.d.ts +++ b/api/@ohos.telephony.data.d.ts @@ -1,3 +1,4 @@ + /* * Copyright (C) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,22 +19,34 @@ import { AsyncCallback } from "./@ohos.base"; /** * Provides methods related to cellular data services. * - * @since 7 + * @namespace data * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ declare namespace data { /** * Get the default cellular data card. * - * @returns Returns default cellular data slot id. + * @param { AsyncCallback } callback - Indicates the default cellular data slot id. + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ function getDefaultCellularDataSlotId(callback: AsyncCallback): void; + + /** + * Get the default cellular data card. + * + * @returns { Promise } Returns the default cellular data slot id. + * @syscap SystemCapability.Telephony.CellularData + * @since 7 + */ function getDefaultCellularDataSlotId(): Promise; /** * Get the default cellular data card. * - * @returns Returns default cellular data slot id. + * @returns { number } Returns default cellular data slot id. + * @syscap SystemCapability.Telephony.CellularData * @since 9 */ function getDefaultCellularDataSlotIdSync(): number; @@ -41,34 +54,72 @@ declare namespace data { /** * Switches cellular data services to another card, without changing the default settings. * - * @param slotId Indicates the ID of the target card slot. - * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301001 - SIM card is not activated. + * @param { number } 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 { AsyncCallback } callback - The callback of setDefaultCellularDataSlotId. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301001 - SIM card is not activated. + * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. + * @since 7 */ function setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback): void; + + /** + * Switches cellular data services to another card, without changing the default settings. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the ID of the target card slot. + * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. + * @returns { Promise } The promise returned by the setDefaultCellularDataSlotId. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301001 - SIM card is not activated. + * @syscap SystemCapability.Telephony.CellularData + * @systemapi Hide this for inner system use. + * @since 7 + */ function setDefaultCellularDataSlotId(slotId: number): Promise; /** * Indicates that there is no uplink or downlink data. * *

It is a return value of service state query of cellular data services. + * @param { AsyncCallback } callback - Indicates the data flow type. + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ function getCellularDataFlowType(callback: AsyncCallback): void; + + /** + * Indicates that there is no uplink or downlink data. + * + *

It is a return value of service state query of cellular data services. + * @returns { Promise } Returns the data flow type. + * @syscap SystemCapability.Telephony.CellularData + * @since 7 + */ function getCellularDataFlowType(): Promise; /** * Obtains the connection state of the PS domain. * - * @param callback Returns the connection state, which can be any of the following: + * @param { AsyncCallback } callback - Indicates the callback for getting the connection state, + * which can be any of the following: *

    *
  • {@code DataConnectState#DATA_STATE_UNKNOWN} *
  • {@code DataConnectState#DATA_STATE_DISCONNECTED} @@ -76,162 +127,340 @@ declare namespace data { *
  • {@code DataConnectState#DATA_STATE_CONNECTED} *
  • {@code DataConnectState#DATA_STATE_SUSPENDED} *
+ * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ function getCellularDataState(callback: AsyncCallback): void; + + /** + * Obtains the connection state of the PS domain. + * + * @returns { Promise } Returns the connection state, which can be any of the following: + *
    + *
  • {@code DataConnectState#DATA_STATE_UNKNOWN} + *
  • {@code DataConnectState#DATA_STATE_DISCONNECTED} + *
  • {@code DataConnectState#DATA_STATE_CONNECTING} + *
  • {@code DataConnectState#DATA_STATE_CONNECTED} + *
  • {@code DataConnectState#DATA_STATE_SUSPENDED} + *
+ * @syscap SystemCapability.Telephony.CellularData + * @since 7 + */ function getCellularDataState(): Promise; /** * Checks whether cellular data services are enabled. * - * @param callback Returns {@code true} if cellular data services are enabled; returns {@code false} otherwise. * @permission ohos.permission.GET_NETWORK_INFO - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for checking whether cellular data services + * are enabled. Returns {@code true} if cellular data services are enabled; returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ function isCellularDataEnabled(callback: AsyncCallback): void; + + /** + * Checks whether cellular data services are enabled. + * + * @permission ohos.permission.GET_NETWORK_INFO + * @returns { Promise } Returns {@code true} if cellular data services are enabled. + * Returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData + * @since 7 + */ function isCellularDataEnabled(): Promise; /** * Enables cellular data services. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of enableCellularData. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. + * @since 7 */ function enableCellularData(callback: AsyncCallback): void; + + /** + * Enables cellular data services. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @returns { Promise } The promise returned by the enableCellularData. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData + * @systemapi Hide this for inner system use. + * @since 7 + */ function enableCellularData(): Promise; /** * Disables cellular data services. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of disableCellularData. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. + * @since 7 */ function disableCellularData(callback: AsyncCallback): void; + + /** + * Disables cellular data services. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @returns { Promise } The promise returned by the disableCellularData. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData + * @systemapi Hide this for inner system use. + * @since 7 + */ function disableCellularData(): Promise; /** * Checks whether roaming is enabled for cellular data services. * - * @param slotId Indicates the ID of a card slot. - * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. - * @param callback Returns {@code true} if roaming is enabled for cellular data services; returns {@code false} otherwise. * @permission ohos.permission.GET_NETWORK_INFO - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the ID of a card slot. + * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. + * @param { AsyncCallback } callback - Indicates the callback for checking whether roaming is enabled + * for cellular data services. Returns {@code true} if roaming is enabled for cellular data services; + * returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ function isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback): void; + + /** + * Checks whether roaming is enabled for cellular data services. + * + * @permission ohos.permission.GET_NETWORK_INFO + * @param { number } slotId - Indicates the ID of a card slot. + * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. + * @returns { Promise } Returns {@code true} if roaming is enabled for cellular data services. + * Returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData + * @since 7 + */ function isCellularDataRoamingEnabled(slotId: number): Promise; /** * Enables cellular data roaming. * - * @param slotId Indicates the ID of a card slot. - * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the ID of a card slot. + * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. + * @param { AsyncCallback } callback - The callback of enableCellularDataRoaming. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. + * @since 7 */ function enableCellularDataRoaming(slotId: number, callback: AsyncCallback): void; + + /** + * Enables cellular data roaming. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the ID of a card slot. + * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. + * @returns { Promise } The promise returned by the enableCellularDataRoaming. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData + * @systemapi Hide this for inner system use. + * @since 7 + */ function enableCellularDataRoaming(slotId: number): Promise; /** * Disables cellular data roaming. * - * @param slotId Indicates the ID of a card slot. - * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the ID of a card slot. + * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. + * @param { AsyncCallback } callback - The callback of disableCellularDataRoaming. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData * @systemapi Hide this for inner system use. + * @since 7 */ function disableCellularDataRoaming(slotId: number, callback: AsyncCallback): void; + + /** + * Disables cellular data roaming. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the ID of a card slot. + * The value {@code 0} indicates card 1, and the value {@code 1} indicates card 2. + * @returns { Promise } The promise returned by the disableCellularDataRoaming. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CellularData + * @systemapi Hide this for inner system use. + * @since 7 + */ function disableCellularDataRoaming(slotId: number): Promise; /** * Describes the cellular data flow type. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ export enum DataFlowType { /** * Indicates that there is no uplink or downlink data. + * + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ DATA_FLOW_TYPE_NONE = 0, /** * Indicates that there is only downlink data. + * + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ DATA_FLOW_TYPE_DOWN = 1, /** * Indicates that there is only uplink data. + * + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ DATA_FLOW_TYPE_UP = 2, /** * Indicates that there is uplink and downlink data. + * + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ DATA_FLOW_TYPE_UP_DOWN = 3, /** * Indicates that there is no uplink or downlink data, and the bottom-layer link is in the dormant state. + * + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ DATA_FLOW_TYPE_DORMANT = 4 } /** * Describes the cellular data link connection state. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ export enum DataConnectState { /** * Indicates that a cellular data link is unknown. + * + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ DATA_STATE_UNKNOWN = -1, /** * Indicates that a cellular data link is disconnected. + * + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ DATA_STATE_DISCONNECTED = 0, /** * Indicates that a cellular data link is being connected. + * + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ DATA_STATE_CONNECTING = 1, /** * Indicates that a cellular data link is connected. + * + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ DATA_STATE_CONNECTED = 2, /** * Indicates that a cellular data link is suspended. + * + * @syscap SystemCapability.Telephony.CellularData + * @since 7 */ DATA_STATE_SUSPENDED = 3 } diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts index 710cf4403..192520902 100644 --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -23,8 +23,9 @@ import sim from "./@ohos.telephony.sim"; * Monitors telephony state updates of a device, including updates of the network state, * signal strength, call state, the data link connection state and others. * - * @since 6 + * @namespace observer * @syscap SystemCapability.Telephony.StateRegistry + * @since 6 */ declare namespace observer { type NetworkState = radio.NetworkState; @@ -41,265 +42,516 @@ declare namespace observer { type SimState = sim.SimState; /** - * Called when the network state corresponding to a monitored {@code slotId} updates. + * Callback when the network state corresponding to the default sim card is updated. * - * @param type networkStateChange - * @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 instance of the {@code NetworkState} class. * @permission ohos.permission.GET_NETWORK_INFO - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - networkStateChange. + * @param { Callback } callback - Indicates the callback for + * getting an instance of the {@code NetworkState} class. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 6 */ function on(type: 'networkStateChange', callback: Callback): void; + + /** + * Callback when the network state corresponding to the monitored {@code slotId} is updated. + * + * @permission ohos.permission.GET_NETWORK_INFO + * @param { string } type - networkStateChange. + * @param { { slotId: number } } options - 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 } callback - Indicates the callback for getting + * an instance of the {@code NetworkState} class. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 6 + */ function on(type: 'networkStateChange', options: { slotId: number }, callback: Callback): void; /** - * Cancel Called when the network state corresponding to a monitored {@code slotId} updates. + * Cancel callback when the network state is updated. * - * @param type networkStateChange - * @param callback including an instance of the {@code NetworkState} class. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - networkStateChange. + * @param { Callback } callback - Indicates the callback to unsubscribe from the networkStateChange event. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 6 */ function off(type: 'networkStateChange', callback?: Callback): void; /** - * Called when the signal strength corresponding to a monitored {@code slotId} updates. + * Callback when the signal strength corresponding to the default sim card is updated. * - * @param type signalInfoChange - * @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 SignalInformation}. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - signalInfoChange. + * @param { Callback> } callback - Indicates the callback for getting + * an array of instances of the classes derived from {@link SignalInformation}. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 6 */ function on(type: 'signalInfoChange', callback: Callback>): void; - function on(type: 'signalInfoChange', options: { slotId: number }, - callback: Callback>): void; /** - * Cancel Called when the signal strength corresponding to a monitored {@code slotId} updates. + * Callback when the signal strength corresponding to a monitored {@code slotId} is updated. * - * @param type signalInfoChange - * @param callback including an array of instances of the classes derived from {@link SignalInformation}. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - signalInfoChange. + * @param { { slotId: number } } options - 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> } callback - Indicates the callback for getting + * an array of instances of the classes derived from {@link SignalInformation}. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 6 + */ + function on(type: 'signalInfoChange', options: { slotId: number }, callback: Callback>): void; + + /** + * Cancel callback when the signal strength is updated. + * + * @param { string } type - signalInfoChange. + * @param { Callback } callback - Indicates the callback to unsubscribe from the signalInfoChange event. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 6 */ function off(type: 'signalInfoChange', callback?: Callback>): void; /** - * Called back when the cell information corresponding to a monitored {@code slotId} updates. + * Callback when the cell information corresponding to the default sim card is updated. * - * @param type cellInfoChange - * @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 - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - cellInfoChange. + * @param { Callback> } callback - Indicates the callback for getting + * an array of instances of the classes derived from {@link CellInformation}. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry * @systemapi Hide this for inner system use. * @since 8 */ function on(type: 'cellInfoChange', callback: Callback>): void; - function on(type: 'cellInfoChange', options: { slotId: number }, - callback: Callback>): void; /** - * Cancel Called back when the cell information corresponding to a monitored {@code slotId} updates. + * Callback when the cell information corresponding to a monitored {@code slotId} is updated. * - * @param type cellInfoChange - * @param callback including an array of instances of the classes derived from {@link CellInformation}. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION + * @param { string } type - cellInfoChange. + * @param { { slotId: number } } options - 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> } callback - Indicates the callback for getting + * an array of instances of the classes derived from {@link CellInformation}. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @systemapi Hide this for inner system use. + * @since 8 + */ + function on(type: 'cellInfoChange', options: { slotId: number }, callback: Callback>): void; + + /** + * Cancel callback when the cell information is updated. + * + * @param { string } type - cellInfoChange. + * @param { Callback> } callback - Indicates the callback to unsubscribe from + * the cellInfoChange event. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry * @systemapi Hide this for inner system use. * @since 8 */ function off(type: 'cellInfoChange', callback?: Callback>): void; /** - * Called when the cellular data link connection state updates. + * Callback when the cellular data link connection state corresponding to the default sim card is updated. * - * @param type cellularDataConnectionStateChange - * @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 state Indicates the cellular data link connection state, - * and networkType Indicates the radio access technology for cellular data services. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - cellularDataConnectionStateChange. + * @param { Callback<{ state: DataConnectState, network: RatType }> } callback - Indicates the callback for + * getting the cellular data link connection state, and networkType Indicates the radio access technology + * for cellular data services. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry * @since 7 */ function on(type: 'cellularDataConnectionStateChange', callback: Callback<{ state: DataConnectState, network: RatType }>): void; + + /** + * Callback when the cellular data link connection state corresponding to the monitored {@code slotId} is updated. + * + * @param { string } type - cellularDataConnectionStateChange. + * @param { { slotId: number } } options - 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<{ state: DataConnectState, network: RatType }> } callback - Indicates the callback for + * getting the cellular data link connection state, and networkType Indicates the radio access technology for + * cellular data services. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 7 + */ function on(type: 'cellularDataConnectionStateChange', options: { slotId: number }, callback: Callback<{ state: DataConnectState, network: RatType }>): void; /** - * Cancel Called when the cellular data link connection state updates. + * Cancel callback when the cellular data link connection state is updated. * - * @param type cellularDataConnectionStateChange - * @param callback including state Indicates the cellular data link connection state, - * and networkType Indicates the radio access technology for cellular data services. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - cellularDataConnectionStateChange. + * @param { Callback<{ state: DataConnectState, network: RatType }> } callback - Indicates the callback to unsubscribe + * from the cellularDataConnectionStateChange event. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry * @since 7 */ function off(type: 'cellularDataConnectionStateChange', callback?: Callback<{ state: DataConnectState, network: RatType }>): void; /** - * Called when the uplink and downlink data flow state of cellular data services updates. + * Callback when the uplink and downlink data flow state of cellular data services + * corresponding to the default sim card is updated. * - * @param type cellularDataFlowChange - * @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 the cellular data flow state. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - cellularDataFlowChange. + * @param { Callback } callback - Indicates the callback for getting the cellular data flow state. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry * @since 7 */ function on(type: 'cellularDataFlowChange', callback: Callback): void; - function on(type: 'cellularDataFlowChange', options: { slotId: number }, - callback: Callback): void; /** - * Cancel Called when the uplink and downlink data flow state of cellular data services updates. + * Callback when the uplink and downlink data flow state of cellular data services + * corresponding to the monitored {@code slotId} is updated. * - * @param type cellularDataFlowChange - * @param callback including the cellular data flow state. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - cellularDataFlowChange. + * @param { { slotId: number } } options - 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 } callback - Indicates the callback for getting the cellular data flow state. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 7 + */ + function on(type: 'cellularDataFlowChange', options: { slotId: number }, callback: Callback): void; + + /** + * Cancel callback when the uplink and downlink data flow state of cellular data services is updated. + * + * @param { string } type - cellularDataFlowChange. + * @param { Callback } callback - Indicates the callback to unsubscribe from + * the cellularDataFlowChange event. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry * @since 7 */ function off(type: 'cellularDataFlowChange', callback?: Callback): void; /** - * Receives a call state change. This callback is invoked when the call state of a specified card updates - * and the observer is added to monitor the updates. + * Callback when the call state corresponding to the default sim card is updated. * - * @param type callStateChange - * @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 state Indicates the call state, and number Indicates the called number. - * The value of number is an empty string if the application does not have the - * ohos.permission.READ_CALL_LOG permission. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - callStateChange. + * @param { Callback<{ state: CallState, number: string }> } callback - Indicates the callback for + * getting the call state and the called number. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 6 */ function on(type: 'callStateChange', callback: Callback<{ state: CallState, number: string }>): void; - function on(type: 'callStateChange', options: { slotId: number }, - callback: Callback<{ state: CallState, number: string }>): void; /** - * Cancel Receives a call state change. This callback is invoked when the call state of a specified card updates - * and the observer is added to monitor the updates. + * Callback when the call state corresponding to the monitored {@code slotId} is updated. * - * @param type callStateChange - * @param callback including state Indicates the call state, and number Indicates the called number. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - callStateChange. + * @param { { slotId: number } } options - 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<{ state: CallState, number: string }> } callback - Indicates the callback for + * getting the call state and the called number. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 6 + */ + function on(type: 'callStateChange', options: { slotId: number }, callback: Callback<{ state: CallState, number: string }>): void; + + /** + * Cancel callback when the call state is updated. + * + * @param { string } type - callStateChange. + * @param { Callback<{ state: CallState, number: string }> } callback - Indicates the callback to + * unsubscribe from the callStateChange event. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 6 */ function off(type: 'callStateChange', callback?: Callback<{ state: CallState, number: string }>): void; /** - * Receives a sim state change. This callback is invoked when the sim state of a specified card updates - * and the observer is added to monitor the updates. + * Callback when the sim state corresponding to the default sim card is updated. * - * @param type simStateChange - * @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 state Indicates the sim state, and reason Indicates the cause of the change. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - simStateChange. + * @param { Callback } callback - Indicates the callback for getting the SimStateData object. + * including state Indicates the sim state, and reason Indicates the cause of the change. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry * @since 7 */ function on(type: 'simStateChange', callback: Callback): void; + + /** + * Callback when the sim state corresponding to the monitored {@code slotId} is updated. + * + * @param { string } type - simStateChange. + * @param { { slotId: number } } options - 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 } callback - Indicates the callback for getting the SimStateData object. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry + * @since 7 + */ function on(type: 'simStateChange', options: { slotId: number }, callback: Callback): void; /** - * Receives a sim state change. This callback is invoked when the sim state of a specified card updates - * and the observer is delete. + * Cancel callback when the sim state is updated. * - * @param type simStateChange - * @param callback including state Indicates the sim state, and reason Indicates the cause of the change. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - simStateChange. + * @param { Callback } callback - Indicates the callback to unsubscribe from the simStateChange event. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.StateRegistry * @since 7 */ function off(type: 'simStateChange', callback?: Callback): void; /** + * Indicates SIM card type and status. + * + * @interface SimStateData + * @syscap SystemCapability.Telephony.StateRegistry * @since 7 */ export interface SimStateData { - type: CardType; - state: SimState; /** + * Indicates the SIM card type. + * + * @type { CardType } + * @syscap SystemCapability.Telephony.StateRegistry + * @since 7 + */ + type: CardType; + + /** + * Indicates the SIM card states. + * + * @type { SimState } + * @syscap SystemCapability.Telephony.StateRegistry + * @since 7 + */ + state: SimState; + + /** + * Indicates the SIM card lock type. + * + * @type { LockReason } + * @syscap SystemCapability.Telephony.StateRegistry * @since 8 */ reason: LockReason; } /** + * Enum for SIM card lock type. + * + * @enum { number } + * @syscap SystemCapability.Telephony.StateRegistry * @since 8 */ export enum LockReason { + /** + * Indicates no SIM lock. + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ SIM_NONE, + + /** + * Indicates the PIN lock. + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ SIM_PIN, + + /** + * Indicates the PUK lock. + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ SIM_PUK, - SIM_PN_PIN, //Network Personalization (refer 3GPP TS 22.022 [33]) + + /** + * Indicates network personalization of PIN lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ + SIM_PN_PIN, + + /** + * Indicates network personalization of PUK lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ SIM_PN_PUK, - SIM_PU_PIN, //Network Subset Personalization (refer 3GPP TS 22.022 [33]) + + /** + * Indicates network subset personalization of PIN lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ + SIM_PU_PIN, + + /** + * Indicates network subset personalization of PUK lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ SIM_PU_PUK, - SIM_PP_PIN, //Service Provider Personalization (refer 3GPP TS 22.022 [33]) + + /** + * Indicates service provider personalization of PIN lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ + SIM_PP_PIN, + + /** + * Indicates service provider personalization of PUK lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ SIM_PP_PUK, - SIM_PC_PIN, //Corporate Personalization (refer 3GPP TS 22.022 [33]) + + /** + * Indicates corporate personalization of PIN lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ + SIM_PC_PIN, + + /** + * Indicates corporate personalization of PUK lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ SIM_PC_PUK, - SIM_SIM_PIN, //SIM/USIM Personalization (refer 3GPP TS 22.022 [33]) + + /** + * Indicates SIM/USIM personalization of PIN lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ + SIM_SIM_PIN, + + /** + * Indicates SIM/USIM personalization of PUK lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.StateRegistry + * @since 8 + */ SIM_SIM_PUK, } } diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index a35df1688..2ab6ba0e0 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -20,17 +20,20 @@ import { AsyncCallback, Callback } from "./@ohos.base"; * and device ID of the wireless cellular network (WCN), and provides a callback registration mechanism to * listen for changes of the network, cell, and signal status of the WCN. * - * @since 6 + * @namespace radio * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ declare namespace radio { /** * Obtains radio access technology (RAT) of the registered network. The system * returns RAT of the packet service (PS) and circuit service (CS) domain. * - * @param slotId Indicates the card slot index number, + * @permission ohos.permission.GET_NETWORK_INFO + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns an integer indicating the RAT in use. The values are as follows: + * @param { AsyncCallback<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}> } callback - Returns + * an integer indicating the RAT in use. The values are as follows: *
    *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_UNKNOWN} *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_GSM} @@ -46,70 +49,158 @@ declare namespace radio { *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_IWLAN} *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_NR} *
- * @permission ohos.permission.GET_NETWORK_INFO - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ function getRadioTech(slotId: number, - callback: AsyncCallback<{ psRadioTech: RadioTechnology, csRadioTech: RadioTechnology }>): void; - function getRadioTech(slotId: number): Promise<{ psRadioTech: RadioTechnology, csRadioTech: RadioTechnology }>; + callback: AsyncCallback<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>): void; + + /** + * Obtains radio access technology (RAT) of the registered network. The system + * returns RAT of the packet service (PS) and circuit service (CS) domain. + * + * @permission ohos.permission.GET_NETWORK_INFO + * @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 } Returns + * the enumeration of RadioTechnology. The values are as follows: + *
    + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_UNKNOWN} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_GSM} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_1XRTT} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_WCDMA} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_HSPA} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_HSPAP} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_TD_SCDMA} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_EVDO} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_EHRPD} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_LTE} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_LTE_CA} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_IWLAN} + *
  • {@code RadioTechnology#RADIO_TECHNOLOGY_NR} + *
+ * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ + function getRadioTech(slotId: number): Promise<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>; /** * Obtains the network state of the registered network. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns a {@code NetworkState} object. * @permission ohos.permission.GET_NETWORK_INFO - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting network registration state. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ function getNetworkState(callback: AsyncCallback): void; + + /** + * Obtains the network state of the registered network. + * + * @permission ohos.permission.GET_NETWORK_INFO + * @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 } callback - Indicates the callback for getting network registration state. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ function getNetworkState(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the network state of the registered network. + * + * @permission ohos.permission.GET_NETWORK_INFO + * @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 } Returns the NetworkState object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ function getNetworkState(slotId?: number): Promise; /** * Actively requests to update location information. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. - * @param { number } [ slotId ] - indicates the card slot index number. - * @param { AsyncCallback } callback - the callback of sendUpdateCellLocationRequest. + * @param { AsyncCallback } callback - The callback of sendUpdateCellLocationRequest. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function sendUpdateCellLocationRequest(callback: AsyncCallback): void; + + /** + * Actively requests to update location information. + * + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION + * @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 } callback - The callback of sendUpdateCellLocationRequest. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function sendUpdateCellLocationRequest(slotId: number, callback: AsyncCallback): void; /** * Actively requests to update location information. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. - * @param { number } [ slotId ] - indicates the card slot index number. - * @returns { Promise } the promise returned by the function. + * @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 } The promise returned by the sendUpdateCellLocationRequest. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ @@ -118,150 +209,388 @@ declare namespace radio { /** * Get the current cell information. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. - * @param callback Return cell information. * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback> } callback - Indicates the callback for getting cell information. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getCellInformation(callback: AsyncCallback>): void; + + /** + * Get the current cell information. + * + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION + * @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> } callback - Indicates the callback for getting cell information. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getCellInformation(slotId: number, callback: AsyncCallback>): void; + + /** + * Get the current cell information. + * + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION + * @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> } Returns the current cell information. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getCellInformation(slotId?: number): Promise>; /** * Obtains the network search mode 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. - * @param callback Returns the network search mode of the SIM card. Available values are as follows: + * @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 } callback - Indicates the callback for getting + * the network search mode of the SIM card. Available values are as follows: *
    *
  • {@link NetworkSelectionMode#NETWORK_SELECTION_UNKNOWN} *
  • {@link NetworkSelectionMode#NETWORK_SELECTION_AUTOMATIC} *
  • {@link NetworkSelectionMode#NETWORK_SELECTION_MANUAL} *
      - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ function getNetworkSelectionMode(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the network search mode of the SIM card in a specified slot. + * + * @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 } Returns the network search mode of the SIM card. + * Available values are as follows: + *
        + *
      • {@link NetworkSelectionMode#NETWORK_SELECTION_UNKNOWN} + *
      • {@link NetworkSelectionMode#NETWORK_SELECTION_AUTOMATIC} + *
      • {@link NetworkSelectionMode#NETWORK_SELECTION_MANUAL} + *
          + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ function getNetworkSelectionMode(slotId: number): Promise; /** * Set the current network selection mode. * - * @param options Indicates the network selection mode option. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { NetworkSelectionModeOptions } options Indicates the network selection mode option. + * @param { AsyncCallback } callback - The callback of setNetworkSelectionMode. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. + * @since 6 */ function setNetworkSelectionMode(options: NetworkSelectionModeOptions, callback: AsyncCallback): void; + + /** + * Set the current network selection mode. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { NetworkSelectionModeOptions } options Indicates the network selection mode option. + * @returns { Promise } The promise returned by the setNetworkSelectionMode. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ function setNetworkSelectionMode(options: NetworkSelectionModeOptions): Promise; /** * Get network search information. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. - * @param callback Returns the search results of the network. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - Indicates the callback for getting + * the search results of the network. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. + * @since 6 */ function getNetworkSearchInformation(slotId: number, callback: AsyncCallback): void; + + /** + * Get network search information. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the search results of the network. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ function getNetworkSearchInformation(slotId: number): Promise; /** * Obtains the ISO-defined country code of the country where the registered network is deployed. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the country code defined in ISO 3166-2; - * returns an empty string if the device is not registered with any network. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the country code + * defined in ISO 3166-2; returns an empty string if the device is not registered with any network. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function getISOCountryCodeForNetwork(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the ISO-defined country code of the country where the registered network is deployed. + * + * @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 } Returns the country code defined in ISO 3166-2. + * Returns an empty string if the device is not registered with any network. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function getISOCountryCodeForNetwork(slotId: number): Promise; /** * Get the option mode of NR. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. - * @param callback Returns the selection mode of NR. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the selection mode of NR. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getNrOptionMode(callback: AsyncCallback): void; + + /** + * Get the option mode of NR. + * + * @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 } callback - Indicates the callback for getting the selection mode of NR. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getNrOptionMode(slotId: number, callback: AsyncCallback): void; + + /** + * Get the option mode of NR. + * + * @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 } Returns the selection mode of NR. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getNrOptionMode(slotId?: number): Promise; /** * Obtains the IMEI of a specified card slot of the device. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. - * @param callback Returns the IMEI; returns an empty string if the IMEI does not exist. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the IMEI. + * Returns an empty string if the IMEI does not exist. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getIMEI(callback: AsyncCallback): void; + + /** + * Obtains the IMEI of a specified card slot of the device. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } callback - Indicates the callback for getting the IMEI. + * Returns an empty string if the IMEI does not exist. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getIMEI(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the IMEI of a specified card slot of the device. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the IMEI. Returns an empty string if the IMEI does not exist. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getIMEI(slotId?: number): Promise; /** * Obtains the MEID of a specified card slot of the device. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. - * @param callback Returns the MEID; returns an empty string if the MEID does not exist. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the MEID. + * Returns an empty string if the MEID does not exist. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getMEID(callback: AsyncCallback): void; + + /** + * Obtains the MEID of a specified card slot of the device. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } callback - Indicates the callback for getting the MEID. + * Returns an empty string if the MEID does not exist. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getMEID(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the MEID of a specified card slot of the device. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the MEID. Returns an empty string if the MEID does not exist. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getMEID(slotId?: number): Promise; /** @@ -271,21 +600,70 @@ declare namespace radio { * (IMEI) is returned. If the device is registered with a 3GPP2-compliant network, the mobile equipment identifier * (MEID) is returned. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. - * @param callback Returns the unique device ID; returns an empty string if the unique device ID does not exist. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the unique device ID. + * Returns an empty string if the unique device ID does not exist. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getUniqueDeviceId(callback: AsyncCallback): void; + + /** + * Obtains the unique device ID of a specified card slot of the device. + * + *

          If the device is registered with a 3GPP-compliant network, the international mobile equipment identity + * (IMEI) is returned. If the device is registered with a 3GPP2-compliant network, the mobile equipment identifier + * (MEID) is returned. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } callback - Indicates the callback for getting the unique device ID. + * Returns an empty string if the unique device ID does not exist. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getUniqueDeviceId(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the unique device ID of a specified card slot of the device. + * + *

          If the device is registered with a 3GPP-compliant network, the international mobile equipment identity + * (IMEI) is returned. If the device is registered with a 3GPP2-compliant network, the mobile equipment identifier + * (MEID) is returned. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the unique device ID. + * Returns an empty string if the unique device ID does not exist. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getUniqueDeviceId(slotId?: number): Promise; /** @@ -293,55 +671,112 @@ declare namespace radio { * *

          The primary card is the SIM card inserted in the card slot that uses data services by default. * - * @param callback Returns the index number of the primary card slot. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the index number of + * the primary card slot. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function getPrimarySlotId(callback: AsyncCallback): void; + + /** + * Obtains the index number of the card slot where the primary card is located if multiple SIM cards are inserted. + * + *

          The primary card is the SIM card inserted in the card slot that uses data services by default. + * + * @returns { Promise } Returns the index number of the primary card slot. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function getPrimarySlotId(): Promise; /** * Set the index number of the main SIM card slot. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - The callback of setPrimarySlotId. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function setPrimarySlotId(slotId: number, callback: AsyncCallback): void; + + /** + * Set the index number of the main SIM card slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @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 } The promise returned by the setPrimarySlotId. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function setPrimarySlotId(slotId: number): Promise; /** * Obtains the list of signal strength information of the registered network corresponding to a specified SIM card. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. - * @param callback Returns the instance list of the child classes derived from {@link SignalInformation}. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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> } callback - Indicates the callback for getting + * the instance list of the child classes derived from {@link SignalInformation}. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function getSignalInformation(slotId: number, callback: AsyncCallback>): void; + + /** + * Obtains the list of signal strength information of the registered network corresponding to a specified SIM card. + * + * @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> } Returns the callback for getting the instance list of + * the child classes derived from {@link SignalInformation}. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function getSignalInformation(slotId: number): Promise>; /** * Checks whether the device supports 5G New Radio (NR). * - * @returns Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. + * @returns { boolean } Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. + * @syscap SystemCapability.Telephony.CoreService * @since 7 * @deprecated since 9 * @useinstead telephony.radio#isNRSupported @@ -351,9 +786,10 @@ declare namespace radio { /** * Checks whether the device supports 5G New Radio (NR) by according card slot. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. - * @returns Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. + * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot + * index number supported by the device. + * @returns { boolean } Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. + * @syscap SystemCapability.Telephony.CoreService * @since 8 * @deprecated since 9 * @useinstead telephony.radio#isNRSupported @@ -363,7 +799,8 @@ declare namespace radio { /** * Checks whether the device supports 5G New Radio (NR). * - * @returns Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. + * @returns { boolean } Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. + * @syscap SystemCapability.Telephony.CoreService * @since 9 */ function isNRSupported(): boolean; @@ -371,9 +808,10 @@ declare namespace radio { /** * Checks whether the device supports 5G New Radio (NR) by according card slot. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number - * supported by the device. - * @returns Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. + * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot + * index number supported by the device. + * @returns { boolean } Returns {@code true} if the device supports 5G NR; returns {@code false} otherwise. + * @syscap SystemCapability.Telephony.CoreService * @since 9 */ function isNRSupported(slotId: number): boolean; @@ -381,149 +819,349 @@ declare namespace radio { /** * Checks whether the radio service is enabled. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns {@code true} If the radio service is enabled; returns {@code false} otherwise. * @permission ohos.permission.GET_NETWORK_INFO - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Returns {@code true} If the radio service is enabled. + * Returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function isRadioOn(callback: AsyncCallback): void; + + /** + * Checks whether the radio service is enabled. + * + * @permission ohos.permission.GET_NETWORK_INFO + * @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 } callback - Returns {@code true} If the radio service is enabled. + * Returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function isRadioOn(slotId: number, callback: AsyncCallback): void + + /** + * Checks whether the radio service is enabled. + * + * @permission ohos.permission.GET_NETWORK_INFO + * @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 } Returns {@code true} If the radio service is enabled; returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function isRadioOn(slotId?: number): Promise; /** * Turn on the radio service. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of turnOnRadio. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ function turnOnRadio(callback: AsyncCallback): void; + + /** + * Turn on the radio service. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @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 } callback - The callback of turnOnRadio. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function turnOnRadio(slotId: number, callback: AsyncCallback): void; + + /** + * Turn on the radio service. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @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 } The promise returned by the turnOnRadio. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function turnOnRadio(slotId?: number): Promise; /** * Turn off the radio service. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - The callback of turnOffRadio. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ function turnOffRadio(callback: AsyncCallback): void; + + /** + * Turn off the radio service. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @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 } callback - The callback of turnOffRadio. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function turnOffRadio(slotId: number, callback: AsyncCallback): void; + + /** + * Turn off the radio service. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @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 } The promise returned by the turnOffRadio. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function turnOffRadio(slotId?: number): Promise; /** * Get the operator name of the specified SIM card slot. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns operator name. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the operator name. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function getOperatorName(slotId: number, callback: AsyncCallback): void; + + /** + * Get the operator name of the specified SIM card slot. + * + * @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 } Returns the operator name. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function getOperatorName(slotId: number): Promise; /** * Set the preferred network for the specified SIM card slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param networkMode Indicates that you want to set the preferred network mode. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { PreferredNetworkMode } networkMode - Indicates that you want to set the preferred network mode. + * @param { AsyncCallback } callback - The callback of setPreferredNetwork. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode, callback: AsyncCallback): void; + + /** + * Set the preferred network for the specified SIM card slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { PreferredNetworkMode } networkMode - Indicates that you want to set the preferred network mode. + * @returns { Promise } The promise returned by the setPreferredNetwork. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise; /** * Get the preferred network for the specified SIM card slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the preferred network mode to obtain. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - Indicates the callback for getting + * the preferred network mode to obtain. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getPreferredNetwork(slotId: number, callback: AsyncCallback): void; + + /** + * Get the preferred network for the specified SIM card slot. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the callback for getting the preferred network mode to obtain. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getPreferredNetwork(slotId: number): Promise; /** * 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. - * @param imsType Indicates the ims service type of the {@link ImsServiceType}. - * @param callback Returns an instance of the {@link ImsRegInfo} class. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. + * @param { AsyncCallback } callback - Indicates an instance of the {@link ImsRegInfo} class. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 9 */ function getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback): void; + + /** + * Get the IMS registration state info of specified IMS service type. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. + * @param { AsyncCallback } callback - Indicates the callback for getting an instance of + * the {@link ImsRegInfo} class. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ function getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise; /** - * Called when the IMS registration state of specified IMS service type corresponding - * to a monitored {@code slotId} updates. + * 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, - * 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 - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. + * @param { Callback } callback - Indicates the callback for getting an instance of + * the {@link ImsRegInfo} class. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 9 */ @@ -533,150 +1171,488 @@ declare namespace radio { /** * Unsubscribe from imsRegStateChange event. * - * @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 - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. + * @param { Callback } callback - Indicates the callback for getting + * an instance of the {@link ImsRegInfo} class. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 9 */ function off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback?: Callback): void; /** + * Indicates the preferred network. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export enum PreferredNetworkMode { + /** + * Preferred GSM network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_GSM = 1, + + /** + * Preferred WCDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_WCDMA = 2, + + /** + * Preferred LTE mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_LTE = 3, + + /** + * Preferred LTE/WCDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_LTE_WCDMA = 4, + + /** + * Preferred LTE/WCDMA/GSM network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM = 5, + + /** + * Preferred WCDMA/GSM network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_WCDMA_GSM = 6, + + /** + * Preferred CDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_CDMA = 7, + + /** + * Preferred EVDO network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_EVDO = 8, + + /** + * Preferred EVDO/CDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_EVDO_CDMA = 9, + + /** + * Preferred WCDMA/GSM/EVDO/CDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_WCDMA_GSM_EVDO_CDMA = 10, + + /** + * Preferred LTE/EVDO/CDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_LTE_EVDO_CDMA = 11, + + /** + * Preferred LTE/WCDMA/GSM/EVDO/CDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM_EVDO_CDMA = 12, + + /** + * Preferred TDSCDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_TDSCDMA = 13, + + /** + * Preferred TDSCDMA/GSM network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_TDSCDMA_GSM = 14, + + /** + * Preferred TDSCDMA/WCDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA = 15, + + /** + * Preferred TDSCDMA/WCDMA/GSM network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM = 16, + + /** + * Preferred LTE/TDSCDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_LTE_TDSCDMA = 17, + + /** + * Preferred LTE/TDSCDMA/GSM network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM = 18, + + /** + * Preferred LTE/TDSCDMA/WCDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA = 19, + + /** + * Preferred LTE/TDSCDMA/WCDMA/GSM network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM = 20, + + /** + * Preferred TDSCDMA/WCDMA/GSM/EVDO/CDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 21, + + /** + * Preferred LTE/TDSCDMA/WCDMA/GSM/EVDO/CDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 22, + + /** + * Preferred NR network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR = 31, + + /** + * Preferred NR/LTE network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR_LTE = 32, + + /** + * Preferred NR/LTE/WCDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR_LTE_WCDMA = 33, + + /** + * Preferred NR/LTE/WCDMA/GSM network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM = 34, + + /** + * Preferred NR/LTE/EVDO/CDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR_LTE_EVDO_CDMA = 35, + + /** + * Preferred NR/LTE/WCDMA/GSM/EVDO/CDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM_EVDO_CDMA = 36, + + /** + * Preferred NR/LTE/TDSCDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA = 37, + + /** + * Preferred NR/LTE/TDSCDMA/GSM network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_GSM = 38, + + /** + * Preferred NR/LTE/TDSCDMA/WCDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA = 39, + + /** + * Preferred NR/LTE/TDSCDMA/WCDMA/GSM network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM = 40, + + /** + * Preferred NR/LTE/TDSCDMA/WCDMA/GSM/EVDO/CDMA network mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA = 41, + + /** + * Preferred network mode Maximum. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PREFERRED_NETWORK_MODE_MAX_VALUE = 99, } /** * Describes the radio access technology. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ export enum RadioTechnology { /** * Indicates unknown radio access technology (RAT). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_UNKNOWN = 0, /** * Indicates that RAT is global system for mobile communications (GSM), including GSM, general packet * radio system (GPRS), and enhanced data rates for GSM evolution (EDGE). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_GSM = 1, /** * Indicates that RAT is code division multiple access (CDMA), including Interim Standard 95 (IS95) and * Single-Carrier Radio Transmission Technology (1xRTT). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_1XRTT = 2, /** * Indicates that RAT is wideband code division multiple address (WCDMA). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_WCDMA = 3, /** * Indicates that RAT is high-speed packet access (HSPA), including HSPA, high-speed downlink packet * access (HSDPA), and high-speed uplink packet access (HSUPA). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_HSPA = 4, /** * Indicates that RAT is evolved high-speed packet access (HSPA+), including HSPA+ and dual-carrier * HSPA+ (DC-HSPA+). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_HSPAP = 5, /** * Indicates that RAT is time division-synchronous code division multiple access (TD-SCDMA). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_TD_SCDMA = 6, /** * Indicates that RAT is evolution data only (EVDO), including EVDO Rev.0, EVDO Rev.A, and EVDO Rev.B. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_EVDO = 7, /** * Indicates that RAT is evolved high rate packet data (EHRPD). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_EHRPD = 8, /** * Indicates that RAT is long term evolution (LTE). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_LTE = 9, /** * Indicates that RAT is LTE carrier aggregation (LTE-CA). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_LTE_CA = 10, /** * Indicates that RAT is interworking WLAN (I-WLAN). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_IWLAN = 11, /** * Indicates that RAT is 5G new radio (NR). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ RADIO_TECHNOLOGY_NR = 12 } + /** + * Returns child class objects specific to the network type. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ export interface SignalInformation { /** * Obtains the network type corresponding to the signal. + * + * @type { NetworkType } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ signalType: NetworkType; /** * Obtains the signal level of the current network. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ signalLevel: number; /** * rsrp for LTE and NR; dbm for CDMA and EVDO; rscp for WCDMA; rssi for GSM. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService * @since 9 */ dBm: number; @@ -684,89 +1660,135 @@ declare namespace radio { /** * Describes the network type. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ export enum NetworkType { /** * Indicates unknown network type. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NETWORK_TYPE_UNKNOWN, /** * Indicates that the network type is GSM. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NETWORK_TYPE_GSM, /** * Indicates that the network type is CDMA. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NETWORK_TYPE_CDMA, /** * Indicates that the network type is WCDMA. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NETWORK_TYPE_WCDMA, /** * Indicates that the network type is TD-SCDMA. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NETWORK_TYPE_TDSCDMA, /** * Indicates that the network type is LTE. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NETWORK_TYPE_LTE, /** * Indicates that the network type is 5G NR. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NETWORK_TYPE_NR } /** * Describes the network registration state. + * + * @interface NetworkState + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ export interface NetworkState { /** * Obtains the operator name in the long alphanumeric format of the registered network. - * - * @returns Returns the operator name in the long alphanumeric format as a string; + *

          + * Returns the operator name in the long alphanumeric format as a string; * returns an empty string if no operator name is obtained. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ longOperatorName: string; /** * Obtains the operator name in the short alphanumeric format of the registered network. - * - * @returns Returns the operator name in the short alphanumeric format as a string; + *

          + * Returns the operator name in the short alphanumeric format as a string; * returns an empty string if no operator name is obtained. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ shortOperatorName: string; /** * Obtains the PLMN code of the registered network. + *

          + * 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. + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ plmnNumeric: string; /** * Checks whether the device is roaming. * - * @returns Returns {@code true} if the device is roaming; returns {@code false} otherwise. + * @type { boolean } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ isRoaming: boolean; /** * Obtains the network registration status of the device. * - * @returns Returns the network registration status {@code RegState}. + * @type { RegState } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ regState: RegState; /** * Obtains the radio Access technology after config conversion. * - * @returns Returns the radio Access technology {@code RadioTechnology}. + * @type { RadioTechnology } + * @syscap SystemCapability.Telephony.CoreService * @since 8 */ cfgTech: RadioTechnology; @@ -774,338 +1796,1035 @@ declare namespace radio { /** * Obtains the NSA network registration status of the device. * - * @returns Returns the NSA network registration status {@code NsaState}. + *

          Returns the NSA network registration status {@code NsaState}. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ nsaState: NsaState; /** * Obtains the status of CA. * - * @returns Returns {@code true} if CA is actived; returns {@code false} otherwise. + *

          Returns {@code true} if CA is actived; returns {@code false} otherwise. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ isCaActive: boolean; /** * Checks whether 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 true} if this device is allowed to make emergency calls only; * returns {@code false} otherwise. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ isEmergency: boolean; } /** * Describes the network registration state. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ export enum RegState { /** * Indicates a state in which a device cannot use any service. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ REG_STATE_NO_SERVICE = 0, /** * Indicates a state in which a device can use services properly. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ REG_STATE_IN_SERVICE = 1, /** * Indicates a state in which a device can use only the emergency call service. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ REG_STATE_EMERGENCY_CALL_ONLY = 2, /** * Indicates that the cellular radio is powered off. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ REG_STATE_POWER_OFF = 3 } /** * Describes the nsa state. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ export enum NsaState { /** * Indicates that a device is idle under or is connected to an LTE cell that does not support NSA. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NSA_STATE_NOT_SUPPORT = 1, /** * Indicates that a device is idle under an LTE cell supporting NSA but not NR coverage detection. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NSA_STATE_NO_DETECT = 2, /** * Indicates that a device is connected to an LTE network under an LTE cell * that supports NSA and NR coverage detection. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NSA_STATE_CONNECTED_DETECT = 3, /** * Indicates that a device is idle under an LTE cell supporting NSA and NR coverage detection. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NSA_STATE_IDLE_DETECT = 4, /** * Indicates that a device is connected to an LTE + NR network under an LTE cell that supports NSA. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NSA_STATE_DUAL_CONNECTED = 5, /** * Indicates that a device is idle under or is connected to an NG-RAN cell while being attached to 5GC. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ NSA_STATE_SA_ATTACHED = 6 } /** + * Obtains current cell information. + * + * @interface CellInformation + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface CellInformation { /** * Obtains the network type of the serving cell. + *

          + * An application can call this method to determine the network type that the child class uses. * - *

          An application can call this method to determine the network type that the child class uses. - * - * @returns Returns the the network type of the serving cell. + * @type { NetworkType } + * @syscap SystemCapability.Telephony.CoreService + * @since 8 */ networkType: NetworkType; /** * Obtains the camp-on status of the serving cell. + *

          + * Returns {@code true} if the user equipment (UE) is camped on the cell; returns {@code false} otherwise. * - * @returns Returns {@code true} if the user equipment (UE) is camped on the cell; returns - * {@code false} otherwise. + * @type { boolean } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 */ isCamped: boolean; /** * Obtains the timestamp when the cell information is obtained. + *

          + * Returns a timestamp since boot, in nanoseconds. * - * @returns Returns a timestamp since boot, in nanoseconds. + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 */ timeStamp: number; /** * An abstract method of the parent class whose implementation depends on the child classes. * Returned child class objects vary according to the network type. + *

          + * Returns child class objects specific to the network type. * - * @returns Returns child class objects specific to the network type. + * @type { SignalInformation } + * @syscap SystemCapability.Telephony.CoreService + * @since 8 */ signalInformation: SignalInformation; + /** + * Obtains signal strength under different network formats. + * + * @type { CdmaCellInformation | GsmCellInformation | LteCellInformation | NrCellInformation + * | TdscdmaCellInformation | WcdmaCellInformation } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ data: CdmaCellInformation | GsmCellInformation | LteCellInformation | NrCellInformation | TdscdmaCellInformation - | WcdmaCellInformation; + | WcdmaCellInformation; } /** + * Obtains CDMA cell information. + * + * @interface CdmaCellInformation + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface CdmaCellInformation { + /** + * Indicates the base station Id. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ baseId: number; + + /** + * Indicates the latitude. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ latitude: number; + + /** + * Indicates the longitude. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ longitude: number; + + /** + * Indicates the network identification code. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ nid: number; + + /** + * Indicates the system identification code. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ sid: number; } /** + * Obtains GSM cell information. + * + * @interface GsmCellInformation + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface GsmCellInformation { + /** + * Indicates the location area code. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ lac: number; + + /** + * Indicates the cell identification. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ cellId: number; + + /** + * Indicates the ARFCN(absolute radio frequency channel number). + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ arfcn: number; + + /** + * Indicates the base station identification code. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ bsic: number; + + /** + * Indicates the mobile country code. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ mcc: string; + + /** + * Indicates the mobile network code. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ mnc: string; } /** + * Obtains LTE cell information. + * + * @interface LteCellInformation + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface LteCellInformation { + /** + * Indicates the cell global identification. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ cgi: number; + + /** + * Indicates the physical cell identification. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ pci: number; + + /** + * Indicates the tracking area code. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ tac: number; + + /** + * Indicates the E-UTRA Absolute Radio Frequency Channel Number. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ earfcn: number; + + /** + * Indicates the bandwidth. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ bandwidth: number; + + /** + * Indicates the mobile country code. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ mcc: string; + + /** + * Indicates the mobile network code. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ mnc: string; + + /** + * Support for New Radio_Dual Connectivity. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ isSupportEndc: boolean; } /** + * Obtains NR cell information. + * + * @interface NrCellInformation + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface NrCellInformation { + /** + * Indicates the NR-ARFCN(NR Absolute Radio Frequency Channel Number). + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ nrArfcn: number; + + /** + * Indicates the physical cell identification. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ pci: number; + + /** + * Indicates the tracking area code. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ tac: number; + + /** + * Indicates the 5G network cell ID. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ nci: number; + + /** + * Indicates the mobile country code. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ mcc: string; + + /** + * Indicates the mobile network code. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ mnc: string; } /** + * Obtains TDSCDMA cell information. + * + * @interface TdscdmaCellInformation + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface TdscdmaCellInformation { + /** + * Indicates the location area code. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ lac: number; + + /** + * Indicates the cell ID. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ cellId: number; + + /** + * Indicates the cell parameter ID. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ cpid: number; + + /** + * Indicates the absolute radio frequency number. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ uarfcn: number; + + /** + * Indicates the mobile country code. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ mcc: string; + + /** + * Indicates the mobile network code. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ mnc: string; } /** + * Obtains WCDMA cell information. + * + * @interface WcdmaCellInformation + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface WcdmaCellInformation { + /** + * Indicates the location area code. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ lac: number; + + /** + * Indicates the cell ID. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ cellId: number; + + /** + * Indicates the primary scrambling code. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ psc: number; + + /** + * Indicates the absolute radio frequency number. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ uarfcn: number; + + /** + * Indicates the mobile country code. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ mcc: string; + + /** + * Indicates the mobile network code. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ mnc: string; } /** + * Obtains the option mode of NR. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export enum NrOptionMode { - /** Indicates unknown NR networking mode. */ + /** + * Indicates unknown NR networking mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ NR_OPTION_UNKNOWN, - /** Indicates that the NR networking mode is NSA only. */ + /** + * Indicates that the NR networking mode is NSA only. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ NR_OPTION_NSA_ONLY, - /** Indicates that the NR networking mode is SA only. */ + /** + * Indicates that the NR networking mode is SA only. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ NR_OPTION_SA_ONLY, - /** Indicates that the NR networking mode is NSA and SA. */ + /** + * Indicates that the NR networking mode is NSA and SA. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ NR_OPTION_NSA_AND_SA, } /** + * Obtains the network search results. + * + * @interface NetworkSearchResult + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. + * @since 6 */ export interface NetworkSearchResult { + /** + * Indicates whether the network search was successful. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ isNetworkSearchSuccess: boolean; + + /** + * Obtains the network search results. + * + * @type { Array } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ networkSearchResult: Array; } /** + * Obtains the network information. + * + * @interface NetworkInformation + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. + * @since 6 */ export interface NetworkInformation { + /** + * Indicates the name of the operator. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ operatorName: string; + + /** + * Indicates the number of the operator. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ operatorNumeric: string; + + /** + * Indicates the status of network information. + * + * @type { NetworkInformationState } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ state: NetworkInformationState; + + /** + * Indicates the radio Technology. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ radioTech: string; } /** + * Obtains network information status. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. + * @since 6 */ export enum NetworkInformationState { - /** Indicates that the network state is unknown. */ + /** + * Indicates that the network state is unknown. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ NETWORK_UNKNOWN, - /** Indicates that the network is available for registration. */ + /** + * Indicates that the network is available for registration. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ NETWORK_AVAILABLE, - /** Indicates that you have already registered with the network. */ + /** + * Indicates that you have already registered with the network. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ NETWORK_CURRENT, - /** Indicates that the network is unavailable for registration. */ + /** + * Indicates that the network is unavailable for registration. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ NETWORK_FORBIDDEN } /** + * Obtains the network selection mode option. + * + * @interface NetworkSelectionModeOptions + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. + * @since 6 */ export interface NetworkSelectionModeOptions { + /** + * Indicates the card slot index number, ranging from 0 to + * the maximum card slot index number supported by the device. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ slotId: number; + + /** + * Indicates the network search mode of the SIM card. + * + * @type { NetworkSelectionMode } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ selectMode: NetworkSelectionMode; + + /** + * Indicates the network information. + * + * @type { NetworkInformation } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ networkInformation: NetworkInformation; + + /** + * Indicates whether to continue selecting the network selection mode. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ resumeSelection: boolean; } + /** + * Obtains the network selection mode. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ export enum NetworkSelectionMode { - /** Unknown network selection modes. */ + /** + * Indicates that the network is unavailable for registration. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ NETWORK_SELECTION_UNKNOWN, - /** Automatic network selection modes. */ + /** + * Indicates that the network is unavailable for registration. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ NETWORK_SELECTION_AUTOMATIC, - /** Manual network selection modes. */ + /** + * Manual network selection modes. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ NETWORK_SELECTION_MANUAL } /** + * Obtains IMS registration status. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 9 */ export enum ImsRegState { - /** Indicates that the ims service is not registered. */ + /** + * Indicates that the ims service is not registered. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ IMS_UNREGISTERED, - /** Indicates that the ims service has been registered. */ + /** + * Indicates that the ims service has been registered. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ IMS_REGISTERED, } /** + * Indicates IMS registration technology. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 9 */ export enum ImsRegTech { - /** Indicates that ims has no registered technology. */ + /** + * Indicates that ims has no registered technology. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ REGISTRATION_TECH_NONE, - /** Indicates that ims registers LTE technology. */ + /** + * Indicates that ims registers LTE technology. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ REGISTRATION_TECH_LTE, - /** Indicates that ims registers IWLAN technology. */ + /** + * Indicates that ims registers IWLAN technology. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ REGISTRATION_TECH_IWLAN, - /** Indicates that ims registers NR technology. */ + /** + * Indicates that ims registers NR technology. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ REGISTRATION_TECH_NR, } /** + * Indicates IMS registration information. + * + * @interface ImsRegInfo + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 9 */ export interface ImsRegInfo { - /** Indicates the registration status of the ims service. */ + /** + * Indicates the registration status of the ims service. + * + * @type { ImsRegState } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ imsRegState: ImsRegState; - /** Indicates the mode of ims radio technology. */ + /** + * Indicates the mode of ims radio technology. + * + * @type { ImsRegTech } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ imsRegTech: ImsRegTech; } /** + * Indicates the type of IMS service. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 9 */ export enum ImsServiceType { - /** Indicates voice service. */ + /** + * Indicates voice service. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ TYPE_VOICE, - /** Indicates video service. */ + /** + * Indicates video service. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ TYPE_VIDEO, - /** Indicates UT service. */ + /** + * Indicates UT service. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ TYPE_UT, - /** Indicates SMS service. */ + /** + * Indicates SMS service. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 + */ TYPE_SMS, } } diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 312bad587..872975029 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -19,63 +19,129 @@ import { AsyncCallback } from "./@ohos.base"; * Provides applications with APIs for obtaining SIM card status, card file information, and card specifications. * SIM cards include SIM, USIM, and CSIM cards. * - * @since 6 + * @namespace sim * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ declare namespace sim { /** * Checks whether the SIM card in a specified slot is activated. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from {@code 0} to the maximum card slot index number supported by the device. - * @param callback Returns {@code true} if the SIM card is activated; returns {@code false} otherwise. + * @param { AsyncCallback } callback - Indicates the callback for checking + * whether the SIM card in a specified slot is activated. + * Returns {@code true} if the SIM card is activated; returns {@code false} otherwise. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function isSimActive(slotId: number, callback: AsyncCallback): void; + + /** + * Checks whether the SIM card in a specified slot is activated. + * + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @returns { Promise } Returns {@code true} if the SIM card is activated; returns {@code false} otherwise. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function isSimActive(slotId: number): Promise; /** * Obtains the default card slot for the voice service. * - * @param callback Returns {@code 0} if card 1 is used as the default card slot for the voice service; + * @param { AsyncCallback } callback - Indicates the callback for getting + * the default card slot for the voice service. + * Returns {@code 0} if card 1 is used as the default card slot for the voice service; * returns {@code 1} if card 2 is used as the default card slot for the voice service; * returns {@code -1} if no card is available for the voice service. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function getDefaultVoiceSlotId(callback: AsyncCallback): void; + + /** + * Obtains the default card slot for the voice service. + * + * @returns { Promise } Returns {@code 0} if card 1 is used as the default card slot for the voice service; + * returns {@code 1} if card 2 is used as the default card slot for the voice service; + * returns {@code -1} if no card is available for the voice service. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function getDefaultVoiceSlotId(): Promise; /** * Checks whether your application (the caller) has been granted the operator permissions. * - * @param slotId Indicates the ID of the SIM card slot. - * @param callback Returns {@code true} if your application has been granted the operator permissions; - * returns {@code false} otherwise. If no SIM card is inserted or the SIM card is deactivated - * will be return {@code false}. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @param { AsyncCallback } callback - Indicates the callback of hasOperatorPrivileges. + * Returns {@code true} if your application has been granted the operator permissions; returns {@code false} otherwise. + * If no SIM card is inserted or the SIM card is deactivated will be return {@code false}. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function hasOperatorPrivileges(slotId: number, callback: AsyncCallback): void; + + /** + * Checks whether your application (the caller) has been granted the operator permissions. + * + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @returns { Promise } Returns {@code true} if your application has been granted the operator permissions; + * returns {@code false} otherwise. If no SIM card is inserted or the SIM card is deactivated will be + * return {@code false}. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function hasOperatorPrivileges(slotId: number): Promise; /** * Obtains the ISO country code of the SIM card in a specified slot. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the country code defined in ISO 3166-2; returns an empty string if no SIM card is inserted. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the country code defined + * in ISO 3166-2; returns an empty string if no SIM card is inserted. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ function getISOCountryCodeForSim(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the ISO country code of the SIM card in a specified slot. + * + * @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 } callback - Indicates the callback for getting the country code defined + * in ISO 3166-2; returns an empty string if no SIM card is inserted. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ function getISOCountryCodeForSim(slotId: number): Promise; /** @@ -84,17 +150,39 @@ declare namespace sim { *

          The value is recorded in the SIM card and is irrelevant to the network * with which the SIM card is currently registered. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the PLMN number; returns an empty string if no SIM card is inserted. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the PLMN number; + * returns an empty string if no SIM card is inserted. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ function getSimOperatorNumeric(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the home PLMN number of the SIM card in a specified slot. + * + *

          The value is recorded in the SIM card and is irrelevant to the network + * with which the SIM card is currently registered. + * + * @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 } Returns the PLMN number; returns an empty string if no SIM card is inserted. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ function getSimOperatorNumeric(slotId: number): Promise; /** @@ -103,26 +191,48 @@ declare namespace sim { *

          The value is recorded in the EFSPN file of the SIM card and is irrelevant to the network * with which the SIM card is currently registered. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the SPN; returns an empty string if no SIM card is inserted or - * no EFSPN file in the SIM card. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the SPN; + * returns an empty string if no SIM card is inserted or no EFSPN file in the SIM card. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ function getSimSpn(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the service provider name (SPN) of the SIM card in a specified slot. + * + *

          The value is recorded in the EFSPN file of the SIM card and is irrelevant to the network + * with which the SIM card is currently registered. + * + * @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 } Returns the SPN; returns an empty string if no SIM card is inserted or + * no EFSPN file in the SIM card. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ function getSimSpn(slotId: number): Promise; /** * Obtains the state of the SIM card in a specified slot. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from {@code 0} to the maximum card slot index number supported by the device. - * @param callback Returns one of the following SIM card states: + * @param { AsyncCallback } callback - Indicates the callback for getting one of the following SIM card states: *

            *
          • {@code SimState#SIM_STATE_UNKNOWN} *
          • {@code SimState#SIM_STATE_NOT_PRESENT} @@ -131,29 +241,72 @@ declare namespace sim { *
          • {@code SimState#SIM_STATE_READY} *
          • {@code SimState#SIM_STATE_LOADED} *
          - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ function getSimState(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the state of the SIM card in a specified slot. + * + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @returns { Promise } Returns one of the following SIM card states: + *
            + *
          • {@code SimState#SIM_STATE_UNKNOWN} + *
          • {@code SimState#SIM_STATE_NOT_PRESENT} + *
          • {@code SimState#SIM_STATE_LOCKED} + *
          • {@code SimState#SIM_STATE_NOT_READY} + *
          • {@code SimState#SIM_STATE_READY} + *
          • {@code SimState#SIM_STATE_LOADED} + *
          + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ function getSimState(slotId: number): Promise; /** * Obtains the type of the SIM card installed in a specified slot. * - * @param slotId Indicates the ID of the specified slot. - * @param callback Returns the SIM card type. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @param { AsyncCallback } callback - Indicates the callback for getting the SIM card type. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function getCardType(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the type of the SIM card installed in a specified slot. + * + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @returns { Promise } Returns the SIM card type. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function getCardType(slotId: number): Promise; /** @@ -162,136 +315,284 @@ declare namespace sim { *

          The ICCID is a unique identifier of a SIM card. It consists of 20 digits * and is recorded in the EFICCID file of the SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the ICCID; returns an empty string if no SIM card is inserted. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - Indicates the callback for getting the ICCID; + * returns an empty string if no SIM card is inserted. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ function getSimIccId(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the ICCID of the SIM card in a specified slot. + * + *

          The ICCID is a unique identifier of a SIM card. It consists of 20 digits + * and is recorded in the EFICCID file of the SIM card. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the ICCID; returns an empty string if no SIM card is inserted. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function getSimIccId(slotId: number): Promise; /** * Obtains the alpha identifier of the voice mailbox of the SIM card in a specified slot. * - * @param slotId Indicates the card slot index number, - * ranging from {@code 0} to the maximum card slot index number supported by the device. - * @param callback Returns the voice mailbox alpha identifier; - * returns an empty string if no voice mailbox alpha identifier is written into the SIM card. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @param { AsyncCallback } callback - Indicates the callback for getting the voice mailbox alpha identifier; + * returns an empty string if no voice mailbox alpha identifier is written into the SIM card. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getVoiceMailIdentifier(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the alpha identifier of the voice mailbox of the SIM card in a specified slot. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @returns { Promise } Returns the voice mailbox alpha identifier; + * returns an empty string if no voice mailbox alpha identifier is written into the SIM card. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getVoiceMailIdentifier(slotId: number): Promise; /** * Obtains the voice mailbox number of the SIM card in a specified slot. * - * @param slotId Indicates the card slot index number, - * ranging from {@code 0} to the maximum card slot index number supported by the device. - * @param callback Returns the voice mailbox number; - * returns an empty string if no voice mailbox number is written into the SIM card. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @param { AsyncCallback } callback - Indicates the callback for getting the voice mailbox number; + * returns an empty string if no voice mailbox number is written into the SIM card. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getVoiceMailNumber(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the voice mailbox number of the SIM card in a specified slot. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @returns { Promise } Returns the voice mailbox number. + * returns an empty string if no voice mailbox number is written into the SIM card. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ 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 - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @param { string } mailName - Indicates the name of voice mail. + * @param { string } mailNumber - Indicates the number of voice mail. + * @param { AsyncCallback } callback - The callback of setVoiceMailInfo. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback: AsyncCallback): void; + + /** + * Sets the voice mail information. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from {@code 0} to the maximum card slot index number supported by the device. + * @param { string } mailName - Indicates the name of voice mail. + * @param { string } mailNumber - Indicates the number of voice mail. + * @returns { Promise } The promise returned by the setVoiceMailInfo. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string): Promise; /** * Obtains the MSISDN of the SIM card in a specified slot. * The MSISDN is recorded in the EFMSISDN file of the SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the MSISDN; returns an empty string if no SIM card is inserted or - * no MSISDN is recorded in the EFMSISDN file. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - Indicates the callback for getting the MSISDN; + * Returns an empty string if no SIM card is inserted or + * no MSISDN is recorded in the EFMSISDN file. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getSimTelephoneNumber(slotId: number, callback: AsyncCallback): void; + + /** + * 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 + * @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 } Returns the MSISDN; returns an empty string if no SIM card is inserted or + * no MSISDN is recorded in the EFMSISDN file. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getSimTelephoneNumber(slotId: number): Promise; /** * Obtains the Group Identifier Level 1 (GID1) of the SIM card in a specified slot. * The GID1 is recorded in the EFGID1 file of the SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the GID1; returns an empty string if no SIM card is inserted or - * no GID1 in the SIM card. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - Indicates the callback for getting the GID1; + * Returns an empty string if no SIM card is inserted or no GID1 in the SIM card. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ function getSimGid1(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the Group Identifier Level 1 (GID1) of the SIM card in a specified slot. + * The GID1 is recorded in the EFGID1 file of the SIM card. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the GID1; returns an empty string if no SIM card is inserted or + * no GID1 in the SIM card. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function getSimGid1(slotId: number): Promise; /** * Obtains the maximum number of SIM cards that can be used simultaneously on the device, * that is, the maximum number of SIM card slots. * - * @returns Returns the maximum number of SIM card slots. + * @returns { number } Returns the maximum number of SIM card slots. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function getMaxSimCount(): number; @@ -299,896 +600,2079 @@ declare namespace sim { /** * Get the international mobile subscriber ID. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the international mobile subscriber ID. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - Indicates the callback for getting + * the international mobile subscriber ID. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. + * @since 6 */ function getIMSI(slotId: number, callback: AsyncCallback): void; + + /** + * Get the international mobile subscriber ID. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the international mobile subscriber ID. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 6 + */ function getIMSI(slotId: number): Promise; /** * Checks whether a SIM card is inserted in a specified slot. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns true if a SIM card is inserted; return false otherwise. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for hasSimCard. + * Returns {@code true} if a SIM card is inserted; return {@code false} otherwise. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ function hasSimCard(slotId: number, callback: AsyncCallback): void; + + /** + * Checks whether a SIM card is inserted in a specified slot. + * + * @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 } Returns {@code true} if a SIM card is inserted; return {@code false} otherwise. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ function hasSimCard(slotId: number): Promise; /** * Get account information of SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns a {@code IccAccountInfo} object. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @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 } callback - Indicates the callback for + * getting a {@code IccAccountInfo} object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ function getSimAccountInfo(slotId: number, callback: AsyncCallback): void; + + /** + * Get account information of SIM card. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns a {@code IccAccountInfo} object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function getSimAccountInfo(slotId: number): Promise; /** * Get the list of active SIM card account information. * - * @param callback Returns a {@code IccAccountInfo} object. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback> } callback - The callback is used to + * return the array of {@link IccAccountInfo}. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getActiveSimAccountInfoList(callback: AsyncCallback>): void; + + /** + * Get the list of active SIM card account information. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @returns { Promise> } Returns the array of {@link IccAccountInfo}. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getActiveSimAccountInfoList(): Promise>; /** * Set the card slot ID of the default voice service. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301001 - SIM card is not activated. + * @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 } callback - The callback of setDefaultVoiceSlotId. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301001 - SIM card is not activated. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ function setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback): void; + + /** + * Set the card slot ID of the default voice service. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @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 } The promise returned by the setVoiceMailInfo. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301001 - SIM card is not activated. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function setDefaultVoiceSlotId(slotId: number): Promise; /** * Activate the SIM card in the specified slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - The callback of activateSim. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function activateSim(slotId: number, callback: AsyncCallback): void; + + /** + * Activate the SIM card in the specified slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @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 } The promise returned by the activateSim. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function activateSim(slotId: number): Promise; /** * Disable SIM card in specified slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - The callback of deactivateSim. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function deactivateSim(slotId: number, callback: AsyncCallback): void; + + /** + * Disable SIM card in specified slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @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 } The promise returned by the deactivateSim. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function deactivateSim(slotId: number): Promise; /** * Set the SIM card display name of the specified card slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param name Indicates SIM card name. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } name - Indicates SIM card name. + * @param { AsyncCallback } callback - The callback of setShowName. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function setShowName(slotId: number, name: string, callback: AsyncCallback): void; + + /** + * Set the SIM card display name of the specified card slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } name - Indicates SIM card name. + * @returns { Promise } The promise returned by the setShowName. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function setShowName(slotId: number, name: string): Promise; /** * Gets the name of the SIM card in the specified slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns SIM card name. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - Indicates the callback for getting the SIM card name. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getShowName(slotId: number, callback: AsyncCallback): void; + + /** + * Gets the name of the SIM card in the specified slot. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the SIM card name. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getShowName(slotId: number): Promise; /** * Set the SIM card number in the specified slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param number Indicates SIM card number. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } number - Indicates SIM card number. + * @param { AsyncCallback } callback - The callback of setShowNumber. + * + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function setShowNumber(slotId: number, number: string, callback: AsyncCallback): void; + + /** + * Set the SIM card number in the specified slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } number - Indicates SIM card number. + * @returns { Promise } The promise returned by the setShowNumber. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function setShowNumber(slotId: number, number: string): Promise; /** * Get the SIM card number of the specified card slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns SIM card number. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - Indicates the callback for getting the SIM card number. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getShowNumber(slotId: number, callback: AsyncCallback): void; + + /** + * Get the SIM card number of the specified card slot. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the SIM card number. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ 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. - * @returns Returns the operatorconfigs in a specified slot; returns empty OperatorConfig - * if no SIM card is inserted * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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> } callback - Indicates the callback for + * getting the operatorconfigs in a specified slot; + * returns empty OperatorConfig if no SIM card is inserted. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getOperatorConfigs(slotId: number, callback: AsyncCallback>): void; + + /** + * Obtains the operatorconfigs of the SIM card in a specified slot. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @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> } Returns the operatorconfigs in a specified slot; + * returns empty OperatorConfig if no SIM card is inserted. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getOperatorConfigs(slotId: number): Promise>; /** * Unlock the SIM card password of the specified card slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param pin Indicates the password of the SIM card. - * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } pin - Indicates the password of the SIM card. + * @param { AsyncCallback } callback - Indicates the callback for getting + * the response to obtain the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ function unlockPin(slotId: number, pin: string, callback: AsyncCallback): void; + + /** + * Unlock the SIM card password of the specified card slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } pin - Indicates the password of the SIM card. + * @returns { Promise } Returns the response to obtain + * the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function unlockPin(slotId: number, pin: string): Promise; /** * Unlock the SIM card password in the specified card slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param newPin Indicates to reset the SIM card password. - * @param puk Indicates the unlock password of the SIM card password. - * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } newPin - Indicates to reset the SIM card password. + * @param { string } puk - Indicates the unlock password of the SIM card password. + * @param { AsyncCallback } callback - Indicates the callback for getting + * the response to obtain the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ function unlockPuk(slotId: number, newPin: string, puk: string, callback: AsyncCallback): void; + + /** + * Unlock the SIM card password in the specified card slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } newPin - Indicates to reset the SIM card password. + * @param { string } puk - Indicates the unlock password of the SIM card password. + * @returns { Promise } Returns the response to obtain + * the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function unlockPuk(slotId: number, newPin: string, puk: string): Promise; /** * Change Pin Password. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param newPin Indicates a new password. - * @param oldPin Indicates old password. - * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } newPin - Indicates a new password. + * @param { string } oldPin - Indicates old password. + * @param { AsyncCallback } callback - Indicates the callback for getting + * the response to obtain the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ function alterPin(slotId: number, newPin: string, oldPin: string, callback: AsyncCallback): void; + + /** + * Change Pin Password. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } newPin - Indicates a new password. + * @param { string } oldPin - Indicates old password. + * @returns { Promise } Returns the response to obtain + * the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function alterPin(slotId: number, newPin: string, oldPin: string): Promise; /** * Set the lock status of the SIM card in the specified slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param options Indicates lock information. - * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { LockInfo } options - Indicates lock information. + * @param { AsyncCallback } callback - Indicates the callback for getting + * the response to obtain the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ function setLockState(slotId: number, options: LockInfo, callback: AsyncCallback): void; + + /** + * Set the lock status of the SIM card in the specified slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { LockInfo } options - Indicates lock information. + * @returns { Promise } Returns the response to obtain + * the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 + */ function setLockState(slotId: number, options: LockInfo): Promise; /** * Unlock the SIM card password of the specified card slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param pin2 Indicates the password of the SIM card. - * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } pin2 - Indicates the password of the SIM card. + * @param { AsyncCallback } callback - Indicates the callback for getting + * the response to obtain the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function unlockPin2(slotId: number, pin2: string, callback: AsyncCallback): void; + + /** + * Unlock the SIM card password of the specified card slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } pin2 - Indicates the password of the SIM card. + * @returns { Promise } Returns the response to obtain + * the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function unlockPin2(slotId: number, pin2: string): Promise; /** * Unlock the SIM card password in the specified card slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param newPin2 Indicates to reset the SIM card password. - * @param puk2 Indicates the unlock password of the SIM card password. - * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } newPin2 - Indicates to reset the SIM card password. + * @param { string } puk2 - Indicates the unlock password of the SIM card password. + * @param { AsyncCallback } callback - Indicates the callback for getting + * the response to obtain the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function unlockPuk2(slotId: number, newPin2: string, puk2: string, callback: AsyncCallback): void; + + /** + * Unlock the SIM card password in the specified card slot. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } newPin2 - Indicates to reset the SIM card password. + * @param { string } puk2 - Indicates the unlock password of the SIM card password. + * @returns { Promise } Returns the response to obtain + * the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function unlockPuk2(slotId: number, newPin2: string, puk2: string): Promise; /** * Change Pin2 password. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param newPin2 Indicates a new password. - * @param oldPin2 Indicates old password. - * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } newPin2 - Indicates a new password. + * @param { string } oldPin2 - Indicates old password. + * @param { AsyncCallback } callback - Indicates the callback for getting + * the response to obtain the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function alterPin2(slotId: number, newPin2: string, oldPin2: string, callback: AsyncCallback): void; + + /** + * Change Pin2 password. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } newPin2 - Indicates a new password. + * @param { string } oldPin2 - Indicates old password. + * @returns { Promise } Returns the response to obtain + * the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function alterPin2(slotId: number, newPin2: string, oldPin2: string): Promise; /** * Query dialing number information on SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param type Indicates contact type. - * @param callback Return dialing number information. * @permission ohos.permission.READ_CONTACTS - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ContactType } type - Indicates contact type. + * @param { AsyncCallback> } callback - Indicates the callback for + * getting the dialing number information. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function queryIccDiallingNumbers(slotId: number, type: ContactType, callback: AsyncCallback>): void + + /** + * Query dialing number information on SIM card. + * + * @permission ohos.permission.READ_CONTACTS + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ContactType } type - Indicates contact type. + * @returns { Promise> } Returns the dialing number information. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function queryIccDiallingNumbers(slotId: number, type: ContactType): Promise>; /** * Add dialing number information to SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param type Indicates contact type. - * @param diallingNumbers Indicates dialing number information. * @permission ohos.permission.WRITE_CONTACTS - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ContactType } type - Indicates contact type. + * @param { DiallingNumbersInfo } diallingNumbers - Indicates dialing number information. + * @param { AsyncCallback } callback - The callback of addIccDiallingNumbers. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback): void; + + /** + * Add dialing number information to SIM card. + * + * @permission ohos.permission.WRITE_CONTACTS + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ContactType } type - Indicates contact type. + * @param { DiallingNumbersInfo } diallingNumbers - Indicates dialing number information. + * @returns { Promise } The promise returned by the addIccDiallingNumbers. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise; /** * Delete dialing number information on SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param type Indicates contact type. - * @param diallingNumbers Indicates dialing number information. * @permission ohos.permission.WRITE_CONTACTS - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ContactType } type - Indicates contact type. + * @param { DiallingNumbersInfo } diallingNumbers - Indicates dialing number information. + * @param { AsyncCallback } callback - The callback of delIccDiallingNumbers. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback): void; + + /** + * Delete dialing number information on SIM card. + * + * @permission ohos.permission.WRITE_CONTACTS + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ContactType } type - Indicates contact type. + * @param { DiallingNumbersInfo } diallingNumbers - Indicates dialing number information. + * @returns { Promise } The promise returned by the delIccDiallingNumbers. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise; /** * Update dialing number information on SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param type Indicates contact type. - * @param diallingNumbers Indicates dialing number information. * @permission ohos.permission.WRITE_CONTACTS - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ContactType } type - Indicates contact type. + * @param { DiallingNumbersInfo } diallingNumbers - Indicates dialing number information. + * @param { AsyncCallback } callback - The callback of updateIccDiallingNumbers. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback): void; + + /** + * Update dialing number information on SIM card. + * + * @permission ohos.permission.WRITE_CONTACTS + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { ContactType } type - Indicates contact type. + * @param { DiallingNumbersInfo } diallingNumbers - Indicates dialing number information. + * @returns { Promise } The promise returned by the updateIccDiallingNumbers. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise; /** * Get the lock status of the SIM card in the specified slot. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param lockType Indicates the lock type. - * @param callback Returns sim card lock status. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { LockType } lockType - Indicates the lock type. + * @param { AsyncCallback } callback - Indicates the callback for getting the sim card lock status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function getLockState(slotId: number, lockType: LockType, callback: AsyncCallback): void; + + /** + * Get the lock status of the SIM card in the specified slot. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { LockType } lockType - Indicates the lock type. + * @returns { Promise } Returns the sim card lock status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function getLockState(slotId: number, lockType: LockType): Promise; /** * Send envelope command to SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param cmd Indicates sending command. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } cmd - Indicates sending command. + * @param { AsyncCallback } callback - The callback of sendEnvelopeCmd. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function sendEnvelopeCmd(slotId: number, cmd: string, callback: AsyncCallback): void; + + /** + * Send envelope command to SIM card. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } cmd - Indicates sending command. + * @returns { Promise } The promise returned by the sendEnvelopeCmd. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function sendEnvelopeCmd(slotId: number, cmd: string): Promise; /** * Send terminal response command to SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param cmd Indicates sending command. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } cmd - Indicates sending command. + * @param { AsyncCallback } callback - The callback of sendTerminalResponseCmd. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function sendTerminalResponseCmd(slotId: number, cmd: string, callback: AsyncCallback): void; + + /** + * Send terminal response command to SIM card. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { string } cmd - Indicates sending command. + * @returns { Promise } The promise returned by the sendTerminalResponseCmd. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function sendTerminalResponseCmd(slotId: number, cmd: string): Promise; /** * Unlock SIM card. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param lockInfo Indicates customized lock type information. - * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. - * @throws {BusinessError} 8301002 - SIM card operation error. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { PersoLockInfo } lockInfo - Indicates customized lock type information. + * @param { AsyncCallback } callback - Indicates the callback used to obtain a response + * to obtain the SIM card lock status for the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ function unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback): void; + + /** + * Unlock SIM card. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { PersoLockInfo } lockInfo - Indicates customized lock type information. + * @returns { Promise } Returns the response to obtain + * the SIM card lock status of the specified card slot. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @throws { BusinessError } 8301002 - SIM card operation error. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ function unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise; /** * Obtains the operator key of the SIM card in a specified slot. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the operator key; returns an empty string if no SIM card is inserted or - * no operator key matched. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the operator key; + * Returns an empty string if no SIM card is inserted or no operator key matched. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @since 9 */ function getOpKey(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the operator key of the SIM card in a specified slot. + * + * @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 } Returns the operator key; + * Returns an empty string if no SIM card is inserted or no operator key matched. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 9 + */ function getOpKey(slotId: number): Promise; /** * Obtains the operator name of the SIM card in a specified slot. * - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns the operator name; returns an empty string if no SIM card is inserted or - * no operator name matched. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting the operator name; + * Returns an empty string if no SIM card is inserted or no operator name matched. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService * @since 9 */ function getOpName(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the operator name of the SIM card in a specified slot. + * + * @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 } Returns the operator name; returns an empty string if no SIM card is inserted or + * no operator name matched. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @since 9 + */ function getOpName(slotId: number): Promise; /** + * Defines the carrier configuration. + * + * @interface OperatorConfig + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface OperatorConfig { + /** + * Indicates the field. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ field: string; + + /** + * Indicates the value. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ value: string; } /** + * Defines the ICC account information. + * + * @interface IccAccountInfo + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ export interface IccAccountInfo { /** - * sim Id for card. + * Indicates the sim Id for card. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 */ simId: number; + /** - * slot id. + * Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 */ slotIndex: number; + /** - * mark card is eSim or not. + * Indicates the mark card is eSim or not. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 */ isEsim: boolean; + /** - * active status for card. + * Indicates the active status for card. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 */ isActive: boolean; + /** - * iccId for card. + * Indicates the iccId for card. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 */ iccId: string; + /** - * display name for card. + * Indicates the display name for card. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 */ showName: string; + /** - * display number for card. + * Indicates the display number for card. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 */ showNumber: string; } /** + * Defines the personalized lock information. + * + * @interface LockStatusResponse + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 7 */ export interface LockStatusResponse { /** - * Current operation result + * Indicates the current operation result. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 */ result: number; + /** - * Operations remaining + * Indicates the operations remaining. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 7 */ remain?: number; } /** + * Defines the contact number information. + * + * @interface DiallingNumbersInfo + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface DiallingNumbersInfo { + /** + * Indicates the tag. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ alphaTag: string; + + /** + * Indicates the call transfer number. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ number: string; + + /** + * Indicates the record number. + * + * @type { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ recordNumber?: number; + + /** + * Indicates the PIN 2. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ pin2?: string; } /** + * Defines the personalized lock information. + * + * @interface LockInfo + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface LockInfo { + /** + * Indicates the lock type. + * + * @type { LockType } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ lockType: LockType; + + /** + * Indicates the password. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ password: string; + + /** + * Indicates the lock state. + * + * @type { LockState } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ state: LockState; } /** + * Defines the personalized lock information. + * + * @interface PersoLockInfo + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export interface PersoLockInfo { + /** + * Indicates the personalized lock type. + * + * @type { PersoLockType } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ lockType: PersoLockType; + + /** + * Indicates the password. + * + * @type { string } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ password: string; } /** + * Indicates the lock types. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export enum LockType { + /** + * Indicates the SIM card password lock. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PIN_LOCK = 1, + + /** + * Indicates the fixed dialing lock. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ FDN_LOCK = 2, } /** + * Indicates the SIM card types. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @since 7 */ export enum CardType { - /** Icc card type: unknown type Card. */ + /** + * Icc card type: unknown type Card. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ UNKNOWN_CARD = -1, - /** Icc card type: Single sim card type. */ + /** + * Icc card type: Single sim card type. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ SINGLE_MODE_SIM_CARD = 10, - /** Icc card type: Single usim card type. */ + /** + * Icc card type: Single usim card type. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ SINGLE_MODE_USIM_CARD = 20, - /** Icc card type: Single ruim card type. */ + /** + * Icc card type: Single ruim card type. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ SINGLE_MODE_RUIM_CARD = 30, - /** Icc card type: Double card C+G. */ + /** + * Icc card type: Double card C+G. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ DUAL_MODE_CG_CARD = 40, - /** Icc card type: China Telecom Internal Roaming Card (Dual Mode). */ + /** + * Icc card type: China Telecom Internal Roaming Card (Dual Mode). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ CT_NATIONAL_ROAMING_CARD = 41, - /** Icc card type: China Unicom Dual Mode Card. */ + /** + * Icc card type: China Unicom Dual Mode Card. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ CU_DUAL_MODE_CARD = 42, - /** Icc card type: China Telecom LTE Card (Dual Mode). */ + /** + * Icc card type: China Telecom LTE Card (Dual Mode). + * + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ DUAL_MODE_TELECOM_LTE_CARD = 43, - /** Icc card type: Double card U+G. */ + /** + * Icc card type: Double card U+G. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 7 + */ DUAL_MODE_UG_CARD = 50, /** * Icc card type: Single isim card type. + * @syscap SystemCapability.Telephony.CoreService * @since 8 */ SINGLE_MODE_ISIM_CARD = 60 } + /** + * Indicates the SIM card states. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService + * @since 6 + */ export enum SimState { /** - * Indicates unknown SIM card state, that is, the accurate status cannot be obtained. + * Indicates unknown SIM card state, that is, the accurate status cannot be + * obtained. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ SIM_STATE_UNKNOWN, /** - * Indicates that the SIM card is in the not present state, that is, no SIM card is inserted - * into the card slot. + * Indicates that the SIM card is in the not present state, that is, + * no SIM card is inserted into the card slot. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ SIM_STATE_NOT_PRESENT, /** - * Indicates that the SIM card is in the locked state, that is, the SIM card is locked by the - * personal identification number (PIN)/PIN unblocking key (PUK) or network. + * Indicates that the SIM card is in the locked state, that is, the + * SIM card is locked by the personal identification number (PIN)/PIN + * unblocking key (PUK) or network. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ SIM_STATE_LOCKED, /** - * Indicates that the SIM card is in the not ready state, that is, the SIM card is in position - * but cannot work properly. + * Indicates that the SIM card is in the not ready state, that is, + * the SIM card is in position but cannot work properly. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ SIM_STATE_NOT_READY, /** - * Indicates that the SIM card is in the ready state, that is, the SIM card is in position and - * is working properly. + * Indicates that the SIM card is in the ready state, that is, the + * SIM card is in position and is working properly. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ SIM_STATE_READY, /** - * Indicates that the SIM card is in the loaded state, that is, the SIM card is in position and - * is working properly. + * Indicates that the SIM card is in the loaded state, that is, the + * SIM card is in position and is working properly. + * + * @syscap SystemCapability.Telephony.CoreService + * @since 6 */ SIM_STATE_LOADED } /** + * Indicates the lock states. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export enum LockState { - /**Indicates that the lock state card is in the off state. */ + /** + * Indicates that the lock state card is in the off state. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ LOCK_OFF = 0, - /**Indicates that the lock state card is in the on state. */ + /** + * Indicates that the lock state card is in the on state. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ LOCK_ON = 1, } /** + * Indicates the contact types. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export enum ContactType { + /** + * Indicates the common contact number. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ GENERAL_CONTACT = 1, + + /** + * Indicates the fixed dialing number. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ FIXED_DIALING = 2, } /** + * Indicates the personalized lock types. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 */ export enum PersoLockType { - PN_PIN_LOCK, //Network Personalization (refer 3GPP TS 22.022 [33]) + /** + * Indicates network personalization of PIN lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ + PN_PIN_LOCK, + + /** + * Indicates network personalization of PUK lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PN_PUK_LOCK, - PU_PIN_LOCK, //Network Subset Personalization (refer 3GPP TS 22.022 [33]) + + /** + * Indicates network subset personalization of PIN lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ + PU_PIN_LOCK, + + /** + * Indicates network subset personalization of PUK lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PU_PUK_LOCK, - PP_PIN_LOCK, //Service Provider Personalization (refer 3GPP TS 22.022 [33]) + + /** + * Indicates service provider personalization of PIN lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ + PP_PIN_LOCK, + + /** + * Indicates service provider personalization of PUK lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PP_PUK_LOCK, - PC_PIN_LOCK, //Corporate Personalization (refer 3GPP TS 22.022 [33]) + + /** + * Indicates corporate personalization of PIN lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ + PC_PIN_LOCK, + + /** + * Indicates corporate personalization of PUK lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ PC_PUK_LOCK, - SIM_PIN_LOCK, //SIM/USIM Personalization (refer 3GPP TS 22.022 [33]) + + /** + * Indicates SIM/USIM personalization of PIN lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ + SIM_PIN_LOCK, + + /** + * Indicates SIM/USIM personalization of PUK lock(refer 3GPP TS 22.022 [33]). + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 8 + */ SIM_PUK_LOCK, } /** + * Indicates the carrier configuration keys. + * + * @enum { string } + * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 9 */ export enum OperatorConfigKey { /** * Indicates the voice mail number. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_VOICE_MAIL_NUMBER_STRING = "voice_mail_number_string", + /** * Indicates the status of ims switch. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_IMS_SWITCH_ON_BY_DEFAULT_BOOL = "ims_switch_on_by_default_bool", + /** * Indicates whether the ims switch status is hidden. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_HIDE_IMS_SWITCH_BOOL = "hide_ims_switch_bool", + /** * Indicates whether volte mode is supported. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_VOLTE_SUPPORTED_BOOL = "volte_supported_bool", + /** * Indicates the list supported by nr mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_NR_MODE_SUPPORTED_LIST_INT_ARRAY = "nr_mode_supported_list_int_array", + /** * Indicates whether VOLTE supports configuration. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_VOLTE_PROVISIONING_SUPPORTED_BOOL = "volte_provisioning_supported_bool", + /** * Indicates whether SS service supports UT. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_SS_OVER_UT_SUPPORTED_BOOL = "ss_over_ut_supported_bool", + /** * Indicates whether the IMS requires GBA. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_IMS_GBA_REQUIRED_BOOL = "ims_gba_required_bool", + /** * Indicates whether UT configuration is supported. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_UT_PROVISIONING_SUPPORTED_BOOL = "ut_provisioning_supported_bool", + /** * Indicates the ims emergency preference. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_IMS_PREFER_FOR_EMERGENCY_BOOL = "ims_prefer_for_emergency_bool", + /** * Indicates call waiting service. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_CALL_WAITING_SERVICE_CLASS_INT = "call_waiting_service_class_int", + /** * Indicates call forwarding visibility. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_CALL_TRANSFER_VISIBILITY_BOOL = "call_transfer_visibility_bool", + /** * Indicates the list of ims call end reasons. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ - KEY_IMS_CALL_DISCONNECT_REASON_INFO_MAPPING_STRING_ARRAY = "ims_call_disconnect_reason_info_mapping_string_array", + KEY_IMS_CALL_DISCONNECT_REASON_INFO_MAPPING_STRING_ARRAY = + "ims_call_disconnect_reason_info_mapping_string_array", + /** * Indicates the forced Volte switch on state. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_FORCE_VOLTE_SWITCH_ON_BOOL = "force_volte_switch_on_bool", + /** * Indicates whether the operator name is displayed. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_ENABLE_OPERATOR_NAME_CUST_BOOL = "enable_operator_name_cust_bool", + /** * Indicates the name of the operator. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_OPERATOR_NAME_CUST_STRING = "operator_name_cust_string", + /** * Indicates the spn display rule. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_SPN_DISPLAY_CONDITION_CUST_INT = "spn_display_condition_cust_int", + /** * Indicates the PLMN name. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_PNN_CUST_STRING_ARRAY = "pnn_cust_string_array", + /** * Indicates operator PLMN information. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_OPL_CUST_STRING_ARRAY = "opl_cust_string_array", + /** * Indicates the emergency call list. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 9 */ KEY_EMERGENCY_CALL_STRING_ARRAY = "emergency_call_string_array", } diff --git a/api/@ohos.telephony.sms.d.ts b/api/@ohos.telephony.sms.d.ts index 7f9d7a121..7f4e35b46 100644 --- a/api/@ohos.telephony.sms.d.ts +++ b/api/@ohos.telephony.sms.d.ts @@ -18,30 +18,56 @@ import { AsyncCallback } from "./@ohos.base"; /** * Provides the capabilities and methods for obtaining Short Message Service (SMS) management objects. * - * @since 6 + * @namespace sms * @syscap SystemCapability.Telephony.SmsMms + * @since 6 */ declare namespace sms { /** * Splits a long SMS message into multiple fragments. * *

          If the length of an SMS message exceeds the maximum length allowed (140 bytes), - * the SMS message is split into multiple segments for processing. + * the SMS message is split into multiple segments for processing. * - * @param content Indicates the short message content, which cannot be {@code null}. - * @param callback Returns a list of split segments, which can be combined into a complete SMS message; - * returns an empty string if no permission is granted or the short message content is {@code null}. * @permission ohos.permission.SEND_MESSAGES - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } content - Indicates the short message content, which cannot be {@code null}. + * @param { AsyncCallback> } callback - Indicates the callback for getting a list of split segments, + * which can be combined into a complete SMS message; + * returns an empty string if no permission is granted or the short message content is {@code null}. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ function splitMessage(content: string, callback: AsyncCallback>): void; + + /** + * Splits a long SMS message into multiple fragments. + * + *

          If the length of an SMS message exceeds the maximum length allowed (140 bytes), + * the SMS message is split into multiple segments for processing. + * + * @permission ohos.permission.SEND_MESSAGES + * @param { string } content - Indicates the short message content, which cannot be {@code null}. + * @returns { Promise> } Returns a list of split segments, which can be combined into a complete SMS + * message; returns an empty string if no permission is granted or the short message content is {@code null}. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ function splitMessage(content: string): Promise>; /** @@ -50,18 +76,40 @@ declare namespace sms { *

          After receiving the original PDU data, the system creates an SMS message instance according to the specified * SMS protocol. * - * @param pdu Indicates the original data, which is obtained from the received SMS. - * @param specification Indicates the SMS protocol type. The value {@code 3gpp} indicates GSM/UMTS/LTE SMS, - * and the value {@code 3gpp2} indicates CDMA/LTE SMS. - * @param callback Returns an SMS message instance; returns {@code null} if {@code pdu} is empty or - * {@code specification} is not supported. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { Array } pdu - Indicates the original data, which is obtained from the received SMS. + * @param { string } specification - Indicates the SMS protocol type. The value {@code 3gpp} indicates GSM/UMTS/LTE + * SMS, and the value {@code 3gpp2} indicates CDMA/LTE SMS. + * @param { AsyncCallback } callback - Indicates the callback for getting an SMS message instance; + * returns {@code null} if {@code pdu} is empty or {@code specification} is not supported. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 */ function createMessage(pdu: Array, specification: string, callback: AsyncCallback): void; + + /** + * Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. + * + *

          After receiving the original PDU data, the system creates an SMS message instance according to the specified + * SMS protocol. + * + * @param { Array } pdu - Indicates the original data, which is obtained from the received SMS. + * @param { string } specification - Indicates the SMS protocol type. The value {@code 3gpp} indicates GSM/UMTS/LTE + * SMS, and the value {@code 3gpp2} indicates CDMA/LTE SMS. + * @returns { Promise } Returns an SMS message instance; + * returns {@code null} if {@code pdu} is empty or {@code specification} is not supported. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ function createMessage(pdu: Array, specification: string): Promise; /** @@ -70,14 +118,16 @@ declare namespace sms { *

          This method checks whether the length of an SMS message exceeds the maximum length. If the * maximum length is exceeded, the SMS message is split into multiple parts and sent separately. * - * @param options Indicates the parameters and callback for sending the SMS message. * @permission ohos.permission.SEND_MESSAGES - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { SendMessageOptions } options - Indicates the parameters and callback for sending the SMS message. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 */ function sendMessage(options: SendMessageOptions): void; @@ -85,677 +135,2569 @@ declare namespace sms { * Sets the default SIM card for sending SMS messages. You can obtain the default SIM card by * using {@code getDefaultSmsSlotId}. * - * @param slotId Indicates the default SIM card for sending SMS messages. The value {@code 0} indicates card slot 1, - * and the value {@code 1} indicates card slot 2. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300004 - Do not have sim card. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the default SIM card for sending SMS messages. The value {@code 0} indicates + * card slot 1, and the value {@code 1} indicates card slot 2. + * @param { AsyncCallback } callback - The callback of setDefaultSmsSlotId. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ function setDefaultSmsSlotId(slotId: number, callback: AsyncCallback): void; + + /** + * Sets the default SIM card for sending SMS messages. You can obtain the default SIM card by + * using {@code getDefaultSmsSlotId}. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the default SIM card for sending SMS messages. The value {@code 0} indicates + * card slot 1, and the value {@code 1} indicates card slot 2. + * @returns { Promise } The promise returned by the setDefaultSmsSlotId. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300004 - Do not have sim card. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ function setDefaultSmsSlotId(slotId: number): Promise; /** * Obtains the default SIM card for sending SMS messages. * - * @param callback Returns {@code 0} if the default SIM card for sending SMS messages is in card slot 1; - * returns {@code 1} if the default SIM card for sending SMS messages is in card slot 2. + * @param { AsyncCallback } callback - Indicates the callback for getting the default SIM card for sending SMS + * messages. + * Returns {@code 0} if the default SIM card for sending SMS messages is in card slot 1; + * returns {@code 1} if the default SIM card for sending SMS messages is in card slot 2. + * @syscap SystemCapability.Telephony.SmsMms * @since 7 */ function getDefaultSmsSlotId(callback: AsyncCallback): void; + + /** + * Obtains the default SIM card for sending SMS messages. + * + * @returns { Promise } Returns {@code 0} if the default SIM card for sending SMS messages is in card slot 1; + * returns {@code 1} if the default SIM card for sending SMS messages is in card slot 2. + * @syscap SystemCapability.Telephony.SmsMms + * @since 7 + */ function getDefaultSmsSlotId(): Promise; /** * Sets the address for the Short Message Service Center (SMSC) based on a specified slot ID. * - * @param slotId Indicates the ID of the slot holding the SIM card for sending SMS messages. - * @param smscAddr Indicates the SMSC address. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. + * @param { string } smscAddr - Indicates the SMSC address. + * @param { AsyncCallback } callback - The callback of setSmscAddr. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ function setSmscAddr(slotId: number, smscAddr: string, callback: AsyncCallback): void; + + /** + * Sets the address for the Short Message Service Center (SMSC) based on a specified slot ID. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. + * @param { string } smscAddr - Indicates the SMSC address. + * @returns { Promise } The promise returned by the setSmscAddr. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ function setSmscAddr(slotId: number, smscAddr: string): Promise; /** * Obtains the SMSC address based on a specified slot ID. * - * @param slotId Indicates the ID of the slot holding the SIM card for sending SMS messages. - * @param callback Returns the SMSC address. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. + * @param { AsyncCallback } callback - Indicates the callback for getting the SMSC address. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ function getSmscAddr(slotId: number, callback: AsyncCallback): void; + + /** + * Obtains the SMSC address based on a specified slot ID. + * + * @permission ohos.permission.GET_TELEPHONY_STATE + * @param { number } slotId - Indicates the ID of the slot holding the SIM card for sending SMS messages. + * @returns { Promise } Returns the SMSC address. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ function getSmscAddr(slotId: number): Promise; /** * Returns whether a 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. + * @returns { boolean } Returns {@code true} if the device is capable of sending and receiving SMS messages; + * returns {@code false} otherwise. + * @syscap SystemCapability.Telephony.SmsMms * @since 7 */ function hasSmsCapability(): boolean; /** - * Add a SMS Message to SIM card. + * Add an SMS Message to SIM card. * - * @param options Indicates SIM message options. * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { SimMessageOptions } options - Indicates SIM message options. + * @param { AsyncCallback } callback - The callback of addSimMessage. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ function addSimMessage(options: SimMessageOptions, callback: AsyncCallback): void; + + /** + * Add an SMS Message to SIM card. + * + * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES + * @param { SimMessageOptions } options - Indicates SIM message options. + * @returns { Promise } The promise returned by the addSimMessage. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ function addSimMessage(options: SimMessageOptions): Promise; /** - * Delete a SMS Message from the SIM card. + * Delete an SMS Message from the SIM card. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number supported by the device. - * @param msgIndex Indicates the message index. * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index + * number supported by the device. + * @param { number } msgIndex - Indicates the message index. + * @param { AsyncCallback } callback - The callback of delSimMessage. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ function delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback): void; + + /** + * Delete an SMS Message from the SIM card. + * + * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES + * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index + * number supported by the device. + * @param { number } msgIndex - Indicates the message index. + * @returns { Promise } The promise returned by the delSimMessage. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ function delSimMessage(slotId: number, msgIndex: number): Promise; /** * Update a SIM SMS of SIM card. * - * @param options Update SIM message options. * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } options - Indicates update SIM message options. + * @param { AsyncCallback } callback - The callback of updateSimMessage. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ function updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback): void; + + /** + * Update a SIM SMS of SIM card. + * + * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES + * @param { number } options - Indicates update SIM message options. + * @returns { Promise } The promise returned by the updateSimMessage. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ function updateSimMessage(options: UpdateSimMessageOptions): Promise; /** * Get all SMS records in SIM. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns a {@code SimShortMessage} object. * @permission ohos.permission.RECEIVE_SMS - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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> } callback - Indicates the callback for getting a + * {@code SimShortMessage} object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ function getAllSimMessages(slotId: number, callback: AsyncCallback>): void; + + /** + * Get all SMS records in SIM. + * + * @permission ohos.permission.RECEIVE_SMS + * @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> } Returns a {@code SimShortMessage} object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ function getAllSimMessages(slotId: number): Promise>; /** * Turn on or off Cell BroadCast. * - * @param options Cell broadcast configuration options. * @permission ohos.permission.RECEIVE_SMS - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { CBConfigOptions } options - Indicates cell broadcast configuration options. + * @param { AsyncCallback } callback - The callback of setCBConfig. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ function setCBConfig(options: CBConfigOptions, callback: AsyncCallback): void; + + /** + * Turn on or off Cell BroadCast. + * + * @permission ohos.permission.RECEIVE_SMS + * @param { CBConfigOptions } options - Indicates cell broadcast configuration options. + * @returns { Promise } The promise returned by the setCBConfig. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ function setCBConfig(options: CBConfigOptions): Promise; /** - * Get a SMS segment encode relation information. + * Get an SMS segment encode relation information. * - * @param slotId Indicates the card slot index number, ranging from 0 to the maximum card slot index number supported by the device. - * @param message Indicates short message. - * @param force7bit Whether to use 7 bit encoding. - * @param callback Returns a {@code SmsSegmentsInfo} object. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index + * number supported by the device. + * @param { string } message - Indicates short message. + * @param { boolean } force7bit - Indicates whether to use 7 bit encoding. + * @param { AsyncCallback } callback - Indicates the callback for getting a {@code SmsSegmentsInfo} + * object. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ function getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback: AsyncCallback): void; + + /** + * Get an SMS segment encode relation information. + * + * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index + * number supported by the device. + * @param { string } message - Indicates short message. + * @param { boolean } force7bit - Indicates whether to use 7 bit encoding. + * @returns { Promise } Returns a {@code SmsSegmentsInfo} object. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ function getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise; /** * 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. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } 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 { AsyncCallback } callback - Indicates the callback of isImsSmsSupported. + * Returns {@code true} if SMS over IMS is supported, {@code false} otherwise. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ function isImsSmsSupported(slotId: number, callback: AsyncCallback): void; + + /** + * SMS over IMS is supported if IMS is registered and SMS is supported on IMS. + * + * @param { number } 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. + * @returns { Promise } Returns {@code true} if SMS over IMS is supported, {@code false} otherwise. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ function isImsSmsSupported(slotId: number): Promise; /** * Gets SMS format supported on IMS. SMS over IMS format is either 3GPP or 3GPP2. * - * @param callback Returns format, 3gpp, 3gpp2 or unknown. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Indicates the callback for getting format, 3gpp, 3gpp2 or unknown. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ function getImsShortMessageFormat(callback: AsyncCallback): void; + + /** + * Gets SMS format supported on IMS. SMS over IMS format is either 3GPP or 3GPP2. + * + * @returns { Promise } Returns format, 3gpp, 3gpp2 or unknown. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ function getImsShortMessageFormat(): Promise; /** * Decode the message content. * - * @param mmsFilePathName Indicates the path name of the multimedia message file. - * @param callback Returns a {@code MmsInformation} object. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string | Array } mmsFilePathName - Indicates the path name of the multimedia message file. + * @param { AsyncCallback } callback - Indicates the callback for getting a {@code MmsInformation} + * object. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ function decodeMms(mmsFilePathName: string | Array, callback: AsyncCallback): void; + + /** + * Decode the message content. + * + * @param { string | Array } mmsFilePathName - Indicates the path name of the multimedia message file. + * @returns { Promise } Returns a {@code MmsInformation} object. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ function decodeMms(mmsFilePathName: string | Array): Promise; /** * Encode the message content. * - * @param mms MMS messages. - * @param callback Returns the result of MMS encoding. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { MmsInformation } mms - Indicates MMS messages. + * @param { AsyncCallback> } callback - Indicates the callback for getting the result of MMS encoding. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ function encodeMms(mms: MmsInformation, callback: AsyncCallback>): void; + + /** + * Encode the message content. + * + * @param { MmsInformation } mms - Indicates MMS messages. + * @returns { Promise> } Returns the result of MMS encoding. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ function encodeMms(mms: MmsInformation): Promise>; /** + * Defines the MMS message information. + * + * @interface MmsInformation + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsInformation { + /** + * Indicates the message type for the MMS message. + * + * @type { MessageType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ messageType: MessageType; + + /** + * Indicates the PDU header type for the MMS message. + * + * @type { MmsSendReq | MmsSendConf | MmsNotificationInd | MmsRespInd | MmsRetrieveConf | MmsAcknowledgeInd | + * MmsDeliveryInd | MmsReadOrigInd | MmsReadRecInd } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ mmsType: MmsSendReq | MmsSendConf | MmsNotificationInd | MmsRespInd | MmsRetrieveConf | MmsAcknowledgeInd | MmsDeliveryInd | MmsReadOrigInd | MmsReadRecInd; + + /** + * Indicates the attachment for the MMS message. + * + * @type { ?Array } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ attachment?: Array; } /** + * Defines an MMS message sending request. + * + * @interface MmsSendReq + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsSendReq { + /** + * Indicates the source address for the MMS message sending request. + * + * @type { MmsAddress } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ from: MmsAddress; + + /** + * Indicates the transaction ID for the MMS message sending request. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ transactionId: string; + + /** + * Indicates the content type for the MMS message sending request. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ contentType: string; + + /** + * Indicates the version for the MMS message sending request. + * + * @type { MmsVersionType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ version: MmsVersionType; + + /** + * Indicates the destination address for the MMS message sending request. + * + * @type { ?MmsAddress } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ to?: Array; + + /** + * Indicates the date for the MMS message sending request. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ date?: number; + + /** + * Indicates the carbon copy address for the MMS message sending request. + * + * @type { ?Array } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ cc?: Array; + + /** + * Indicates the blind carbon copy address for the MMS message sending request. + * + * @type { ?Array } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ bcc?: Array; + + /** + * Indicates the subject for the MMS message sending request. + * + * @type { ?string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ subject?: string; + + /** + * Indicates the message class for the MMS message sending request. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ messageClass?: number; + + /** + * Indicates the expiration for the MMS message sending request. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ expiry?: number; + + /** + * Indicates the priority for the MMS message sending request. + * + * @type { ?MmsPriorityType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ priority?: MmsPriorityType; + + /** + * Indicates the sender visibility for the MMS message sending request. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ senderVisibility?: number; + + /** + * Indicates the delivery report for the MMS message sending request. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ deliveryReport?: number; + + /** + * Indicates the read report for the MMS message sending request. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ readReport?: number; } /** + * Defines the MMS message sending configuration. + * + * @interface MmsSendConf + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsSendConf { + /** + * Indicates the response status for the MMS message sending configuration. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ responseState: number; + + /** + * Indicates the transaction ID for the MMS message sending configuration. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ transactionId: string; + + /** + * Indicates the version for the MMS message sending configuration. + * + * @type { MmsVersionType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ version: MmsVersionType; + + /** + * Indicates the message ID for the MMS message sending configuration. + * + * @type { ?string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ messageId?: string; } /** + * Defines an MMS notification indication. + * + * @interface MmsNotificationInd + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsNotificationInd { + /** + * Indicates the transaction ID for the MMS notification indication. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ transactionId: string; + + /** + * Indicates the message class for the MMS notification indication. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ messageClass: number; + + /** + * Indicates the message size for the MMS notification indication. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ messageSize: number; + + /** + * Indicates the expiration for the MMS notification indication. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ expiry: number; + + /** + * Indicates the content location for the MMS notification indication. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ contentLocation: string; + + /** + * Indicates the version for the MMS notification indication. + * + * @type { MmsVersionType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ version: MmsVersionType; + + /** + * Indicates the source address for the MMS notification indication. + * + * @type { ?MmsAddress } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ from?: MmsAddress; + + /** + * Indicates the subject for the MMS notification indication. + * + * @type { ?string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ subject?: string; + + /** + * Indicates the status report for the MMS notification indication. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ deliveryReport?: number; + + /** + * Indicates the content class for the MMS notification indication. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ contentClass?: number; } /** + * Defines an MMS response indication. + * + * @interface MmsRespInd + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsRespInd { + /** + * Indicates the event ID for the MMS response indication. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ transactionId: string; + + /** + * Indicates the status for the MMS response indication. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ status: number; + + /** + * Indicates the version for the MMS response indication. + * + * @type { MmsVersionType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ version: MmsVersionType; + + /** + * Indicates the report allowed for the MMS response indication. + * + * @type { ?ReportType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ reportAllowed?: ReportType; } /** + * Defines the MMS message retrieval configuration. + * + * @interface MmsRetrieveConf + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsRetrieveConf { + /** + * Indicates the transaction ID for the MMS message retrieval configuration. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ transactionId: string; + + /** + * Indicates the message ID for the MMS message retrieval configuration. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ messageId: string; + + /** + * Indicates the date for the MMS message retrieval configuration. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ date: number; + + /** + * Indicates the content type for the MMS message retrieval configuration. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ contentType: string; + + /** + * Indicates the destination address for the MMS message retrieval configuration. + * + * @type { MmsAddress } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ to: Array; + + /** + * Indicates the version for the MMS message retrieval configuration. + * + * @type { MmsVersionType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ version: MmsVersionType; + + /** + * Indicates the source address for the MMS message retrieval configuration. + * + * @type { ?MmsAddress } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ from?: MmsAddress; + + /** + * Indicates the carbon copy address for the MMS message retrieval configuration. + * + * @type { ?Array; + + /** + * Indicates the subject for the MMS message retrieval configuration. + * + * @type { ?string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ subject?: string; + + /** + * Indicates the priority for the MMS message retrieval configuration. + * + * @type { ?MmsPriorityType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ priority?: MmsPriorityType; + + /** + * Indicates the status report for the MMS message retrieval configuration. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ deliveryReport?: number; + + /** + * Indicates the read report for the MMS message retrieval configuration. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ readReport?: number; + + /** + * Indicates the retrieval status for the MMS message retrieval configuration. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ retrieveStatus?: number; + + /** + * Indicates the retrieval text for the MMS message retrieval configuration. + * + * @type { ?string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ retrieveText?: string; } /** + * Defines an MMS confirmation indication. + * + * @interface MmsAcknowledgeInd + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsAcknowledgeInd { + /** + * Indicates the transaction ID for the MMS confirmation indication. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ transactionId: string; + + /** + * Indicates the version for the MMS confirmation indication. + * + * @type { MmsVersionType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ version: MmsVersionType; + + /** + * Indicates the report allowed for the MMS confirmation indication. + * + * @type { ?ReportType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ reportAllowed?: ReportType; } /** + * Defines an MMS message delivery indication. + * + * @interface MmsDeliveryInd + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsDeliveryInd { + /** + * Indicates the message ID for the MMS message delivery indication. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ messageId: string; + + /** + * Indicates the date for the MMS message delivery indication. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ date: number; + + /** + * Indicates the destination address for the MMS message delivery indication. + * + * @type { MmsAddress } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ to: Array; + + /** + * Indicates the status for the MMS message delivery indication. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ status: number; + + /** + * Indicates the version for the MMS message delivery indication. + * + * @type { MmsVersionType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ version: MmsVersionType; } /** + * Defines the original MMS message reading indication. + * + * @interface MmsReadOrigInd + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsReadOrigInd { + /** + * Indicates the version for the original MMS message reading indication. + * + * @type { MmsVersionType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ version: MmsVersionType; + + /** + * Indicates the message ID for the original MMS message reading indication. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ messageId: string; + + /** + * Indicates the destination address for the original MMS message reading indication. + * + * @type { MmsAddress } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ to: Array; + + /** + * Indicates the source address for the original MMS message reading indication. + * + * @type { MmsAddress } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ from: MmsAddress; + + /** + * Indicates the date for the original MMS message reading indication. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ date: number; + + /** + * Indicates the read status for the original MMS message reading indication. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ readStatus: number; } /** + * Defines the MMS message reading indication. + * + * @interface MmsReadRecInd + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsReadRecInd { + /** + * Indicates the version for the MMS message reading indication. + * + * @type { MmsVersionType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ version: MmsVersionType; + + /** + * Indicates the message ID for the MMS message reading indication. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ messageId: string; + + /** + * Indicates the destination address for the MMS message reading indication. + * + * @type { MmsAddress } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ to: Array; + + /** + * Indicates the source address for the MMS message reading indication. + * + * @type { MmsAddress } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ from: MmsAddress; + + /** + * Indicates the read status for the MMS message reading indication. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ readStatus: number; + + /** + * Indicates the date for the MMS message reading indication. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ date?: number; } /** + * Defines the attachment of an MMS message. + * + * @interface MmsAttachment + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsAttachment { + /** + * Indicates the content ID for the attachment. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ contentId: string; + + /** + * Indicates the content location. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ contentLocation: string; + + /** + * Indicates the content location for the attachment. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ + contentLocation: string; + + /** + * Indicates the content disposition for the attachment. + * + * @type { DispositionType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ contentDisposition: DispositionType; + + /** + * Indicates the encoding for content transfer. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ contentTransferEncoding: string; + + /** + * Indicates the content type for the attachment. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ contentType: string; + + /** + * Indicates whether the synchronized multimedia integration language is used. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ isSmil: boolean; + + /** + * Indicates the path for the attachment. + * + * @type { ?string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ path?: string; + + /** + * Indicates whether the message is in the buffer. + * + * @type { ?Array } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ inBuff?: Array; + + /** + * Indicates the file name for the attachment. + * + * @type { ?string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ fileName?: string; + + /** + * Indicates the character set for the attachment. + * + * @type { ?MmsCharSets } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ charset?: MmsCharSets; } /** + * Defines an MMSC address. + * + * @interface MmsAddress + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface MmsAddress { + /** + * Indicates the network address for the MMSC address. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ address: string; + + /** + * Indicates the character set for the MMSC address. + * + * @type { MmsCharSets } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ charset: MmsCharSets; } /** + * Enumerates message type. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export enum MessageType { + /** + * Indicates an MMS message sending request. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ TYPE_MMS_SEND_REQ = 128, + + /** + * Indicates an MMS message sending configuration. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ TYPE_MMS_SEND_CONF, + + /** + * Indicates an MMS notification. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ TYPE_MMS_NOTIFICATION_IND, + + /** + * Indicates an MMS message response. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ TYPE_MMS_RESP_IND, + + /** + * Indicates an MMS message retrieval configuration. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ TYPE_MMS_RETRIEVE_CONF, + + /** + * Indicates the type of multimedia message confirmation index. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ TYPE_MMS_ACKNOWLEDGE_IND, + + /** + * Indicates an MMS message delivery. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ TYPE_MMS_DELIVERY_IND, + + /** + * Indicates an MMS message read report on the recipient side. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ TYPE_MMS_READ_REC_IND, + + /** + * Indicates an original MMS message read report on the originating side. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ TYPE_MMS_READ_ORIG_IND, } /** + * Enumerates MMS message priorities. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export enum MmsPriorityType { + /** + * Indicates low priority. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ MMS_LOW = 128, + + /** + * Indicates normal priority. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ MMS_NORMAL, + + /** + * Indicates high priority. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ MMS_HIGH, } /** + * Enumerates MMS versions. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export enum MmsVersionType { + /** + * Indicates MMS version 1_0. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ MMS_VERSION_1_0 = 0x10, + + /** + * Indicates MMS version 1_1. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ MMS_VERSION_1_1, + + /** + * Indicates MMS version 1_2. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ MMS_VERSION_1_2, + + /** + * Indicates MMS version 1_3. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ MMS_VERSION_1_3, } /** + * Enumerates MMS character sets. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export enum MmsCharSets { + /** + * Indicates the BIG5 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ BIG5 = 0X07EA, + + /** + * Indicates the ISO_10646_UCS_2 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ISO_10646_UCS_2 = 0X03E8, + + /** + * Indicates the ISO_8859_1 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ISO_8859_1 = 0X04, + + /** + * Indicates the ISO_8859_2 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ISO_8859_2, + + /** + * Indicates the ISO_8859_3 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ISO_8859_3, + + /** + * Indicates the ISO_8859_4 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ISO_8859_4, + + /** + * Indicates the ISO_8859_5 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ISO_8859_5, + + /** + * Indicates the ISO_8859_6 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ISO_8859_6, + + /** + * Indicates the ISO_8859_7 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ISO_8859_7, + + /** + * Indicates the ISO_8859_8 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ISO_8859_8, + + /** + * Indicates the ISO_8859_9 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ISO_8859_9, + + /** + * Indicates the SHIFT_JIS format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ SHIFT_JIS = 0X11, + + /** + * Indicates the US_ASCII format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ US_ASCII = 0X03, + + /** + * Indicates the UTF_8 format. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ UTF_8 = 0X6A, } /** + * Enumerates disposition types. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export enum DispositionType { + /** + * Indicates the data source type. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ FROM_DATA = 0, + + /** + * Indicates the attachment type. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ ATTACHMENT, + + /** + * Indicates the inlining type. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ INLINE, } /** + * Enumerates report types. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export enum ReportType { + /** + * Indicates that a report is required. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ MMS_YES = 128, + + /** + * Indicates that a report is not required. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ MMS_NO, } /** + * Defines the cell broadcast configuration options. + * + * @interface CBConfigOptions + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ export interface CBConfigOptions { + /** + * Indicates the card slot ID for the cell broadcast configuration options. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ slotId: number; + + /** + * Indicates whether to enable cell broadcast. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ enable: boolean; + + /** + * Indicates the start message ID for the cell broadcast configuration options. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ startMessageId: number; + + /** + * Indicates the end message ID for the cell broadcast configuration options. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ endMessageId: number; + + /** + * Indicates the RAN type for the cell broadcast configuration options. + * + * @type { RanType } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ ranType: RanType; } /** + * Defines the SIM message options. + * + * @interface SimMessageOptions + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ export interface SimMessageOptions { + /** + * Indicates the card slot ID for the SIM message options. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ slotId: number; + + /** + * Indicates the short message service center for the SIM message options. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ smsc: string; + + /** + * Indicates the protocol data unit for the SIM message options. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ pdu: string; + + /** + * Indicates the status for the SIM message options. + * + * @type { SimMessageStatus } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ status: SimMessageStatus; } /** + * Defines the updating SIM message options. + * + * @interface UpdateSimMessageOptions + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ export interface UpdateSimMessageOptions { + /** + * Indicates the card slot ID for the updating SIM message options. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ slotId: number; + + /** + * Indicates the message index for the updating SIM message options. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ msgIndex: number; + + /** + * Indicates the new status for the updating SIM message options. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ newStatus: SimMessageStatus; + + /** + * Indicates the protocol data unit for the updating SIM message options. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ pdu: string; + + /** + * Indicates the short message service center for the updating SIM message options. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ smsc: string; } + /** + * Defines an SMS message instance. + * + * @interface ShortMessage + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ export interface ShortMessage { - /** Indicates the SMS message body. */ + /** + * Indicates the SMS message body. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ visibleMessageBody: string; - /** Indicates the address of the sender, which is to be displayed on the UI. */ + + /** + * Indicates the address of the sender, which is to be displayed on the UI. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ visibleRawAddress: string; - /** Indicates the SMS type. */ + + /** + * Indicates the SMS type. + * + * @type { ShortMessageClass } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ messageClass: ShortMessageClass; - /** Indicates the protocol identifier. */ + + /** + * Indicates the protocol identifier. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ protocolId: number; - /** Indicates the short message service center (SMSC) address. */ + + /** + * Indicates the short message service center (SMSC) address. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ scAddress: string; - /** Indicates the SMSC timestamp. */ + + /** + * Indicates the SMSC timestamp. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ scTimestamp: number; - /** Indicates whether the received SMS is a "replace short message". */ + + /** + * Indicates whether the received SMS is a "replace short message". + * + * @type { boolean } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ isReplaceMessage: boolean; - /** Indicates whether the received SMS contains "TP-Reply-Path". */ + + /** + * Indicates whether the received SMS contains "TP-Reply-Path". + * + * @type { boolean } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ hasReplyPath: boolean; + + /** + * Indicates Protocol Data Units (PDUs) from an SMS message. + * + * @type { Array } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ /** Indicates Protocol Data Units (PDUs) from an SMS message. */ pdu: Array; + /** * Indicates the SMS message status from the SMS-STATUS-REPORT message sent by the * Short Message Service Center (SMSC). + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 */ status: number; - /** Indicates whether the current message is SMS-STATUS-REPORT. */ + + /** + * Indicates whether the current message is SMS-STATUS-REPORT. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ isSmsStatusReportMessage: boolean; } /** + * Defines a SIM message. + * + * @interface SimShortMessage + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ export interface SimShortMessage { + /** + * Indicates the SMS message in the SIM. + * + * @type { ShortMessage } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ shortMessage: ShortMessage; - /** Indicates the storage status of SMS messages in the SIM */ + /** + * Indicates the storage status of SMS messages in the SIM. + * + * @type { SimMessageStatus } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ simMessageStatus: SimMessageStatus; - /** Indicates the index of SMS messages in the SIM */ + + /** + * Indicates the index of SMS messages in the SIM. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ indexOnSim: number; } /** + * Defines the SIM message status. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ export enum SimMessageStatus { - /** status free space ON SIM */ + /** + * Status free space on SIM. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ SIM_MESSAGE_STATUS_FREE = 0, - /** REC READ received read message */ + + /** + * Indicates a read message. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ SIM_MESSAGE_STATUS_READ = 1, - /** REC UNREAD received unread message */ + + /** + * Indicates an unread message. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ SIM_MESSAGE_STATUS_UNREAD = 3, - /** STO SENT stored sent message (only applicable to SMs) */ + + /** + * Indicates a sent message (only applicable to SMs). + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ SIM_MESSAGE_STATUS_SENT = 5, - /** STO UNSENT stored unsent message (only applicable to SMs) */ + + /** + * Indicates an unsent message (only applicable to SMs). + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ SIM_MESSAGE_STATUS_UNSENT = 7, } + /** + * Enumerates SMS message types. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ export enum ShortMessageClass { - /** Indicates an unknown type. */ + /** + * Indicates an unknown type. + * + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ UNKNOWN, - /** Indicates an instant message, which is displayed immediately after being received. */ + + /** + * Indicates an instant message, which is displayed immediately after being received. + * + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ INSTANT_MESSAGE, - /** Indicates an SMS message that can be stored on the device or SIM card based on the storage status. */ + + /** + * Indicates an SMS message that can be stored on the device or SIM card based on the storage status. + * + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ OPTIONAL_MESSAGE, - /** Indicates an SMS message containing SIM card information, which is to be stored in a SIM card. */ + + /** + * Indicates an SMS message containing SIM card information, which is to be stored in a SIM card. + * + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ SIM_MESSAGE, - /** Indicates an SMS message to be forwarded to another device. */ + + /** + * Indicates an SMS message to be forwarded to another device. + * + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ FORWARD_MESSAGE } + /** + * Provides the options (including callbacks) for sending an SMS message. + * + * @interface SendMessageOptions + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ export interface SendMessageOptions { - /** Indicates the ID of the SIM card slot used for sending the SMS message. */ + /** + * Indicates the ID of the SIM card slot used for sending the SMS message. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ slotId: number; - /** Indicates the address to which the SMS message is sent. */ + + /** + * Indicates the address to which the SMS message is sent. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ destinationHost: string; - /** Indicates the SMSC address. If the value is {@code null}, the default SMSC address of the SIM card*/ + + /** + * Indicates the SMSC address. If the value is {@code null}, the default SMSC address of the SIM card. + * + * @type { ?string } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ serviceCenter?: string; - /** If the content is a string, this is a short message. If the content is a byte array, this is a data message. */ + + /** + * If the content is a string, this is a short message. If the content is a byte array, this is a data message. + * + * @type { string | Array } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ content: string | Array; - /** If send data message, destinationPort is mandatory. Otherwise is optional. */ + + /** + * If send data message, destinationPort is mandatory. Otherwise is optional. + * + * @type { ?number } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ destinationPort?: number; - /** Indicates the callback invoked after the SMS message is sent. */ + + /** + * Indicates the callback invoked after the SMS message is sent. + * + * @type { ?AsyncCallback } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ sendCallback?: AsyncCallback; - /** Indicates the callback invoked after the SMS message is delivered. */ + + /** + * Indicates the callback invoked after the SMS message is delivered. + * + * @type { ?AsyncCallback } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ deliveryCallback?: AsyncCallback; } + /** + * Provides the callback for the SMS message sending result. + * + * @interface ISendShortMessageCallback + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ export interface ISendShortMessageCallback { - /** Indicates the SMS message sending result. */ + /** + * Indicates the SMS message sending result. + * + * @type { SendSmsResult } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ result: SendSmsResult; - /** Indicates the URI to store the sent SMS message. */ + + /** + * Indicates the URI to store the sent SMS message. + * + * @type { string } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ url: string; - /** Specifies whether this is the last part of a multi-part SMS message. */ + + /** + * Specifies whether this is the last part of a multi-part SMS message. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ isLastPart: boolean; } + /** + * Provides the callback for the SMS message delivery report. + * + * @interface IDeliveryShortMessageCallback + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ export interface IDeliveryShortMessageCallback { - /** Indicates the SMS delivery report. */ + /** + * Indicates the SMS delivery report. + * + * @type { Array } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ pdu: Array; } + /** + * Enumerates SMS message sending results. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 + */ export enum SendSmsResult { /** * Indicates that the SMS message is successfully sent. + * + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 */ SEND_SMS_SUCCESS = 0, /** * Indicates that sending the SMS message fails due to an unknown reason. + * + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 */ SEND_SMS_FAILURE_UNKNOWN = 1, /** * Indicates that sending the SMS fails because the modem is powered off. + * + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 */ SEND_SMS_FAILURE_RADIO_OFF = 2, /** * Indicates that sending the SMS message fails because the network is unavailable * or does not support sending or reception of SMS messages. + * + * @syscap SystemCapability.Telephony.SmsMms + * @since 6 */ SEND_SMS_FAILURE_SERVICE_UNAVAILABLE = 3 } /** + * Enumerates RAN type. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 7 */ export enum RanType { - TYPE_GSM = 1, // GSM - TYPE_CDMA = 2, // CDMA + /** + * Indicates GSM type. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ + TYPE_GSM = 1, + + /** + * Indicates CDMA type. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 7 + */ + TYPE_CDMA = 2, } /** + * Defines the SMS message segment information. + * + * @interface SmsSegmentsInfo + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export interface SmsSegmentsInfo { + /** + * Indicates the split count for the SMS message segment information. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ splitCount: number; + + /** + * Indicates the encoding count for the SMS message segment information. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ encodeCount: number; + + /** + * Indicates the remaining encoding count for the SMS message segment information. + * + * @type { number } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ encodeCountRemaining: number; + + /** + * Indicates the encoding scheme for the SMS message segment information. + * + * @type { SmsEncodingScheme } + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ scheme: SmsEncodingScheme; } /** + * Enumerates SMS encoding schemes. + * + * @enum { number } + * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 */ export enum SmsEncodingScheme { + /** + * Indicates an unknown encoding schemes. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ SMS_ENCODING_UNKNOWN = 0, + + /** + * Indicates that the encoding schemes is 7-digit. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ SMS_ENCODING_7BIT, + + /** + * Indicates that the encoding schemes is 8-digit. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ SMS_ENCODING_8BIT, + + /** + * Indicates that the encoding schemes is 16-digit. + * + * @syscap SystemCapability.Telephony.SmsMms + * @systemapi Hide this for inner system use. + * @since 8 + */ SMS_ENCODING_16BIT, } } From 8fd5232905bba899d9cde19eaac4196e0a82f522 Mon Sep 17 00:00:00 2001 From: SubmarinePhantom Date: Sat, 13 May 2023 11:22:00 +0800 Subject: [PATCH 06/21] fix dts Signed-off-by: SubmarinePhantom --- api/@ohos.telephony.call.d.ts | 103 ++++++++++++++++++++---------- api/@ohos.telephony.data.d.ts | 35 +++++----- api/@ohos.telephony.observer.d.ts | 2 +- api/@ohos.telephony.radio.d.ts | 9 +-- api/@ohos.telephony.sim.d.ts | 7 +- api/@ohos.telephony.sms.d.ts | 2 +- 6 files changed, 98 insertions(+), 60 deletions(-) diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 72bc068b5..2d6d80b40 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -1206,16 +1206,17 @@ declare namespace call { /** * Subscribe to the audioDeviceChange event. * - * @param type Indicates the observer type. - * @param callback Return the result of current audio device. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - audioDeviceChange. + * @param { Callback } callback - Indicates the callback for getting the result of Current AudioDevice. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1224,16 +1225,17 @@ declare namespace call { /** * Unsubscribe from the audioDeviceChange event. * - * @param type Indicates the observer type. - * @param callback Return the result of current audio device. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } type - audioDeviceChange. + * @param { Callback } callback - Indicates the callback for getting the result of Current AudioDevice. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1589,14 +1591,16 @@ declare namespace call { * Set the audio device. * * @permission ohos.permission.SET_TELEPHONY_STATE - * @param device Indicates the device of audio. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AudioDevice } device - Indicates the device of audio. + * @returns { Promise } The promise returned by the setAudioDevice. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1605,9 +1609,11 @@ declare namespace call { /** * Set the audio device with options. * + * @permission ohos.permission.SET_TELEPHONY_STATE * @param { AudioDevice } device - Indicates the device of audio. * @param { AudioDeviceOptions } options - Indicates additional information, such as address of bluetooth. * @param { AsyncCallback } callback - The callback of setAudioDevice. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 8300001 - Invalid parameter value. @@ -1623,9 +1629,11 @@ declare namespace call { /** * Set the audio device with options. * + * @permission ohos.permission.SET_TELEPHONY_STATE * @param { AudioDevice } device - Indicates the device of audio. * @param { AudioDeviceOptions } options - Indicates additional information, such as address of bluetooth. * @returns { Promise } The promise returned by the setAudioDevice. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 8300001 - Invalid parameter value. @@ -2158,19 +2166,50 @@ declare namespace call { } /** + * Indicates the information of the audio device. + * + * @interface AudioDeviceInfo + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ export interface AudioDeviceInfo { - /** Indicates the list of supported audio devices. */ + /** + * Indicates the list of support audiodevice. + * + * @type { Array } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 10 + */ audioDeviceList: Array; - /** Indicates the type of current audio device. */ + + /** + * Indicates the type of current audiodevice. + * + * @type { AudioDevice } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 10 + */ currentAudioDevice: AudioDevice; - /** Indicates the status of mute. */ + + /** + * Indicates the status of mute. + * + * @type { boolean } + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 10 + */ isMuted: boolean; } /** + * Indicates the type of call restriction. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -2986,7 +3025,7 @@ declare namespace call { /** * Indicates the scenario of the call. * - * @type { ?VideoStateType } + * @type { ?DialScene } * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 @@ -2995,7 +3034,7 @@ declare namespace call { /** * Indicates the type of the call. * - * @type { ?VideoStateType } + * @type { ?DialType } * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 9 diff --git a/api/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts index c9f97f463..09e72d0c8 100644 --- a/api/@ohos.telephony.data.d.ts +++ b/api/@ohos.telephony.data.d.ts @@ -1,6 +1,5 @@ - /* - * Copyright (C) 2021-2022 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -52,7 +51,7 @@ declare namespace data { function getDefaultCellularDataSlotIdSync(): number; /** - * Switches cellular data services to another card, without changing the default settings. + * Switch cellular data services to another card, without changing the default settings. * * @permission ohos.permission.SET_TELEPHONY_STATE * @param { number } slotId - Indicates the ID of the target card slot. @@ -74,7 +73,7 @@ declare namespace data { function setDefaultCellularDataSlotId(slotId: number, callback: AsyncCallback): void; /** - * Switches cellular data services to another card, without changing the default settings. + * Switch cellular data services to another card, without changing the default settings. * * @permission ohos.permission.SET_TELEPHONY_STATE * @param { number } slotId - Indicates the ID of the target card slot. @@ -116,7 +115,7 @@ declare namespace data { function getCellularDataFlowType(): Promise; /** - * Obtains the connection state of the PS domain. + * Obtain the connection state of the PS domain. * * @param { AsyncCallback } callback - Indicates the callback for getting the connection state, * which can be any of the following: @@ -133,7 +132,7 @@ declare namespace data { function getCellularDataState(callback: AsyncCallback): void; /** - * Obtains the connection state of the PS domain. + * Obtain the connection state of the PS domain. * * @returns { Promise } Returns the connection state, which can be any of the following: *

            @@ -149,7 +148,7 @@ declare namespace data { function getCellularDataState(): Promise; /** - * Checks whether cellular data services are enabled. + * Check whether cellular data services are enabled. * * @permission ohos.permission.GET_NETWORK_INFO * @param { AsyncCallback } callback - Indicates the callback for checking whether cellular data services @@ -166,7 +165,7 @@ declare namespace data { function isCellularDataEnabled(callback: AsyncCallback): void; /** - * Checks whether cellular data services are enabled. + * Check whether cellular data services are enabled. * * @permission ohos.permission.GET_NETWORK_INFO * @returns { Promise } Returns {@code true} if cellular data services are enabled. @@ -181,7 +180,7 @@ declare namespace data { function isCellularDataEnabled(): Promise; /** - * Enables cellular data services. + * Enable cellular data services. * * @permission ohos.permission.SET_TELEPHONY_STATE * @param { AsyncCallback } callback - The callback of enableCellularData. @@ -199,7 +198,7 @@ declare namespace data { function enableCellularData(callback: AsyncCallback): void; /** - * Enables cellular data services. + * Enable cellular data services. * * @permission ohos.permission.SET_TELEPHONY_STATE * @returns { Promise } The promise returned by the enableCellularData. @@ -215,7 +214,7 @@ declare namespace data { function enableCellularData(): Promise; /** - * Disables cellular data services. + * Disable cellular data services. * * @permission ohos.permission.SET_TELEPHONY_STATE * @param { AsyncCallback } callback - The callback of disableCellularData. @@ -233,7 +232,7 @@ declare namespace data { function disableCellularData(callback: AsyncCallback): void; /** - * Disables cellular data services. + * Disable cellular data services. * * @permission ohos.permission.SET_TELEPHONY_STATE * @returns { Promise } The promise returned by the disableCellularData. @@ -249,7 +248,7 @@ declare namespace data { function disableCellularData(): Promise; /** - * Checks whether roaming is enabled for cellular data services. + * Check whether roaming is enabled for cellular data services. * * @permission ohos.permission.GET_NETWORK_INFO * @param { number } slotId - Indicates the ID of a card slot. @@ -269,7 +268,7 @@ declare namespace data { function isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback): void; /** - * Checks whether roaming is enabled for cellular data services. + * Check whether roaming is enabled for cellular data services. * * @permission ohos.permission.GET_NETWORK_INFO * @param { number } slotId - Indicates the ID of a card slot. @@ -288,7 +287,7 @@ declare namespace data { function isCellularDataRoamingEnabled(slotId: number): Promise; /** - * Enables cellular data roaming. + * Enable cellular data roaming. * * @permission ohos.permission.SET_TELEPHONY_STATE * @param { number } slotId - Indicates the ID of a card slot. @@ -308,7 +307,7 @@ declare namespace data { function enableCellularDataRoaming(slotId: number, callback: AsyncCallback): void; /** - * Enables cellular data roaming. + * Enable cellular data roaming. * * @permission ohos.permission.SET_TELEPHONY_STATE * @param { number } slotId - Indicates the ID of a card slot. @@ -328,7 +327,7 @@ declare namespace data { function enableCellularDataRoaming(slotId: number): Promise; /** - * Disables cellular data roaming. + * Disable cellular data roaming. * * @permission ohos.permission.SET_TELEPHONY_STATE * @param { number } slotId - Indicates the ID of a card slot. @@ -348,7 +347,7 @@ declare namespace data { function disableCellularDataRoaming(slotId: number, callback: AsyncCallback): void; /** - * Disables cellular data roaming. + * Disable cellular data roaming. * * @permission ohos.permission.SET_TELEPHONY_STATE * @param { number } slotId - Indicates the ID of a card slot. diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts index 192520902..d474e0c4d 100644 --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index 2ab6ba0e0..63f4a0e9d 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -673,6 +673,7 @@ declare namespace radio { * * @param { AsyncCallback } callback - Indicates the callback for getting the index number of * the primary card slot. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 8300001 - Invalid parameter value. * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. * @throws { BusinessError } 8300003 - System internal error. @@ -1129,8 +1130,7 @@ declare namespace radio { * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. - * @param { AsyncCallback } callback - Indicates the callback for getting an instance of - * the {@link ImsRegInfo} class. + * @returns { Promise } Returns an instance of the {@link ImsRegInfo} class. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. @@ -1149,6 +1149,7 @@ declare namespace radio { * a monitored {@code slotId} updates. * * @permission ohos.permission.GET_TELEPHONY_STATE + * @param { string } type - imsRegStateChange. * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. @@ -1167,11 +1168,11 @@ declare namespace radio { */ function on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: Callback): void; - /** * Unsubscribe from imsRegStateChange event. * * @permission ohos.permission.GET_TELEPHONY_STATE + * @param { string } type - imsRegStateChange. * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. * @param { ImsServiceType } imsType - Indicates the ims service type of the {@link ImsServiceType}. diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 872975029..6820ef529 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -131,8 +131,8 @@ declare namespace sim { * * @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 } callback - Indicates the callback for getting the country code defined - * in ISO 3166-2; returns an empty string if no SIM card is inserted. + * @returns { Promise } Returns the country code defined in ISO 3166-2; + * returns an empty string if no SIM card is inserted. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 8300001 - Invalid parameter value. * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. @@ -977,7 +977,6 @@ declare namespace sim { * ranging from 0 to the maximum card slot index number supported by the device. * @param { string } number - Indicates SIM card number. * @param { AsyncCallback } callback - The callback of setShowNumber. - * * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. diff --git a/api/@ohos.telephony.sms.d.ts b/api/@ohos.telephony.sms.d.ts index 7f4e35b46..32a924a79 100644 --- a/api/@ohos.telephony.sms.d.ts +++ b/api/@ohos.telephony.sms.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Huawei Device Co., Ltd. + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at From 01e69bb5853917508b75370b4d3b5f3842751bce Mon Sep 17 00:00:00 2001 From: SubmarinePhantom Date: Tue, 16 May 2023 10:31:37 +0800 Subject: [PATCH 07/21] add 202 Signed-off-by: SubmarinePhantom --- api/@ohos.telephony.radio.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index 6d8af4cdf..bc0ce34fb 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -1199,6 +1199,7 @@ declare namespace radio { * @param { AsyncCallback } callback - Returns Baseband version. * @permission ohos.permission.GET_TELEPHONY_STATE * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 8300001 - Invalid parameter value. * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. @@ -1218,6 +1219,7 @@ declare namespace radio { * @returns { Promise } Returns Baseband version. * @permission ohos.permission.GET_TELEPHONY_STATE * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 8300001 - Invalid parameter value. * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. From 614ab71a61f95281cc3767189ddb3fd9e38a97e2 Mon Sep 17 00:00:00 2001 From: l30043718 Date: Tue, 16 May 2023 17:00:23 +0800 Subject: [PATCH 08/21] Description:comment modifications Feature or Bugfix:comment modifications Binary Source: No Signed-off-by: Lixiaoying25 --- api/@ohos.rpc.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index e4a88b6e9..a577465c7 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -2435,8 +2435,7 @@ declare namespace rpc { /** * Obtains the SendRequest call flag, which can be synchronous or asynchronous. * - * @returns { number } Return {@code true} if the the SendRequest is called synchronously; - * return {@code false} if the the SendRequest is called asynchronously. + * @returns { number } Return whether the SendRequest is called synchronously or asynchronously. * @syscap SystemCapability.Communication.IPC.Core * @since 7 */ From 0be850daf726d8b707c39dc1acdfcdc300389873 Mon Sep 17 00:00:00 2001 From: leafly2021 Date: Wed, 17 May 2023 14:03:24 +0800 Subject: [PATCH 09/21] js docs tools rectification-screen Signed-off-by: leafly2021 Change-Id: I345ec6968a62d19e2b1776ac3bc74fe6166da7ed --- ...os.application.WindowExtensionAbility.d.ts | 22 +- api/@ohos.screen.d.ts | 386 +++++++++++++++--- api/@ohos.window.d.ts | 8 +- 3 files changed, 350 insertions(+), 66 deletions(-) diff --git a/api/@ohos.application.WindowExtensionAbility.d.ts b/api/@ohos.application.WindowExtensionAbility.d.ts index 96451c3b4..54b5d24c3 100644 --- a/api/@ohos.application.WindowExtensionAbility.d.ts +++ b/api/@ohos.application.WindowExtensionAbility.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"), * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,60 +13,60 @@ * limitations under the License. */ -import rpc from "./@ohos.rpc"; -import WindowExtensionContext from "./application/WindowExtensionContext"; +import rpc from './@ohos.rpc'; +import WindowExtensionContext from './application/WindowExtensionContext'; import Want from './@ohos.app.ability.Want'; import window from './@ohos.window'; /** * class of window extension ability. * - * @since 9 * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi hide for inner use. * @StageModelOnly + * @since 9 */ export default class WindowExtensionAbility { /** * Indicates window extension ability context. * - * @since 9 * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi hide for inner use. * @StageModelOnly + * @since 9 */ context: WindowExtensionContext; /** * Called back when a window extension is first connected to an ability. * - * @since 9 + * @param { Want } want Indicates connection information about the Window ability. * @syscap SystemCapability.WindowManager.WindowManager.Core - * @param want Indicates connection information about the Window ability. * @systemapi hide for inner use. * @StageModelOnly + * @since 9 */ onConnect(want: Want): void; /** * Called back when all abilities connected to a window extension are disconnected. * - * @since 9 + * @param { Want } want Indicates disconnection information about the window extension. * @syscap SystemCapability.WindowManager.WindowManager.Core - * @param want Indicates disconnection information about the window extension. * @systemapi hide for inner use. * @StageModelOnly + * @since 9 */ onDisconnect(want: Want): void; /** * Called back when window is created. * - * @since 9 + * @param { window.Window } window Current Window instance. * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi hide for inner use. * @StageModelOnly + * @since 9 */ onWindowReady(window: window.Window): void; } - diff --git a/api/@ohos.screen.d.ts b/api/@ohos.screen.d.ts index 75126b9f1..b68c30f8b 100644 --- a/api/@ohos.screen.d.ts +++ b/api/@ohos.screen.d.ts @@ -1,58 +1,99 @@ /* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import { AsyncCallback, Callback } from './@ohos.base'; /** * Interface of screen manager + * + * @namespace screen * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. * @since 9 */ declare namespace screen { /** - * Get all screen - * @throws {BusinessError} 1400001 - If display or screen is invalid + * Get all screen instances, then can get or set detail information. + * + * @param { AsyncCallback> } callback the callback of all screens info + * @throws { BusinessError } 1400001 - If display or screen is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ function getAllScreens(callback: AsyncCallback>): void; + + /** + * Get all screen instances, then can get or set detail information. + * + * @returns { Promise> } the result of all screens info + * @throws { BusinessError } 1400001 - If display or screen is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ function getAllScreens(): Promise>; /** * Register the callback for screen changes. - * @param eventType: type of callback - * @throws {BusinessError} 401 - If param is invalid + * + * @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes + * @param { Callback } callback Callback used to return the screen ID + * @throws { BusinessError } 401 - If param is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ function on(eventType: 'connect' | 'disconnect' | 'change', callback: Callback): void; /** * Unregister the callback for screen changes. - * @param eventType: type of callback - * @throws {BusinessError} 401 - If param is invalid + * + * @param { 'connect' | 'disconnect' | 'change' } eventType the event of screen changes + * @param { Callback } callback Callback used to return the screen ID + * @throws { BusinessError } 401 - If param is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ function off(eventType: 'connect' | 'disconnect' | 'change', callback?: Callback): void; /** * Make screens as expand-screen - * @throws {BusinessError} 401 - If param is invalid - * @throws {BusinessError} 1400001 - If display or screen is invalid + * + * @param { Array } options Parameters for expanding the screen + * @param { AsyncCallback } callback callback used to return the group ID of the expanded screens + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400001 - If display or screen is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ function makeExpand(options: Array, callback: AsyncCallback): void; + + /** + * Make screens as expand-screen + * + * @param { Array } options Parameters for expanding the screen + * @returns { Promise } used to return the group ID of the expanded screens + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400001 - If display or screen is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ function makeExpand(options: Array): Promise; /** @@ -83,11 +124,30 @@ declare namespace screen { /** * Make screens as mirror-screen - * @throws {BusinessError} 401 - If param is invalid - * @throws {BusinessError} 1400001 - If display or screen is invalid + * + * @param { number } mainScreen ID of the primary screen + * @param { Array } mirrorScreen IDs of secondary screens + * @param { AsyncCallback } callback Callback used to return the group ID of the secondary screens + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400001 - If display or screen is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ function makeMirror(mainScreen: number, mirrorScreen: Array, callback: AsyncCallback): void; + + /** + * Make screens as mirror-screen + * + * @param { number } mainScreen ID of the primary screen + * @param { Array } mirrorScreen IDs of secondary screens + * @returns { Promise } Promise used to return the group ID of the secondary screens + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400001 - If display or screen is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ function makeMirror(mainScreen: number, mirrorScreen: Array): Promise; /** @@ -118,201 +178,422 @@ declare namespace screen { /** * Create virtual screen. if surfaceId is valid, this permission is necessary. - * @param options Indicates the options of the virtual screen. + * * @permission ohos.permission.CAPTURE_SCREEN - * @throws {BusinessError} 201 - If there is no permission - * @throws {BusinessError} 401 - If param is invalid - * @throws {BusinessError} 1400001 - If display or screen is invalid + * @param { VirtualScreenOption } options Indicates the options of the virtual screen. + * @param { AsyncCallback } callback Callback used to return the created virtual screen + * @throws { BusinessError } 201 - If there is no permission + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400001 - If display or screen is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ function createVirtualScreen(options: VirtualScreenOption, callback: AsyncCallback): void; + + /** + * Create virtual screen. if surfaceId is valid, this permission is necessary. + * + * @permission ohos.permission.CAPTURE_SCREEN + * @param { VirtualScreenOption } options Indicates the options of the virtual screen. + * @returns { Promise } Promise used to return the created virtual screen + * @throws { BusinessError } 201 - If there is no permission + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400001 - If display or screen is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ function createVirtualScreen(options: VirtualScreenOption): Promise; /** * Destroy virtual screen. - * @param screenId Indicates the screen id of the virtual screen. - * @throws {BusinessError} 401 - If param is invalid - * @throws {BusinessError} 1400002 - If operation other screen + * + * @param { number } screenId Indicates the screen id of the virtual screen. + * @param { AsyncCallback } callback Callback used to return the result. + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400002 - If operation other screen + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ function destroyVirtualScreen(screenId: number, callback: AsyncCallback): void; + + /** + * Destroy virtual screen. + * + * @param { number } screenId Indicates the screen id of the virtual screen. + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400002 - If operation other screen + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ function destroyVirtualScreen(screenId: number): Promise; /** * Set surface for the virtual screen. - * @param screenId Indicates the screen id of the virtual screen. - * @param surfaceId Indicates the surface id. + * * @permission ohos.permission.CAPTURE_SCREEN - * @throws {BusinessError} 201 - If there is no permission - * @throws {BusinessError} 401 - If param is invalid - * @throws {BusinessError} 1400001 - If display or screen is invalid + * @param { number } screenId Indicates the screen id of the virtual screen. + * @param { string } surfaceId Indicates the surface id. + * @param { AsyncCallback } callback Callback used to return the result + * @throws { BusinessError } 201 - If there is no permission + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400001 - If display or screen is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ function setVirtualScreenSurface(screenId: number, surfaceId: string, callback: AsyncCallback): void; + + /** + * Set surface for the virtual screen. + * + * @permission ohos.permission.CAPTURE_SCREEN + * @param { number } screenId Indicates the screen id of the virtual screen. + * @param { string } surfaceId Indicates the surface id. + * @returns { Promise } Promise that returns no value + * @throws { BusinessError } 201 - If there is no permission + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400001 - If display or screen is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ function setVirtualScreenSurface(screenId: number, surfaceId: string): Promise; /** * Get screen rotation lock status. + * + * @param { AsyncCallback } callback If true, auto rotate is locked. If false, auto rotate is unlocked + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ function isScreenRotationLocked(callback: AsyncCallback): void; + + /** + * Get screen rotation lock status. + * + * @returns { Promise } If true, auto rotate is locked. If false, auto rotate is unlocked + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ function isScreenRotationLocked(): Promise; /** * Set screen rotation lock status. - * @param isLocked Indicates whether the screen rotation switch is locked. - * @throws {BusinessError} 401 - If param is invalid + * + * @param { boolean } isLocked Indicates whether the screen rotation switch is locked. + * @param { AsyncCallback } callback Callback used to return the result. + * @throws { BusinessError } 401 - If param is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ function setScreenRotationLocked(isLocked: boolean, callback: AsyncCallback): void; + + /** + * Set screen rotation lock status. + * + * @param { boolean } isLocked Indicates whether the screen rotation switch is locked. + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 401 - If param is invalid + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ function setScreenRotationLocked(isLocked: boolean): Promise; /** * The parameter of making expand screen + * + * @interface ExpandOption * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ interface ExpandOption { /** * Screen id + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ screenId: number; /** * The start coordinate X of the screen origin + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ startX: number; /** * The start coordinate Y of the screen origin + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ startY: number; } /** * The parameter for creating virtual screen. + * + * @interface VirtualScreenOption * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ interface VirtualScreenOption { /** * Indicates the name of the virtual screen. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ - name: string + name: string; /** * Indicates the width of the virtual screen. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ - width: number + width: number; /** * Indicates the height of the virtual screen. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ - height: number + height: number; /** * Indicates the density of the virtual screen. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ - density: number + density: number; /** * Indicates the surface id of the virtual screen. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ - surfaceId: string + surfaceId: string; } /** * Indicate the source mode of the screen + * + * @enum { number } + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 10 */ enum ScreenSourceMode { /** * Indicate that the screen is the default screen. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 10 */ SCREEN_MAIN = 0, /** - * Indicate that the screen is in mirror mode. + * Indicate that the screen is in mirror mode. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 10 */ SCREEN_MIRROR = 1, /** * Indicate that the screen is in extend mode. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 10 */ SCREEN_EXTEND = 2, /** * Indicate that the screen stands alone. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 10 */ - SCREEN_ALONE = 3, + SCREEN_ALONE = 3 } /** * Interface for screen + * + * @interface Screen * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ interface Screen { /** * Screen id + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ readonly id: number; /** * Group id + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ readonly parent: number; /** * Mode supported by the screen + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ readonly supportedModeInfo: Array; /** * Currently active mode + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ readonly activeModeIndex: number; /** * Orientation of the screen + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ readonly orientation: Orientation; /** * Source mode of the screen + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 10 */ readonly sourceMode: ScreenSourceMode; /** * Set the orientation of the screen - * @throws {BusinessError} 401 - If param is invalid - * @throws {BusinessError} 1400003 - If system state is abnormally + * + * @param { Orientation } orientation Screen orientation. + * @param { AsyncCallback } callback Callback used to return the result. + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400003 - If system state is abnormally + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ setOrientation(orientation: Orientation, callback: AsyncCallback): void; + + /** + * Set the orientation of the screen + * + * @param { Orientation } orientation Screen orientation. + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400003 - If system state is abnormally + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ setOrientation(orientation: Orientation): Promise; /** * Active the mode - * @throws {BusinessError} 401 - If param is invalid - * @throws {BusinessError} 1400003 - If system state is abnormally + * + * @param { number } modeIndex Index of the mode to set. + * @param { AsyncCallback } callback Callback used to return the result. + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400003 - If system state is abnormally + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ setScreenActiveMode(modeIndex: number, callback: AsyncCallback): void; + + /** + * Active the mode + * + * @param { number } modeIndex Index of the mode to set. + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400003 - If system state is abnormally + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ setScreenActiveMode(modeIndex: number): Promise; /** * Set display density of the screen - * @throws {BusinessError} 401 - If param is invalid - * @throws {BusinessError} 1400003 - If system state is abnormally + * + * @param { number } densityDpi Pixel density. The value ranges from 80 to 640. + * @param { AsyncCallback } callback Callback used to return the result. + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400003 - If system state is abnormally + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 */ setDensityDpi(densityDpi: number, callback: AsyncCallback): void; + + /** + * Set display density of the screen + * + * @param { number } densityDpi Pixel density. The value ranges from 80 to 640. + * @returns { Promise } Promise that returns no value. + * @throws { BusinessError } 401 - If param is invalid + * @throws { BusinessError } 1400003 - If system state is abnormally + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 9 + */ setDensityDpi(densityDpi: number): Promise; } /** * Screen orientation + * + * @enum { number } * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ enum Orientation { @@ -320,12 +601,15 @@ declare namespace screen { VERTICAL = 1, HORIZONTAL = 2, REVERSE_VERTICAL = 3, - REVERSE_HORIZONTAL = 4, + REVERSE_HORIZONTAL = 4 } /** * The information of the screen + * + * @interface ScreenModeInfo * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. * @since 9 */ interface ScreenModeInfo { diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 733181d19..4fa37b797 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -1196,8 +1196,8 @@ declare namespace window { /** * Register the callback of systemBarTintChange * - * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the status bar and navigation bar. - * @param { Callback } callback - Callback used to return the properties of the status bar and navigation bar. + * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the system bar. + * @param { Callback } callback - Callback used to return the properties of the system bar. * @throws { BusinessError } 401 - If param is invalid * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. @@ -1208,8 +1208,8 @@ declare namespace window { /** * Unregister the callback of systemBarTintChange * - * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the status bar and navigation bar. - * @param { Callback } callback - Callback used to return the properties of the status bar and navigation bar. + * @param { 'systemBarTintChange' } type - The value is fixed at 'systemBarTintChange', indicating the property change event of the system bar. + * @param { Callback } callback - Callback used to return the properties of the system bar. * @throws { BusinessError } 401 - If param is invalid * @syscap SystemCapability.WindowManager.WindowManager.Core * @systemapi Hide this for inner system use. From ca96a6a3c7011d1dc5bf03e472d859ac4227557f Mon Sep 17 00:00:00 2001 From: yyuanche Date: Mon, 8 May 2023 14:52:09 +0800 Subject: [PATCH 10/21] =?UTF-8?q?fixed=20fb2a313=20from=20https://gitee.co?= =?UTF-8?q?m/yyuanche/interface=5Fsdk-js/pulls/5346=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E8=83=BD=E5=8A=9B=20Signed-off-by:=20yyuanch?= =?UTF-8?q?e=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@internal/component/ets/common.d.ts | 50 +++++++++++++++++++ .../plugin/dictionaries_supplementary.txt | 1 + 2 files changed, 51 insertions(+) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 2254f3058..a0d079a18 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -193,6 +193,56 @@ declare const Styles: MethodDecorator; */ declare const Extend: MethodDecorator & ((value: any) => MethodDecorator); +/** + * Define AnimatableExtend MethodDecorator + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare const AnimatableExtend: MethodDecorator & ((value: Object) => MethodDecorator); + +/** + * Define AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare interface AnimatableArithmetic { + /** + * Define plus method + * @param rhs { AnimatableArithmetic } another value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + plus(rhs: AnimatableArithmetic): AnimatableArithmetic; + + /** + * Define subtract method + * @param rhs { AnimatableArithmetic } another value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + subtract(rhs: AnimatableArithmetic): AnimatableArithmetic; + + /** + * Define multiply method + * @param scale { number } scale value + * @returns { AnimatableArithmetic } new value which implements AnimatableArithmetic interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + multiply(scale: number): AnimatableArithmetic; + + /** + * Define equals method + * @param rhs { AnimatableArithmetic } another value + * @returns { boolean } is equals + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + equals(rhs: AnimatableArithmetic): boolean; +} + /** * Defining Concurrent MethodDecorator * @since 9 diff --git a/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt b/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt index 85a401887..a919567aa 100644 --- a/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt +++ b/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt @@ -23,6 +23,7 @@ alterase alternating altitudes amr +animatable annually antialias apdu From f3bc557d973795845042be7302b2a5a52bde7ea1 Mon Sep 17 00:00:00 2001 From: xixian_2023 Date: Wed, 17 May 2023 22:10:52 +0800 Subject: [PATCH 11/21] mmi_interface_note202 Signed-off-by:xixian_2023 --- api/@ohos.multimodalInput.pointer.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/@ohos.multimodalInput.pointer.d.ts b/api/@ohos.multimodalInput.pointer.d.ts index 01b04aa2d..936528e54 100644 --- a/api/@ohos.multimodalInput.pointer.d.ts +++ b/api/@ohos.multimodalInput.pointer.d.ts @@ -604,6 +604,7 @@ declare namespace pointer { * * @param { number } rows - Indicates the number of mouse scrolling rows. * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -616,6 +617,7 @@ declare namespace pointer { * * @param { number } rows - Indicates the number of mouse scrolling rows. * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -627,6 +629,7 @@ declare namespace pointer { * Get the number of mouse scrolling rows. * * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -638,6 +641,7 @@ declare namespace pointer { * Get the number of mouse scrolling rows. * * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. From 64f4e0314afd82c80360e0f821eead20880289f9 Mon Sep 17 00:00:00 2001 From: xixian Date: Wed, 17 May 2023 14:28:33 +0000 Subject: [PATCH 12/21] update api/@ohos.multimodalInput.pointer.d.ts. Signed-off-by: xixian --- api/@ohos.multimodalInput.pointer.d.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/api/@ohos.multimodalInput.pointer.d.ts b/api/@ohos.multimodalInput.pointer.d.ts index 936528e54..b84aa1f26 100644 --- a/api/@ohos.multimodalInput.pointer.d.ts +++ b/api/@ohos.multimodalInput.pointer.d.ts @@ -604,8 +604,7 @@ declare namespace pointer { * * @param { number } rows - Indicates the number of mouse scrolling rows. * @param { AsyncCallback } callback - Callback used to return the result. - * @throws { BusinessError } 202 - SystemAPI permission error. - * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 401 - Parameter error. 202 - SystemAPI permission error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. * @since 10 @@ -617,8 +616,7 @@ declare namespace pointer { * * @param { number } rows - Indicates the number of mouse scrolling rows. * @returns { Promise } Returns the result through a promise. - * @throws { BusinessError } 202 - SystemAPI permission error. - * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 401 - Parameter error. 202 - SystemAPI permission error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. * @since 10 @@ -629,8 +627,7 @@ declare namespace pointer { * Get the number of mouse scrolling rows. * * @param { AsyncCallback } callback - Callback used to return the result. - * @throws { BusinessError } 202 - SystemAPI permission error. - * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 401 - Parameter error. 202 - SystemAPI permission error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. * @since 10 @@ -641,8 +638,7 @@ declare namespace pointer { * Get the number of mouse scrolling rows. * * @returns { Promise } Returns the result through a promise. - * @throws { BusinessError } 202 - SystemAPI permission error. - * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 401 - Parameter error. 202 - SystemAPI permission error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. * @since 10 From 277c0485c2869cebd7e26c1edf51c7e7cb223895 Mon Sep 17 00:00:00 2001 From: luo-wei246 Date: Wed, 17 May 2023 23:10:48 -0700 Subject: [PATCH 13/21] fix:Comment changes Signed-off-by: luo-wei246 --- api/@ohos.usbManager.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.usbManager.d.ts b/api/@ohos.usbManager.d.ts index 066855702..ebdf9e374 100644 --- a/api/@ohos.usbManager.d.ts +++ b/api/@ohos.usbManager.d.ts @@ -36,7 +36,7 @@ declare namespace usbManager { * @param { USBDevice } device - USB device on the device list returned by getDevices(). * @returns { Readonly } object for data transfer. * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. - * @throws { BusinessError } 14400001 - USB Device access denied. + * @throws { BusinessError } 14400001 - Permission denied. Need call requestRight to get permission. * @syscap SystemCapability.USB.USBManager * @since 9 */ From 5a8fee84b60c8559e080b9ffbb2cd71c1a69f802 Mon Sep 17 00:00:00 2001 From: SubmarinePhantom Date: Tue, 16 May 2023 18:26:44 +0800 Subject: [PATCH 14/21] =?UTF-8?q?review=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SubmarinePhantom --- api/@ohos.telephony.call.d.ts | 298 +++++++++++------- api/@ohos.telephony.observer.d.ts | 3 +- api/@ohos.telephony.radio.d.ts | 153 ++++++++- api/@ohos.telephony.sim.d.ts | 2 +- api/@ohos.telephony.sms.d.ts | 21 +- .../plugin/dictionaries_supplementary.txt | 4 + 6 files changed, 341 insertions(+), 140 deletions(-) diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 2d6d80b40..415e606af 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -1131,7 +1131,7 @@ declare namespace call { * * @permission ohos.permission.SET_TELEPHONY_STATE * @param { string } type - callDisconnectedCause. - * @param { Callback } callback - Indicates the callback for getting the call disconnection reason. + * @param { Callback } callback - Indicates the callback for getting the call disconnection reason. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. @@ -1150,7 +1150,7 @@ declare namespace call { * * @permission ohos.permission.SET_TELEPHONY_STATE * @param { string } type - callDisconnectedCause. - * @param { Callback } callback - Indicates the callback used to cancel + * @param { Callback } callback - Indicates the callback used to cancel * the registration monitoring for obtaining the call end reason. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. @@ -1837,18 +1837,19 @@ declare namespace call { /** * Close unfinished ussd. - * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param {AsyncCallback } callback - void + * * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - The callback of closeUnfinishedUssd. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1857,17 +1858,18 @@ declare namespace call { /** * Close unfinished ussd. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @returns {Promise } * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } The promise returned by the closeUnfinishedUssd. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1875,19 +1877,21 @@ declare namespace call { /** * Set switch state for voice over NR. - * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param state Indicates the VoNR state. - * @param callback {@code true} if the device set VoNR succesfully; returns {@code false} otherwise. + * * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { VoNRState } state - Indicates the VoNR state. + * @param { AsyncCallback } callback - {@code true} if the device set VoNR succesfully; + * returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1896,18 +1900,20 @@ declare namespace call { /** * Set switch state for voice over NR. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param state Indicates the VoNR state. - * @returns {@code true} if the device set VoNR succesfully; returns {@code false} otherwise. * @permission ohos.permission.SET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { number } slotId - Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @param { VoNRState } state - Indicates the VoNR state. + * @returns { Promise } Returns {@code true} if the device set VoNR succesfully; + * returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1916,18 +1922,18 @@ declare namespace call { /** * Get switch state for voice over NR. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @param state Indicates the VoNR state. - * @param {AsyncCallback } callback - VoNR state * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } callback - Indicates the callback for getVoNRState. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1936,17 +1942,18 @@ declare namespace call { /** * Get switch state for voice over NR. * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @returns {Promise } the VoNR state. * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } Returns the VoNR state. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1956,18 +1963,20 @@ declare namespace call { * Checks whether can set call transfer time. * * The system checks whether IP multimedia subsystem domain (IMS) can set call transfer time. - * + * * @permission ohos.permission.GET_TELEPHONY_STATE - * @param slotId Indicates the card slot index number, + * @param { number } slotId - Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. - * @param callback Returns {@code true} if the device can set call transfer time; returns {@code false} otherwise. - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { AsyncCallback } callback - Returns {@code true} if the device can set call transfer time; + * returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1977,18 +1986,20 @@ declare namespace call { * Checks whether can set call transfer time. * * The system checks whether IP multimedia subsystem domain (IMS) can set call transfer time. - * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @returns {@code true} if the device can set call transfer time; returns {@code false} otherwise. + * * @permission ohos.permission.GET_TELEPHONY_STATE - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @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 } Returns {@code true} if the device can set call transfer time; + * returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -1996,17 +2007,17 @@ declare namespace call { /** * Enters the secret code on the keypad. - * - * @param inputCode indicates the secret code to enter. - * @param callback - void + * * @permission ohos.permission.PLACE_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } inputCode - Indicates the secret code to enter. + * @param { AsyncCallback } callback - The callback of inputDialerSpecialCode. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ @@ -2015,22 +2026,26 @@ declare namespace call { /** * Enters the secret code on the keypad. * - * @param inputCode indicates the secret code to enter. - * @returns {Promise } - void * @permission ohos.permission.PLACE_CALL - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 202 - Non-system applications use system APIs. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 8300001 - Invalid parameter value. - * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. - * @throws {BusinessError} 8300003 - System internal error. - * @throws {BusinessError} 8300999 - Unknown error code. + * @param { string } inputCode - Indicates the secret code to enter. + * @returns { Promise } The promise returned by the inputDialerSpecialCode. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 10 */ function inputDialerSpecialCode(inputCode: string): Promise; /** + * Indicates the mode of the ims call. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -2082,7 +2097,7 @@ declare namespace call { } /** - * Indicates the device of audio. + * Indicates the VoNR state. * * @enum { number } * @syscap SystemCapability.Telephony.CallManager @@ -2090,12 +2105,30 @@ declare namespace call { * @since 10 */ export enum VoNRState { - /** Indicates the VoNR switch is on */ - VONR_STATE_ON = 0, - /** Indicates the VoNR switch is off */ + /** + * Indicates the VoNR switch is off. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 10 + */ + VONR_STATE_OFF = 0, + + /** + * Indicates the VoNR switch is on. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 10 + */ + VONR_STATE_ON = 1, } /** + * Indicates the device of audio. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. * @since 8 */ @@ -2147,7 +2180,7 @@ declare namespace call { } /** - * Indicates the type of call restriction. + * Indicates the device type of the audio device. * * @enum { number } * @syscap SystemCapability.Telephony.CallManager @@ -2155,13 +2188,40 @@ declare namespace call { * @since 10 */ export enum AudioDeviceType { - /** Indicates the audio device is earpiece */ + /** + * Indicates the audio device is earpiece. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 10 + */ DEVICE_EARPIECE, - /** Indicates the audio device is speaker */ + + /** + * Indicates the audio device is speaker. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 10 + */ DEVICE_SPEAKER, - /** Indicates the audio device is wired headset */ + + /** + * Indicates the audio device is wired headset. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 10 + */ DEVICE_WIRED_HEADSET, - /** Indicates the audio device is bluetooth headset */ + + /** + * Indicates the audio device is bluetooth headset. + * + * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. + * @since 10 + */ DEVICE_BLUETOOTH_SCO, } @@ -2175,7 +2235,7 @@ declare namespace call { */ export interface AudioDeviceInfo { /** - * Indicates the list of support audiodevice. + * Indicates the list of support audio device. * * @type { Array } * @syscap SystemCapability.Telephony.CallManager @@ -2185,7 +2245,7 @@ declare namespace call { audioDeviceList: Array; /** - * Indicates the type of current audiodevice. + * Indicates the type of current audio device. * * @type { AudioDevice } * @syscap SystemCapability.Telephony.CallManager @@ -2377,7 +2437,7 @@ declare namespace call { */ export enum CallTransferType { /** - * Indicates transfer the call unconditionally. + * Indicates unconditional transfer of a call. * * @syscap SystemCapability.Telephony.CallManager * @systemapi Hide this for inner system use. diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts index d474e0c4d..33a992d68 100644 --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -132,7 +132,8 @@ declare namespace observer { * Cancel callback when the signal strength is updated. * * @param { string } type - signalInfoChange. - * @param { Callback } callback - Indicates the callback to unsubscribe from the signalInfoChange event. + * @param { Callback } callback - Indicates the callback to unsubscribe from + * the signalInfoChange event. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 8300001 - Invalid parameter value. * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index bc0ce34fb..f83207417 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -434,6 +434,8 @@ declare namespace radio { * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 + * @deprecated since 10 + * @useinstead telephony.radio#getNROptionMode */ function getNrOptionMode(callback: AsyncCallback): void; @@ -452,6 +454,8 @@ declare namespace radio { * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 + * @deprecated since 10 + * @useinstead telephony.radio#getNROptionMode */ function getNrOptionMode(slotId: number, callback: AsyncCallback): void; @@ -470,6 +474,8 @@ declare namespace radio { * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 + * @deprecated since 10 + * @useinstead telephony.radio#getNROptionMode */ function getNrOptionMode(slotId?: number): Promise; @@ -1194,10 +1200,10 @@ declare namespace radio { /** * Get the version of Baseband. * - * @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 } callback - Returns Baseband version. * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } callback - Indicates the callback for getting the baseband version. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. @@ -1209,15 +1215,15 @@ declare namespace radio { * @systemapi Hide this for inner system use. * @since 10 */ - function getBasebandVersion(slotId: number, callback: AsyncCallback): void; + function getBasebandVersion(slotId: number, callback: AsyncCallback): void; /** * Get the version of Baseband. * - * @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 } Returns Baseband version. * @permission ohos.permission.GET_TELEPHONY_STATE + * @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 } Returns the baseband version. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. @@ -1229,7 +1235,85 @@ declare namespace radio { * @systemapi Hide this for inner system use. * @since 10 */ - function getBasebandVersion(slotId: number): Promise; + function getBasebandVersion(slotId: number): Promise; + + /** + * Set the NR option mode. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index + * number supported by the device. + * @param { NROptionMode } mode - Indicates the nr option mode to be set. + * @param { AsyncCallback } callback - Indicates the callback for getting the option result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 10 + */ + function setNROptionMode(slotId: number, mode: NROptionMode, callback: AsyncCallback): void; + + /** + * Set the NR option mode. + * + * @permission ohos.permission.SET_TELEPHONY_STATE + * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot index + * number supported by the device. + * @param { NROptionMode } mode - Indicates the nr option mode to be set. + * @returns { Promise } Returns option result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 10 + */ + function setNROptionMode(slotId: number, mode: NROptionMode): Promise; + + /** + * Get the option mode of NR. + * + * @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 } callback - Indicates the callback for getting the selection mode of NR. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 10 + */ + function getNROptionMode(slotId: number, callback: AsyncCallback): void; + + /** + * Get the option mode of NR. + * + * @param { number } slotId - Indicates the card slot index number, ranging from 0 to the maximum card slot + * index number supported by the device. + * @returns { AsyncCallback } Returns the selection mode of NR. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 8300001 - Invalid parameter value. + * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 8300003 - System internal error. + * @throws { BusinessError } 8300999 - Unknown error code. + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 10 + */ + function getNROptionMode(slotId: number): Promise; /** * Indicates the preferred network. @@ -1667,6 +1751,7 @@ declare namespace radio { /** * Returns child class objects specific to the network type. * + * @interface SignalInformation * @syscap SystemCapability.Telephony.CoreService * @since 6 */ @@ -1839,6 +1924,7 @@ declare namespace radio { * *

            Returns the NSA network registration status {@code NsaState}. * + * @type { NsaState } * @syscap SystemCapability.Telephony.CoreService * @since 6 */ @@ -1849,6 +1935,7 @@ declare namespace radio { * *

            Returns {@code true} if CA is actived; returns {@code false} otherwise. * + * @type { boolean } * @syscap SystemCapability.Telephony.CoreService * @since 6 */ @@ -1860,6 +1947,7 @@ declare namespace radio { *

            Returns {@code true} if this device is allowed to make emergency calls only; * returns {@code false} otherwise. * + * @type { boolean } * @syscap SystemCapability.Telephony.CoreService * @since 6 */ @@ -2426,6 +2514,7 @@ declare namespace radio { /** * Indicates the primary scrambling code. * + * @type { number } * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 @@ -2470,6 +2559,8 @@ declare namespace radio { * @syscap SystemCapability.Telephony.CoreService * @systemapi Hide this for inner system use. * @since 8 + * @deprecated since 10 + * @useinstead telephony.radio#NROptionMode */ export enum NrOptionMode { /** @@ -2509,6 +2600,52 @@ declare namespace radio { NR_OPTION_NSA_AND_SA, } + /** + * Obtains the option mode of NR. + * + * @enum { number } + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 10 + */ + export enum NROptionMode { + /** + * Indicates unknown NR networking mode. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 10 + */ + NR_OPTION_UNKNOWN, + + /** + * Indicates that the NR networking mode is NSA only. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 10 + */ + NR_OPTION_NSA_ONLY, + + /** + * Indicates that the NR networking mode is SA only. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 10 + */ + NR_OPTION_SA_ONLY, + + /** + * Indicates that the NR networking mode is NSA and SA. + * + * @syscap SystemCapability.Telephony.CoreService + * @systemapi Hide this for inner system use. + * @since 10 + */ + NR_OPTION_NSA_AND_SA, + } + /** * Obtains the network search results. * diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 6820ef529..cf50c7184 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -1464,7 +1464,7 @@ declare namespace sim { * @systemapi Hide this for inner system use. * @since 8 */ - function queryIccDiallingNumbers(slotId: number, type: ContactType, callback: AsyncCallback>): void + function queryIccDiallingNumbers(slotId: number, type: ContactType, callback: AsyncCallback>): void; /** * Query dialing number information on SIM card. diff --git a/api/@ohos.telephony.sms.d.ts b/api/@ohos.telephony.sms.d.ts index 32a924a79..d2d74b77f 100644 --- a/api/@ohos.telephony.sms.d.ts +++ b/api/@ohos.telephony.sms.d.ts @@ -369,7 +369,7 @@ declare namespace sms { * Update a SIM SMS of SIM card. * * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES - * @param { number } options - Indicates update SIM message options. + * @param { UpdateSimMessageOptions } options - Indicates update SIM message options. * @param { AsyncCallback } callback - The callback of updateSimMessage. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. @@ -388,7 +388,7 @@ declare namespace sms { * Update a SIM SMS of SIM card. * * @permission ohos.permission.RECEIVE_SMS and ohos.permission.SEND_MESSAGES - * @param { number } options - Indicates update SIM message options. + * @param { UpdateSimMessageOptions } options - Indicates update SIM message options. * @returns { Promise } The promise returned by the updateSimMessage. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. @@ -752,7 +752,7 @@ declare namespace sms { /** * Indicates the destination address for the MMS message sending request. * - * @type { ?MmsAddress } + * @type { ?Array } * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 @@ -1122,7 +1122,7 @@ declare namespace sms { /** * Indicates the destination address for the MMS message retrieval configuration. * - * @type { MmsAddress } + * @type { Array } * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 @@ -1152,7 +1152,7 @@ declare namespace sms { /** * Indicates the carbon copy address for the MMS message retrieval configuration. * - * @type { ?Array } * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 @@ -1292,7 +1292,7 @@ declare namespace sms { /** * Indicates the destination address for the MMS message delivery indication. * - * @type { MmsAddress } + * @type { Array } * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 @@ -1352,7 +1352,7 @@ declare namespace sms { /** * Indicates the destination address for the original MMS message reading indication. * - * @type { MmsAddress } + * @type { Array } * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 @@ -1422,7 +1422,7 @@ declare namespace sms { /** * Indicates the destination address for the MMS message reading indication. * - * @type { MmsAddress } + * @type { Array } * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. * @since 8 @@ -2242,7 +2242,6 @@ declare namespace sms { * @syscap SystemCapability.Telephony.SmsMms * @since 6 */ - /** Indicates Protocol Data Units (PDUs) from an SMS message. */ pdu: Array; /** @@ -2342,7 +2341,7 @@ declare namespace sms { SIM_MESSAGE_STATUS_UNREAD = 3, /** - * Indicates a sent message (only applicable to SMs). + * Indicates a sent message (only applicable to SMS). * * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. @@ -2351,7 +2350,7 @@ declare namespace sms { SIM_MESSAGE_STATUS_SENT = 5, /** - * Indicates an unsent message (only applicable to SMs). + * Indicates an unsent message (only applicable to SMS). * * @syscap SystemCapability.Telephony.SmsMms * @systemapi Hide this for inner system use. diff --git a/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt b/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt index 85a401887..2fe0d1845 100644 --- a/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt +++ b/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt @@ -401,6 +401,7 @@ missions mkdtemp mmax mmi +mmicode mnc moderately moitor @@ -457,6 +458,8 @@ operatorconfigs opkey opl opname +option +originating osd ott ounted @@ -581,6 +584,7 @@ sak satellites scdma sco +scrambling screenlock screensaver scrolldown From b02bbb2dbba939c6e8d0dafde51c138d696d1666 Mon Sep 17 00:00:00 2001 From: liuxiyao223 Date: Thu, 18 May 2023 15:10:26 +0800 Subject: [PATCH 15/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuxiyao223 --- api/@ohos.telephony.call.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 415e606af..b6b348b22 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -1609,11 +1609,9 @@ declare namespace call { /** * Set the audio device with options. * - * @permission ohos.permission.SET_TELEPHONY_STATE * @param { AudioDevice } device - Indicates the device of audio. * @param { AudioDeviceOptions } options - Indicates additional information, such as address of bluetooth. * @param { AsyncCallback } callback - The callback of setAudioDevice. - * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 8300001 - Invalid parameter value. @@ -1629,11 +1627,9 @@ declare namespace call { /** * Set the audio device with options. * - * @permission ohos.permission.SET_TELEPHONY_STATE * @param { AudioDevice } device - Indicates the device of audio. * @param { AudioDeviceOptions } options - Indicates additional information, such as address of bluetooth. * @returns { Promise } The promise returned by the setAudioDevice. - * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Non-system applications use system APIs. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 8300001 - Invalid parameter value. @@ -3022,6 +3018,7 @@ declare namespace call { * * @type { ?number } * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ accountId?: number; @@ -3031,6 +3028,7 @@ declare namespace call { * * @type { ?VideoStateType } * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ videoState?: VideoStateType; @@ -3040,6 +3038,7 @@ declare namespace call { * * @type { ?DialScene } * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ dialScene?: DialScene; @@ -3049,6 +3048,7 @@ declare namespace call { * * @type { ?DialType } * @syscap SystemCapability.Telephony.CallManager + * @systemapi Hide this for inner system use. * @since 8 */ dialType?: DialType; From 26c0b28a281b3f668b6325a315d7c2f0e0ccd81f Mon Sep 17 00:00:00 2001 From: xixian Date: Thu, 18 May 2023 01:40:45 +0000 Subject: [PATCH 16/21] mmi_interface_note202 Signed-off-by: xixian --- api/@ohos.multimodalInput.pointer.d.ts | 20 ++++++++++++++++---- api/@ohos.multimodalInput.shortKey.d.ts | 2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/api/@ohos.multimodalInput.pointer.d.ts b/api/@ohos.multimodalInput.pointer.d.ts index b84aa1f26..5dee7435b 100644 --- a/api/@ohos.multimodalInput.pointer.d.ts +++ b/api/@ohos.multimodalInput.pointer.d.ts @@ -509,6 +509,7 @@ declare namespace pointer { * @param { PrimaryButton } primary - Indicates mouse primary button. The value LEFT indicates that mouse primary * button is left button, and the value RIGHT indicates that mouse primary button is right button. * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -522,6 +523,7 @@ declare namespace pointer { * @param { PrimaryButton } primary - Indicates mouse primary button. The value LEFT indicates that mouse primary * button is left button, and the value RIGHT indicates that mouse primary button is right button. * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -533,6 +535,7 @@ declare namespace pointer { * Gets mouse primary button. * * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -544,6 +547,7 @@ declare namespace pointer { * Gets mouse primary button. * * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -557,6 +561,7 @@ declare namespace pointer { * @param { boolean } state - Indicates whether the mouse hover scroll is enabled in inactive window. The value true * indicates that the mouse hover scroll is enabled, and the value false indicates the opposite. * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -570,6 +575,7 @@ declare namespace pointer { * @param { boolean } state - Indicates whether the mouse hover scroll is enabled in inactive window. The value true * indicates that the mouse hover scroll is enabled, and the value false indicates the opposite. * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -581,6 +587,7 @@ declare namespace pointer { * Gets a status whether the mouse hover scroll is enabled in inactive window. * * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -592,6 +599,7 @@ declare namespace pointer { * Gets a status whether mouse hover scroll is enabled in inactive window. * * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. @@ -604,7 +612,8 @@ declare namespace pointer { * * @param { number } rows - Indicates the number of mouse scrolling rows. * @param { AsyncCallback } callback - Callback used to return the result. - * @throws { BusinessError } 401 - Parameter error. 202 - SystemAPI permission error. + * @throws { BusinessError } 202 - SystemAPI permission error. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. * @since 10 @@ -616,7 +625,8 @@ declare namespace pointer { * * @param { number } rows - Indicates the number of mouse scrolling rows. * @returns { Promise } Returns the result through a promise. - * @throws { BusinessError } 401 - Parameter error. 202 - SystemAPI permission error. + * @throws { BusinessError } 202 - SystemAPI permission error. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. * @since 10 @@ -627,7 +637,8 @@ declare namespace pointer { * Get the number of mouse scrolling rows. * * @param { AsyncCallback } callback - Callback used to return the result. - * @throws { BusinessError } 401 - Parameter error. 202 - SystemAPI permission error. + * @throws { BusinessError } 202 - SystemAPI permission error. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. * @since 10 @@ -638,7 +649,8 @@ declare namespace pointer { * Get the number of mouse scrolling rows. * * @returns { Promise } Returns the result through a promise. - * @throws { BusinessError } 401 - Parameter error. 202 - SystemAPI permission error. + * @throws { BusinessError } 202 - SystemAPI permission error. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use. * @since 10 diff --git a/api/@ohos.multimodalInput.shortKey.d.ts b/api/@ohos.multimodalInput.shortKey.d.ts index 140f5a3e4..faadff3c8 100644 --- a/api/@ohos.multimodalInput.shortKey.d.ts +++ b/api/@ohos.multimodalInput.shortKey.d.ts @@ -27,6 +27,7 @@ declare namespace shortKey { * @param { string } businessKey - The key for business which should be applied to MMI. * @param { number } delay - Duration of short key press which should be limited to 0-4000ms. * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.ShortKey * @systemapi hide for inner use @@ -39,6 +40,7 @@ declare namespace shortKey { * @param { string } businessKey - The key for business which should be applied to MMI. * @param { number } delay - Duration of short key press which should be limited to 0-4000ms. * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 202 - SystemAPI permission error. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.ShortKey * @systemapi hide for inner use From 5ced21cde7a792751b8eee8c42ac35a9b57ac56c Mon Sep 17 00:00:00 2001 From: wangcaoyu Date: Fri, 19 May 2023 10:45:18 +0800 Subject: [PATCH 17/21] =?UTF-8?q?apicheck=E6=96=B9=E6=B3=95=E6=8F=90?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangcaoyu --- build-tools/api_check_plugin/Result.txt | 3 + build-tools/api_check_plugin/entry.js | 82 ++++++++++--------- .../api_check_plugin/src/api_check_plugin.js | 39 +++++++++ 3 files changed, 86 insertions(+), 38 deletions(-) create mode 100644 build-tools/api_check_plugin/Result.txt diff --git a/build-tools/api_check_plugin/Result.txt b/build-tools/api_check_plugin/Result.txt new file mode 100644 index 000000000..763e9699f --- /dev/null +++ b/build-tools/api_check_plugin/Result.txt @@ -0,0 +1,3 @@ +[ + "api_check: false" +] \ No newline at end of file diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index d68ae1f71..c89758e60 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -17,55 +17,61 @@ const path = require('path'); const fs = require('fs'); function checkEntry(prId) { - let result = ''; + let result = ['api_check: false']; const sourceDirname = __dirname; __dirname = 'interface/sdk-js/build-tools/api_check_plugin'; const mdFilesPath = path.resolve(sourceDirname, '../../../../', 'all_files.txt'); - const execSync = require('child_process').execSync; - execSync('cd interface/sdk-js/build-tools/api_check_plugin && npm install'); + let buffer = new Buffer.from(""); + let i = 0, execute = false; try { - const rules = require(path.resolve(__dirname, './code_style_rule.json')); - const administrators = new Set(); - rules.administrators.forEach((administrator) => { - administrators.add(administrator.user); - }) - const request = require(path.resolve(__dirname, './node_modules/sync-request')); - const { scanEntry } = require(path.resolve(__dirname, './src/api_check_plugin')); - result = scanEntry(mdFilesPath); - const { ApiCheckResult } = require(path.resolve(__dirname, './src/utils.js')); - if (!ApiCheckResult.format_check_result && prId && prId !== 'NA') { - // 默认搜寻100条评论 - const commentRequestPath = `https://gitee.com/api/v5/repos/openharmony/interface_sdk-js/pulls/${prId}/comments?page=1&per_page=100&direction=desc`; - let res = request('GET', commentRequestPath, { - headers: { - 'Content-Type': 'application/json;charset=UFT-8' - } - }); - if (res.statusCode == 200) { - let resBody = new TextDecoder('utf-8').decode(res.body); - let comments = JSON.parse(`{"resultBody": ${resBody}}`); - let resultBody = comments.resultBody; - if (resultBody && resultBody.length && resultBody instanceof Array) { - for (let i = 0; i < resultBody.length; i++) { - const comment = resultBody[i]; - if (comment && comment['user'] && comment['user']['id'] && administrators.has(String(comment['user']['id'])) && - comment.body && /^approve api check$/.test(comment.body)) { - ApiCheckResult.format_check_result = true; - result = "['api_check: true']"; - break; - } - } - } + const execSync = require('child_process').execSync; + do { + try { + buffer = execSync('cd interface/sdk-js/build-tools/api_check_plugin && npm install', { + timeout: 120000 + }); + execute = true; + } catch (error) { } + } while (++i < 3 && !execute); + if (!execute) { + throw "npm install timeout"; } - const { removeDir } = require(path.resolve(__dirname, './src/utils')); + const { scanEntry, reqGitApi } = require(path.resolve(__dirname, './src/api_check_plugin')); + result = scanEntry(mdFilesPath); + result = reqGitApi(result, prId); removeDir(path.resolve(__dirname, 'node_modules')); } catch (error) { // catch error - result = `API_CHECK_ERROR : ${error}`; + result.push(`API_CHECK_ERROR : ${error}`); + result.push(`buffer : ${buffer.toString()}`); } finally { - const { writeResultFile } = require('./src/utils'); writeResultFile(result, path.resolve(__dirname, './Result.txt'), {}); } } + +function removeDir(url) { + let statObj = fs.statSync(url); + if (statObj.isDirectory()) { + let dirs = fs.readdirSync(url); + dirs = dirs.map(dir => path.join(url, dir)); + for (let i = 0; i < dirs.length; i++) { + removeDir(dirs[i]); + } + fs.rmdirSync(url); + } else { + fs.unlinkSync(url); + } +} + +function writeResultFile(resultData, outputPath, option) { + fs.writeFile(path.resolve(__dirname, outputPath), JSON.stringify(resultData, null, 2), option, err => { + if (err) { + console.error(`ERROR FOR CREATE FILE:${err}`); + } else { + console.log('API CHECK FINISH!'); + } + }); +} + checkEntry(process.argv[2]); \ No newline at end of file diff --git a/build-tools/api_check_plugin/src/api_check_plugin.js b/build-tools/api_check_plugin/src/api_check_plugin.js index f58b20b91..109603508 100644 --- a/build-tools/api_check_plugin/src/api_check_plugin.js +++ b/build-tools/api_check_plugin/src/api_check_plugin.js @@ -15,6 +15,7 @@ const path = require('path'); const fs = require('fs'); +const request = require("sync-request") const { checkSpelling } = require('./check_spelling'); const { checkAPIDecorators } = require('./check_decorator'); const { checkPermission } = require('./check_permission'); @@ -25,6 +26,7 @@ const { checkJSDoc } = require('./check_legality'); const { hasAPINote, ApiCheckResult, requireTypescriptModule } = require('./utils'); const ts = requireTypescriptModule(); let result = require('../check_result.json'); +const rules = require('../code_style_rule.json') function checkAPICodeStyle(url) { if (fs.existsSync(url)) { @@ -100,3 +102,40 @@ function scanEntry(url) { return result.scanResult; } exports.scanEntry = scanEntry; + +function reqGitApi(scanResult, prId) { + const administrators = new Set(); + rules.administrators.forEach((administrator) => { + administrators.add(administrator.user); + }) + if (ApiCheckResult.format_check_result || !prId || prId === 'NA') { + return scanResult; + } + const commentRequestPath = `https://gitee.com/api/v5/repos/openharmony/interface_sdk-js/pulls/${prId}/comments?page=1&per_page=100&direction=desc`; + let res = request('GET', commentRequestPath, { + headers: { + 'Content-Type': 'application/json;charset=UFT-8' + } + }); + if (res.statusCode !== 200) { + throw `The giteeAPI access failed, StatusCode:${res.statusCode}`; + } + let resBody = new TextDecoder('utf-8').decode(res.body); + let comments = JSON.parse(`{"resultBody": ${resBody}}`); + let resultBody = comments.resultBody; + if (!resultBody || resultBody.length === 0 || !(resultBody instanceof Array)) { + throw "The format of data returned by giteeAPI is incorrect"; + } + for (let i = 0; i < resultBody.length; i++) { + const comment = resultBody[i]; + if (comment && comment['user'] && comment['user']['id'] && administrators.has(String(comment['user']['id'])) && + comment.body && /^approve api check$/.test(comment.body)) { + ApiCheckResult.format_check_result = true; + scanResult = ['api_check: true']; + break; + } + } + return scanResult; + +} +exports.reqGitApi = reqGitApi; From 937fd1caecb38a243cf480a360417e56a9bf8e7b Mon Sep 17 00:00:00 2001 From: wangkailong Date: Wed, 17 May 2023 19:09:22 +0800 Subject: [PATCH 18/21] crossplant Signed-off-by: wangkailong Change-Id: I5c3635064b5120341aa05256a462b7b6e2fe77a2 --- api/@ohos.app.ability.AbilityConstant.d.ts | 66 ++++++++-- ....app.ability.AbilityLifecycleCallback.d.ts | 64 ++++++++-- api/@ohos.app.ability.AbilityStage.d.ts | 34 ++++- api/@ohos.app.ability.Configuration.d.ts | 24 +++- ...hos.app.ability.ConfigurationConstant.d.ts | 16 ++- api/@ohos.app.ability.UIAbility.d.ts | 79 ++++++++++-- api/@ohos.app.ability.Want.d.ts | 35 +++++- api/@ohos.app.ability.common.d.ts | 48 ++++++- api/@ohos.bundle.bundleManager.d.ts | 28 ++++- api/application/AbilityStageContext.d.ts | 22 ++++ api/application/ApplicationContext.d.ts | 56 ++++++++- api/application/BaseContext.d.ts | 16 ++- api/application/Context.d.ts | 102 +++++++++++++-- api/application/ProcessInformation.d.ts | 21 ++++ api/application/UIAbilityContext.d.ts | 81 +++++++++++- api/bundleManager/AbilityInfo.d.ts | 117 ++++++++++++++++-- api/bundleManager/ApplicationInfo.d.ts | 81 ++++++++++-- api/bundleManager/HapModuleInfo.d.ts | 99 +++++++++++++-- 18 files changed, 885 insertions(+), 104 deletions(-) diff --git a/api/@ohos.app.ability.AbilityConstant.d.ts b/api/@ohos.app.ability.AbilityConstant.d.ts index 615528416..31e9ba78e 100644 --- a/api/@ohos.app.ability.AbilityConstant.d.ts +++ b/api/@ohos.app.ability.AbilityConstant.d.ts @@ -18,35 +18,61 @@ * @namespace AbilityConstant * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ +/** + * The definition of AbilityConstant. + * @namespace AbilityConstant + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ declare namespace AbilityConstant { /** * Interface of launch param. * @typedef LaunchParam * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Interface of launch param. + * @typedef LaunchParam + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export interface LaunchParam { /** * Indicates launch reason. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates launch reason. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ launchReason: LaunchReason; /** * Indicates last exit reason. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates last exit reason. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ lastExitReason: LastExitReason; } @@ -55,16 +81,28 @@ declare namespace AbilityConstant { * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Type of launch reason. + * @enum { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export enum LaunchReason { /** * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ UNKNOWN = 0, /** @@ -106,16 +144,28 @@ declare namespace AbilityConstant { * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Type of last exit reason. + * @enum { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export enum LastExitReason { /** * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ UNKNOWN = 0, /** diff --git a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts index c23829dda..9441c0dcb 100644 --- a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts +++ b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts @@ -21,18 +21,31 @@ import window from './@ohos.window'; * The ability lifecycle callback. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ +/** + * The ability lifecycle callback. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ export default class AbilityLifecycleCallback { /** * Called back when an ability is started for initialization. * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when an ability is started for initialization. + * @param { Ability } ability - Indicates the ability to register for listening. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onAbilityCreate(ability: UIAbility): void; /** @@ -41,9 +54,17 @@ export default class AbilityLifecycleCallback { * @param { window.WindowStage } windowStage - window stage to create * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when a window stage is created. + * @param { Ability } ability - Indicates the ability to register for listening. + * @param { window.WindowStage } windowStage - window stage to create + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void; /** @@ -72,9 +93,17 @@ export default class AbilityLifecycleCallback { * @param { window.WindowStage } windowStage - window stage to destroy * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when a window stage is destroyed. + * @param { Ability } ability - Indicates the ability to register for listening. + * @param { window.WindowStage } windowStage - window stage to destroy + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onWindowStageDestroy(ability: UIAbility, windowStage: window.WindowStage): void; /** @@ -82,9 +111,16 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when an ability is destroyed. + * @param { Ability } ability - Indicates the ability to register for listening. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onAbilityDestroy(ability: UIAbility): void; /** @@ -92,9 +128,16 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when the state of an ability changes to foreground. + * @param { Ability } ability - Indicates the ability to register for listening. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onAbilityForeground(ability: UIAbility): void; /** @@ -102,9 +145,16 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when the state of an ability changes to background. + * @param { Ability } ability - Indicates the ability to register for listening. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onAbilityBackground(ability: UIAbility): void; /** diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts index 667e5c7e0..2c3063a71 100644 --- a/api/@ohos.app.ability.AbilityStage.d.ts +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -22,27 +22,46 @@ import { Configuration } from './@ohos.app.ability.Configuration'; * The class of an ability stage. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ +/** + * The class of an ability stage. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export default class AbilityStage { /** * Indicates configuration information about context. * @type { AbilityStageContext } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates configuration information about context. + * @type { AbilityStageContext } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ context: AbilityStageContext; /** * Called back when an ability stage is started for initialization. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when an ability stage is started for initialization. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ onCreate(): void; /** @@ -62,9 +81,16 @@ export default class AbilityStage { * @param { Configuration } newConfig - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called when the system configuration is updated. + * @param { Configuration } newConfig - Indicates the updated configuration. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ onConfigurationUpdate(newConfig: Configuration): void; /** diff --git a/api/@ohos.app.ability.Configuration.d.ts b/api/@ohos.app.ability.Configuration.d.ts index c9680ae6f..6f9253dcf 100644 --- a/api/@ohos.app.ability.Configuration.d.ts +++ b/api/@ohos.app.ability.Configuration.d.ts @@ -19,9 +19,15 @@ import ConfigurationConstant from "./@ohos.app.ability.ConfigurationConstant"; * configuration item. * @typedef Configuration * @syscap SystemCapability.Ability.AbilityBase - * @crossplatform * @since 9 */ +/** + * configuration item. + * @typedef Configuration + * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform + * @since 10 + */ export interface Configuration { /** * Indicates the current language of the application. @@ -35,18 +41,30 @@ export interface Configuration { * Indicates the current colorMode of the application. * @type { ConfigurationConstant.ColorMode } * @syscap SystemCapability.Ability.AbilityBase - * @crossplatform * @since 9 */ + /** + * Indicates the current colorMode of the application. + * @type { ConfigurationConstant.ColorMode } + * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform + * @since 10 + */ colorMode?: ConfigurationConstant.ColorMode; /** * Indicates the screen direction of the current device. * @type { ConfigurationConstant.Direction } * @syscap SystemCapability.Ability.AbilityBase - * @crossplatform * @since 9 */ + /** + * Indicates the screen direction of the current device. + * @type { ConfigurationConstant.Direction } + * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform + * @since 10 + */ direction?: ConfigurationConstant.Direction; /** diff --git a/api/@ohos.app.ability.ConfigurationConstant.d.ts b/api/@ohos.app.ability.ConfigurationConstant.d.ts index a7e2aad7b..c8091ad8f 100644 --- a/api/@ohos.app.ability.ConfigurationConstant.d.ts +++ b/api/@ohos.app.ability.ConfigurationConstant.d.ts @@ -24,9 +24,15 @@ declare namespace ConfigurationConstant { * ColorMode * @enum { number } * @syscap SystemCapability.Ability.AbilityBase - * @crossplatform * @since 9 */ + /** + * ColorMode + * @enum { number } + * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform + * @since 10 + */ export enum ColorMode { COLOR_MODE_NOT_SET = -1, COLOR_MODE_DARK = 0, @@ -37,9 +43,15 @@ declare namespace ConfigurationConstant { * Direction * @enum { number } * @syscap SystemCapability.Ability.AbilityBase - * @crossplatform * @since 9 */ + /** + * Direction + * @enum { number } + * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform + * @since 10 + */ export enum Direction { DIRECTION_NOT_SET = -1, DIRECTION_VERTICAL = 0, diff --git a/api/@ohos.app.ability.UIAbility.d.ts b/api/@ohos.app.ability.UIAbility.d.ts index a93d79069..c0856d34f 100644 --- a/api/@ohos.app.ability.UIAbility.d.ts +++ b/api/@ohos.app.ability.UIAbility.d.ts @@ -195,18 +195,31 @@ export interface Callee { * The class of a UI ability. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ +/** + * The class of a UI ability. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ export default class UIAbility extends Ability { /** * Indicates configuration information about an ability context. * @type { UIAbilityContext } * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates configuration information about an ability context. + * @type { UIAbilityContext } + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ context: UIAbilityContext; /** @@ -242,9 +255,17 @@ export default class UIAbility extends Ability { * @param { AbilityConstant.LaunchParam } param - Indicates the launch param. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when an ability is started for initialization. + * @param { Want } want - Indicates the want info of the created ability. + * @param { AbilityConstant.LaunchParam } param - Indicates the launch param. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onCreate(want: Want, param: AbilityConstant.LaunchParam): void; /** @@ -252,18 +273,31 @@ export default class UIAbility extends Ability { * @param { window.WindowStage } windowStage - Indicates the created WindowStage. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when an ability window stage is created. + * @param { window.WindowStage } windowStage - Indicates the created WindowStage. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onWindowStageCreate(windowStage: window.WindowStage): void; /** * Called back when an ability window stage is destroyed. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when an ability window stage is destroyed. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onWindowStageDestroy(): void; /** @@ -279,27 +313,45 @@ export default class UIAbility extends Ability { * Called back before an ability is destroyed. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back before an ability is destroyed. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onDestroy(): void | Promise; /** * Called back when the state of an ability changes to foreground. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when the state of an ability changes to foreground. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onForeground(): void; /** * Called back when the state of an ability changes to background. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called back when the state of an ability changes to background. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onBackground(): void; /** @@ -319,9 +371,18 @@ export default class UIAbility extends Ability { * @param { AbilityConstant.LaunchParam } launchParams - Indicates the launch parameters. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Called when the launch mode of an ability is set to singleton. + * This happens when you re-launch an ability that has been at the top of the ability stack. + * @param { Want } want - Indicates the want info of ability. + * @param { AbilityConstant.LaunchParam } launchParams - Indicates the launch parameters. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @crossplatform + * @since 10 + */ onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; /** diff --git a/api/@ohos.app.ability.Want.d.ts b/api/@ohos.app.ability.Want.d.ts index 9c2dbd82d..875ae4537 100644 --- a/api/@ohos.app.ability.Want.d.ts +++ b/api/@ohos.app.ability.Want.d.ts @@ -16,24 +16,39 @@ /** * Want is the basic communication component of the system. * @syscap SystemCapability.Ability.AbilityBase - * @crossplatform * @since 9 */ +/** + * Want is the basic communication component of the system. + * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform + * @since 10 + */ export default class Want { /** * bundle name * @syscap SystemCapability.Ability.AbilityBase - * @crossplatform * @since 9 */ + /** + * bundle name + * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform + * @since 10 + */ bundleName?: string; /** * ability name * @syscap SystemCapability.Ability.AbilityBase - * @crossplatform * @since 9 */ + /** + * ability name + * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform + * @since 10 + */ abilityName?: string; /** @@ -74,9 +89,14 @@ export default class Want { /** * The description of the WantParams object in an Want * @syscap SystemCapability.Ability.AbilityBase - * @crossplatform * @since 9 */ + /** + * The description of the WantParams object in an Want + * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform + * @since 10 + */ parameters?: { [key: string]: Object }; /** @@ -89,8 +109,13 @@ export default class Want { /** * The description of an module name in an want. * @syscap SystemCapability.Ability.AbilityBase - * @crossplatform * @since 9 */ + /** + * The description of an module name in an want. + * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform + * @since 10 + */ moduleName?: string; } diff --git a/api/@ohos.app.ability.common.d.ts b/api/@ohos.app.ability.common.d.ts index 7647a6df7..8a3afdccc 100644 --- a/api/@ohos.app.ability.common.d.ts +++ b/api/@ohos.app.ability.common.d.ts @@ -30,44 +30,73 @@ import { ConnectOptions as _ConnectOptions } from "./ability/connectOptions"; * This module provides application context classes and common data structures. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ +/** + * This module provides application context classes and common data structures. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ declare namespace common { /** * The context of an ability. It allows access to ability-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * The context of an ability. It allows access to ability-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export type UIAbilityContext = _UIAbilityContext.default /** * The context of an abilityStage. It allows access to abilityStage-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * The context of an abilityStage. It allows access to abilityStage-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export type AbilityStageContext = _AbilityStageContext.default /** * The context of an application. It allows access to application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * The context of an application. It allows access to application-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export type ApplicationContext = _ApplicationContext.default /** * The base context of 'app.Context' for FA Mode or 'application.Context' for Stage Mode. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @crossplatform * @since 9 */ + /** + * The base context of 'app.Context' for FA Mode or 'application.Context' for Stage Mode. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @crossplatform + * @since 10 + */ export type BaseContext = _BaseContext.default /** @@ -75,9 +104,16 @@ declare namespace common { * application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * The base context of an ability or an application. It allows access to + * application-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export type Context = _Context.default /** diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 41376ebcc..f692dd277 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -474,26 +474,45 @@ declare namespace bundleManager { * * @enum { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Launch type + * + * @enum { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ export enum LaunchType { /** * Indicates that the ability has only one instance * * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates that the ability has only one instance + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ SINGLETON = 0, /** * Indicates that the ability can have multiple instances * * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates that the ability can have multiple instances + * + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ MULTITON = 1, /** @@ -518,6 +537,7 @@ declare namespace bundleManager { * Indicates that the ability has a UI * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @FAModelOnly * @since 9 */ PAGE = 1, @@ -526,6 +546,7 @@ declare namespace bundleManager { * Indicates that the ability does not have a UI * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @FAModelOnly * @since 9 */ SERVICE = 2, @@ -534,6 +555,7 @@ declare namespace bundleManager { * Indicates that the ability is used to provide data access services * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @FAModelOnly * @since 9 */ DATA = 3 diff --git a/api/application/AbilityStageContext.d.ts b/api/application/AbilityStageContext.d.ts index 0c2ff7521..aff0aa438 100644 --- a/api/application/AbilityStageContext.d.ts +++ b/api/application/AbilityStageContext.d.ts @@ -24,6 +24,14 @@ import Context from "./Context"; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + */ +/** + * The context of an abilityStage. It allows access to abilityStage-specific resources. + * + * @since 10 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly * @crossplatform */ export default class AbilityStageContext extends Context { @@ -34,6 +42,13 @@ export default class AbilityStageContext extends Context { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + */ + /** + * Indicates configuration information about an module. + * + * @since 10 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly * @crossplatform */ currentHapModuleInfo: HapModuleInfo; @@ -44,6 +59,13 @@ export default class AbilityStageContext extends Context { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + */ + /** + * Indicates configuration information. + * + * @since 10 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly * @crossplatform */ config: Configuration; diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts index 23b0e3211..3e2266ff5 100644 --- a/api/application/ApplicationContext.d.ts +++ b/api/application/ApplicationContext.d.ts @@ -23,9 +23,15 @@ import { ProcessInformation } from "./ProcessInformation"; * The context of an application. It allows access to application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ +/** + * The context of an application. It allows access to application-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export default class ApplicationContext extends Context { /** * Register ability lifecycle callback. @@ -35,9 +41,19 @@ export default class ApplicationContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Register ability lifecycle callback. + * @param { string } type - abilityLifecycle. + * @param { AbilityLifecycleCallback } callback - The ability lifecycle callback. + * @returns { number } Returns the number code of the callback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ on(type: "abilityLifecycle", callback: AbilityLifecycleCallback): number; /** @@ -48,9 +64,19 @@ export default class ApplicationContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Unregister ability lifecycle callback. + * @param { string } type - abilityLifecycle. + * @param { number } callbackId - Indicates the number code of the callback. + * @param { AsyncCallback } callback - The callback of off. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ off(type: "abilityLifecycle", callbackId: number, callback: AsyncCallback): void; /** @@ -109,9 +135,19 @@ export default class ApplicationContext extends Context { * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Get information about running processes + * @returns { Promise> } Returns the array of {@link ProcessInformation}. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ getRunningProcessInformation(): Promise>; /** @@ -122,9 +158,19 @@ export default class ApplicationContext extends Context { * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Get information about running processes + * @param { AsyncCallback> } callback - The callback is used to return the array of {@link ProcessInformation}. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ getRunningProcessInformation(callback: AsyncCallback>): void; /** diff --git a/api/application/BaseContext.d.ts b/api/application/BaseContext.d.ts index 5f2f1b2b3..42cfdad2d 100644 --- a/api/application/BaseContext.d.ts +++ b/api/application/BaseContext.d.ts @@ -16,11 +16,17 @@ /** * The base context of 'app.Context' for FA Mode or * 'application.Context' for Stage Mode. - * + * @permission N/A + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 8 + */ +/** + * The base context of 'app.Context' for FA Mode or + * 'application.Context' for Stage Mode. + * @permission N/A * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform - * @permission N/A + * @since 10 */ export default abstract class BaseContext { /** @@ -28,6 +34,12 @@ export default abstract class BaseContext { * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + /** + * Indicates the context is FA Mode or Stage Mode. + * + * @since 10 + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform */ stageMode: boolean; diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts index aace8f2ae..d10fe1edc 100644 --- a/api/application/Context.d.ts +++ b/api/application/Context.d.ts @@ -25,18 +25,32 @@ import contextConstant from "../@ohos.app.ability.contextConstant" * application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ +/** + * The base context of an ability or an application. It allows access to + * application-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export default class Context extends BaseContext { /** * Indicates the capability of accessing application resources. * @type { resmgr.ResourceManager } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates the capability of accessing application resources. + * @type { resmgr.ResourceManager } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ resourceManager: resmgr.ResourceManager; /** @@ -44,9 +58,16 @@ export default class Context extends BaseContext { * @type { ApplicationInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates configuration information about an application. + * @type { ApplicationInfo } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ applicationInfo: ApplicationInfo; /** @@ -54,9 +75,16 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates app cache dir. + * @type { string } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ cacheDir: string; /** @@ -64,9 +92,16 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates app temp dir. + * @type { string } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ tempDir: string; /** @@ -74,9 +109,16 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates app files dir. + * @type { string } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ filesDir: string; /** @@ -84,9 +126,16 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates app database dir. + * @type { string } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ databaseDir: string; /** @@ -94,9 +143,16 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates app preferences dir. + * @type { string } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ preferencesDir: string; /** @@ -104,9 +160,16 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates app bundle code dir. + * @type { string } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ bundleCodeDir: string; /** @@ -158,9 +221,18 @@ export default class Context extends BaseContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Create a module context + * @param { string } moduleName - Indicates the module name. + * @returns { Context } Returns the application context. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ createModuleContext(moduleName: string): Context; /** @@ -182,8 +254,16 @@ export default class Context extends BaseContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Get application context + * @returns { ApplicationContext } Returns the application context. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ getApplicationContext(): ApplicationContext; } diff --git a/api/application/ProcessInformation.d.ts b/api/application/ProcessInformation.d.ts index bfbc8c6d0..1ae87b84a 100644 --- a/api/application/ProcessInformation.d.ts +++ b/api/application/ProcessInformation.d.ts @@ -17,6 +17,12 @@ * The class of an process information. * * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ +/** + * The class of an process information. + * + * @since 10 * @crossplatform * @syscap SystemCapability.Ability.AbilityRuntime.Core */ @@ -24,6 +30,11 @@ export interface ProcessInformation { /** * @default process id * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + /** + * @default process id + * @since 10 * @crossplatform * @syscap SystemCapability.Ability.AbilityRuntime.Core */ @@ -39,6 +50,11 @@ export interface ProcessInformation { /** * @default the name of the process * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + /** + * @default the name of the process + * @since 10 * @crossplatform * @syscap SystemCapability.Ability.AbilityRuntime.Core */ @@ -47,6 +63,11 @@ export interface ProcessInformation { /** * @default an array of the bundleNames running in the process * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + /** + * @default an array of the bundleNames running in the process + * @since 10 * @crossplatform * @syscap SystemCapability.Ability.AbilityRuntime.Core */ diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts index 448e8b6b8..29e93cfec 100644 --- a/api/application/UIAbilityContext.d.ts +++ b/api/application/UIAbilityContext.d.ts @@ -33,18 +33,31 @@ import dialogRequest from "../@ohos.app.ability.dialogRequest"; * The context of an ability. It allows access to ability-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ +/** + * The context of an ability. It allows access to ability-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ export default class UIAbilityContext extends Context { /** * Indicates configuration information about an ability. * @type { AbilityInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates configuration information about an ability. + * @type { AbilityInfo } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ abilityInfo: AbilityInfo; /** @@ -52,9 +65,16 @@ export default class UIAbilityContext extends Context { * @type { HapModuleInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Indicates configuration information about the module. + * @type { HapModuleInfo } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ currentHapModuleInfo: HapModuleInfo; /** @@ -86,9 +106,31 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Starts a new ability. + * @param want { Want } - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ startAbility(want: Want, callback: AsyncCallback): void; /** @@ -640,9 +682,23 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Destroys this Page ability. + * @param { AsyncCallback } callback - The callback of terminateSelf. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ terminateSelf(callback: AsyncCallback): void; /** @@ -656,9 +712,22 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly - * @crossplatform * @since 9 */ + /** + * Destroys this Page ability. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 10 + */ terminateSelf(): Promise; /** diff --git a/api/bundleManager/AbilityInfo.d.ts b/api/bundleManager/AbilityInfo.d.ts index c55e73b37..be6bbea56 100644 --- a/api/bundleManager/AbilityInfo.d.ts +++ b/api/bundleManager/AbilityInfo.d.ts @@ -22,18 +22,32 @@ import bundleManager from './../@ohos.bundle.bundleManager'; * * @typedef AbilityInfo * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ +/** + * Obtains configuration information about an ability + * + * @typedef AbilityInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ export interface AbilityInfo { /** * Indicates the name of the bundle containing the ability * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the name of the bundle containing the ability + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly bundleName: string; /** @@ -41,9 +55,16 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the name of the .hap package to which the capability belongs + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly moduleName: string; /** @@ -51,9 +72,16 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Ability simplified class name + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly name: string; /** @@ -61,9 +89,16 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the label of the ability + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly label: string; /** @@ -71,9 +106,16 @@ export interface AbilityInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the label id of the ability + * + * @type { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly labelId: number; /** @@ -81,9 +123,16 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the ability + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly description: string; /** @@ -91,9 +140,16 @@ export interface AbilityInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the description id of the ability + * + * @type { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly descriptionId: number; /** @@ -101,9 +157,16 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the icon of the ability + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly icon: string; /** @@ -111,9 +174,16 @@ export interface AbilityInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the icon id of the ability + * + * @type { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly iconId: number; /** @@ -158,9 +228,16 @@ export interface AbilityInfo { * * @type { bundleManager.LaunchType } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Enumerates ability launch type + * + * @type { bundleManager.LaunchType } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly launchType: bundleManager.LaunchType; /** @@ -216,9 +293,16 @@ export interface AbilityInfo { * * @type { ApplicationInfo } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Obtains configuration information about an application + * + * @type { ApplicationInfo } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly applicationInfo: ApplicationInfo; /** @@ -226,9 +310,16 @@ export interface AbilityInfo { * * @type { Array } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the metadata of ability + * + * @type { Array } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly metadata: Array; /** diff --git a/api/bundleManager/ApplicationInfo.d.ts b/api/bundleManager/ApplicationInfo.d.ts index 8bccecf38..7296d04f8 100644 --- a/api/bundleManager/ApplicationInfo.d.ts +++ b/api/bundleManager/ApplicationInfo.d.ts @@ -22,18 +22,32 @@ import bundleManager from './../@ohos.bundle.bundleManager'; * * @typedef ApplicationInfo * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ +/** + * Obtains configuration information about an application + * + * @typedef ApplicationInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ export interface ApplicationInfo { /** * Indicates the application name, which is the same as {@code bundleName} * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the application name, which is the same as {@code bundleName} + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly name: string; /** @@ -41,9 +55,16 @@ export interface ApplicationInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Description of application + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly description: string; /** @@ -51,9 +72,16 @@ export interface ApplicationInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the description id of the application + * + * @type { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly descriptionId: number; /** @@ -70,9 +98,16 @@ export interface ApplicationInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the label of the application + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly label: string; /** @@ -80,9 +115,16 @@ export interface ApplicationInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the label id of the application + * + * @type { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly labelId: number; /** @@ -90,9 +132,16 @@ export interface ApplicationInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the icon of the application + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly icon: string; /** @@ -100,9 +149,16 @@ export interface ApplicationInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the icon id of the application + * + * @type { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly iconId: number; /** @@ -128,9 +184,16 @@ export interface ApplicationInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the application source code path + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly codePath: string; /** diff --git a/api/bundleManager/HapModuleInfo.d.ts b/api/bundleManager/HapModuleInfo.d.ts index be284b9a1..13953ec75 100644 --- a/api/bundleManager/HapModuleInfo.d.ts +++ b/api/bundleManager/HapModuleInfo.d.ts @@ -23,18 +23,32 @@ import bundleManager from './../@ohos.bundle.bundleManager'; * * @typedef HapModuleInfo * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ +/** + * Obtains configuration information about a hap module. + * + * @typedef HapModuleInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ export interface HapModuleInfo { /** * Indicates the name of this hap module * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the name of this hap module + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly name: string; /** @@ -42,9 +56,16 @@ export interface HapModuleInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the icon of this hap module + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly icon: string; /** @@ -52,9 +73,16 @@ export interface HapModuleInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the icon id of this hap module + * + * @type { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly iconId: number; /** @@ -62,9 +90,16 @@ export interface HapModuleInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the label of this hap module + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly label: string; /** @@ -72,9 +107,16 @@ export interface HapModuleInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the label id of this hap module + * + * @type { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly labelId: number; /** @@ -82,9 +124,16 @@ export interface HapModuleInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Describes the hap module + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly description: string; /** @@ -92,9 +141,16 @@ export interface HapModuleInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the description of this hap module + * + * @type { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly descriptionId: number; /** @@ -102,9 +158,16 @@ export interface HapModuleInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates main elementName of the hap module + * + * @type { string } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly mainElementName: string; /** @@ -112,9 +175,16 @@ export interface HapModuleInfo { * * @type { Array } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Obtains configuration information about abilities + * + * @type { Array } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly abilitiesInfo: Array; /** @@ -131,9 +201,16 @@ export interface HapModuleInfo { * * @type { Array } * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @crossplatform * @since 9 */ + /** + * Indicates the metadata of ability + * + * @type { Array } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform + * @since 10 + */ readonly metadata: Array; /** From 10b6ba9e41724cd7e0d770b3ea9a2415c51751a5 Mon Sep 17 00:00:00 2001 From: zhoutianer Date: Mon, 3 Apr 2023 19:17:54 +0800 Subject: [PATCH 19/21] delete borderStyle duplicate interface Signed-off-by: Tianer Zhou Change-Id: I741a953fb6fdc92c789415e13c7d81d2fbf2c3f7 Signed-off-by: zhoutianer --- api/@internal/component/ets/common.d.ts | 36 +++++++++++-------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index a0d079a18..291c9fabf 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -2969,14 +2969,14 @@ declare class CommonMethod { * @form * @since 9 */ - borderStyle(value: BorderStyle): T; - /** * Border style + * @param { BorderStyle | EdgeStyles } value * @form - * @since 9 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 */ - borderStyle(value: EdgeStyles): T; + borderStyle(value: BorderStyle | EdgeStyles): T; /** * Border width @@ -2987,18 +2987,14 @@ declare class CommonMethod { * @form * @since 9 */ - borderWidth(value: Length): T; - - /** - * Border width - * @since 9 - */ /** * Border width + * @param { Length | EdgeWidths } value * @form - * @since 9 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 */ - borderWidth(value: EdgeWidths): T; + borderWidth(value: Length | EdgeWidths): T; /** * Border color @@ -3009,14 +3005,14 @@ declare class CommonMethod { * @form * @since 9 */ - borderColor(value: ResourceColor): T; - /** * Border color + * @param { ResourceColor | EdgeColors } value * @form - * @since 9 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 */ - borderColor(value: EdgeColors): T; + borderColor(value: ResourceColor | EdgeColors): T; /** * Border radius @@ -3027,14 +3023,14 @@ declare class CommonMethod { * @form * @since 9 */ - borderRadius(value: Length): T; - /** * Border radius + * @param { Length | BorderRadiuses } value * @form - * @since 9 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 */ - borderRadius(value: BorderRadiuses): T; + borderRadius(value: Length | BorderRadiuses): T; /** * Border image From a3bff1531615bbe77a5cfeb3f8639f333d5818c1 Mon Sep 17 00:00:00 2001 From: HYH Date: Mon, 22 May 2023 07:21:57 +0000 Subject: [PATCH 20/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9sensor=E8=BF=90?= =?UTF-8?q?=E5=8A=A8=E8=A1=A8=E6=94=AF=E6=8C=81=E7=9A=84syscap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: HYH --- api/device-define/liteWearable.json | 1 - 1 file changed, 1 deletion(-) diff --git a/api/device-define/liteWearable.json b/api/device-define/liteWearable.json index ed71d6dff..cf2747d8f 100644 --- a/api/device-define/liteWearable.json +++ b/api/device-define/liteWearable.json @@ -6,7 +6,6 @@ "SystemCapability.PowerManager.BatteryManager.Core", "SystemCapability.FileManagement.File.FileIO", "SystemCapability.Startup.SystemInfo", - "SystemCapability.Sensors.Sensor", "SystemCapability.PowerManager.DisplayPowerManager", "SystemCapability.Communication.NFC.CardEmulation" ] From 15a53f35c401b811e13e44d651b8c5abac304192 Mon Sep 17 00:00:00 2001 From: jiaoyanlin3 Date: Mon, 22 May 2023 19:14:55 +0800 Subject: [PATCH 21/21] =?UTF-8?q?Js=20Doc=E8=A7=84=E8=8C=83=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jiaoyanlin3 --- api/@ohos.multimedia.audio.d.ts | 1654 +++++++++++++++++-------------- 1 file changed, 894 insertions(+), 760 deletions(-) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index a1440c265..d359ac6bf 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -22,411 +22,421 @@ import { ErrorCallback, AsyncCallback, Callback } from './@ohos.base'; declare namespace audio { /** * Enumerates audio errors. - * @since 9 + * @enum {number} * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ enum AudioErrors { /** * Invalid parameter. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ ERROR_INVALID_PARAM = 6800101, /** * Allocate memory failed. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ ERROR_NO_MEMORY = 6800102, /** * Operation not permit at current state. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ ERROR_ILLEGAL_STATE = 6800103, /** * Unsupported option. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ ERROR_UNSUPPORTED = 6800104, /** * Time out. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ ERROR_TIMEOUT = 6800105, /** * Audio specific errors. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ ERROR_STREAM_LIMIT = 6800201, /** * Default error. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ ERROR_SYSTEM = 6800301 } /** * Define local device network id for audio - * @since 9 + * @constant * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ const LOCAL_NETWORK_ID: string; /** * Define default volume group id for audio - * @since 9 + * @constant * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ const DEFAULT_VOLUME_GROUP_ID: number; /** * Define default interrupt group id for audio - * @since 9 + * @constant * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @since 9 */ const DEFAULT_INTERRUPT_GROUP_ID: number; /** * Obtains an {@link AudioManager} instance. - * @returns AudioManager object. - * @since 7 + * @returns { AudioManager } this {@link AudioManager} object. * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ function getAudioManager(): AudioManager; /** * Obtains an {@link AudioCapturer} instance. This method uses an asynchronous callback to return the capturer instance. - * @param options Capturer configurations. - * @param callback Callback used to return the audio capturer instance. - * @since 8 + * @param { AudioCapturerOptions } options - Capturer configurations. + * @param { AsyncCallback } callback - Callback used to return the audio capturer instance. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ function createAudioCapturer(options: AudioCapturerOptions, callback: AsyncCallback): void; /** * Obtains an {@link AudioCapturer} instance. This method uses a promise to return the capturer instance. - * @param options Capturer configurations. - * @returns Promise used to return the audio capturer instance. - * @since 8 + * @param { AudioCapturerOptions } options - Capturer configurations. + * @returns { Promise } Promise used to return the audio capturer instance. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ function createAudioCapturer(options: AudioCapturerOptions): Promise; /** * Obtains an {@link AudioRenderer} instance. This method uses an asynchronous callback to return the renderer instance. - * @param options Renderer configurations. - * @param callback Callback used to return the audio renderer instance. - * @since 8 + * @param { AudioRendererOptions } options - Renderer configurations. + * @param { AsyncCallback } callback - Callback used to return the audio renderer instance. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ function createAudioRenderer(options: AudioRendererOptions, callback: AsyncCallback): void; /** * Obtains an {@link AudioRenderer} instance. This method uses a promise to return the renderer instance. - * @param options Renderer configurations. - * @returns Promise used to return the audio renderer instance. - * @since 8 + * @param { AudioRendererOptions } options - Renderer configurations. + * @returns { Promise } Promise used to return the audio renderer instance. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ function createAudioRenderer(options: AudioRendererOptions): Promise; /** * Obtains a {@link TonePlayer} instance. This method uses an asynchronous callback to return the renderer instance. - * @param options Tone playing attribute. - * @returns Promise used to return the tone player instance. - * @since 9 + * @param { AudioRendererInfo } options - Tone playing attribute. + * @param { AsyncCallback } callback - Callback used to return the tonePlayer instance. * @syscap SystemCapability.Multimedia.Audio.Tone * @systemapi + * @since 9 */ function createTonePlayer(options: AudioRendererInfo, callback: AsyncCallback): void; /** * Obtains a {@link TonePlayer} instance. This method uses a promise to return the renderer instance. - * @param options Tone playing attribute. - * @returns Promise used to return the tone player instance. - * @since 9 + * @param { AudioRendererInfo } options - Tone playing attribute. + * @returns { Promise } Promise used to return the tonePlayer instance. * @syscap SystemCapability.Multimedia.Audio.Tone * @systemapi + * @since 9 */ function createTonePlayer(options: AudioRendererInfo): Promise; /** * Enumerates the audio states. - * @since 8 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ enum AudioState { /** * Invalid state. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ STATE_INVALID = -1, /** * Create new instance state. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ STATE_NEW = 0, /** * Prepared state. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ STATE_PREPARED = 1, /** * Running state. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ STATE_RUNNING = 2, /** * Stopped state. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ STATE_STOPPED = 3, /** * Released state. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ STATE_RELEASED = 4, /** * Paused state. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ STATE_PAUSED = 5 } /** * Enumerates audio stream types. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 */ enum AudioVolumeType { /** * Audio streams for voice calls. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 8 */ VOICE_CALL = 0, /** * Audio streams for ringtones. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 */ RINGTONE = 2, /** * Audio streams for media purpose. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 */ MEDIA = 3, /** * Audio stream for voice assistant. * Audio volume for alarm purpose. - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 10 */ ALARM = 4, /** * Audio volume for accessibility purpose. - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 10 */ ACCESSIBILITY = 5, /** * Audio stream for voice assistant. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 8 */ VOICE_ASSISTANT = 9, /** * Audio volume for ultrasonic. - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 10 */ ULTRASONIC = 10, /** * Audio stream for all common. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ ALL = 100, } /** * Enumerates audio device flags. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ enum DeviceFlag { /** * None devices. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ NONE_DEVICES_FLAG = 0, /** * Output devices. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ OUTPUT_DEVICES_FLAG = 1, /** * Input devices. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ INPUT_DEVICES_FLAG = 2, /** * All devices. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ ALL_DEVICES_FLAG = 3, /** * Distributed output devices. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ DISTRIBUTED_OUTPUT_DEVICES_FLAG = 4, /** * Distributed input devices. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ DISTRIBUTED_INPUT_DEVICES_FLAG = 8, /** * All Distributed devices. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ ALL_DISTRIBUTED_DEVICES_FLAG = 12, } /** * Enumerates device roles. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ enum DeviceRole { /** * Input role. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ INPUT_DEVICE = 1, /** * Output role. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ OUTPUT_DEVICE = 2, } /** * Enumerates device types. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ enum DeviceType { /** * Invalid device. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ INVALID = 0, /** * Built-in earpiece. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ EARPIECE = 1, /** * Built-in speaker. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ SPEAKER = 2, /** * Wired headset, which is a combination of a pair of earpieces and a microphone. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ WIRED_HEADSET = 3, /** * A pair of wired headphones. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ WIRED_HEADPHONES = 4, /** * Bluetooth device using the synchronous connection oriented link (SCO). - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ BLUETOOTH_SCO = 7, /** * Bluetooth device using advanced audio distribution profile (A2DP). - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ BLUETOOTH_A2DP = 8, /** * Built-in microphone. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ MIC = 15, /** * USB audio headset. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ USB_HEADSET = 22, /** * Default device type. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ DEFAULT = 1000, } /** * Enumerates the active device types. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.CommunicationDeviceType */ enum ActiveDeviceType { /** * Speaker. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.CommunicationDeviceType.SPEAKER */ SPEAKER = 2, /** * Bluetooth device using the SCO link. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 */ BLUETOOTH_SCO = 7, @@ -434,617 +444,637 @@ declare namespace audio { /** * Enumerates the available device types for communication. - * @since 9 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 9 */ enum CommunicationDeviceType { /** * Speaker. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 9 */ SPEAKER = 2 } /** * Enumerates ringer modes. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 7 */ enum AudioRingMode { /** * Silent mode. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 7 */ RINGER_MODE_SILENT = 0, /** * Vibration mode. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 7 */ RINGER_MODE_VIBRATE = 1, /** * Normal mode. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 7 */ RINGER_MODE_NORMAL = 2, } /** * Enumerates the audio sample formats. - * @since 8 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ enum AudioSampleFormat { /** * Invalid format. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_FORMAT_INVALID = -1, /** * Unsigned 8 format. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_FORMAT_U8 = 0, /** * Signed 16 bit integer, little endian. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_FORMAT_S16LE = 1, /** * Signed 24 bit integer, little endian. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_FORMAT_S24LE = 2, /** * Signed 32 bit integer, little endian. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_FORMAT_S32LE = 3, /** * Signed 32 bit float, little endian. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ SAMPLE_FORMAT_F32LE = 4, } /** * Enumerates the audio channel. - * @since 8 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ enum AudioChannel { /** * Channel 1. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ CHANNEL_1 = 0x1 << 0, /** * Channel 2. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ CHANNEL_2 = 0x1 << 1 } /** * Enumerates the audio sampling rate. - * @since 8 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ enum AudioSamplingRate { /** * 8kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_8000 = 8000, /** * 11.025kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_11025 = 11025, /** * 12kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_12000 = 12000, /** * 16kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_16000 = 16000, /** * 22.05kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_22050 = 22050, /** * 24kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_24000 = 24000, /** * 32kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_32000 = 32000, /** * 44.1kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_44100 = 44100, /** * 48kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_48000 = 48000, /** * 64kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_64000 = 64000, /** * 96kHz sample rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SAMPLE_RATE_96000 = 96000 } /** * Enumerates the audio encoding type. - * @since 8 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ enum AudioEncodingType { /** * Invalid type. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ ENCODING_TYPE_INVALID = -1, /** * PCM encoding. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ ENCODING_TYPE_RAW = 0 } /** * Enumerates the audio content type. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ enum ContentType { /** * Unknown content. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ CONTENT_TYPE_UNKNOWN = 0, /** * Speech content. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ CONTENT_TYPE_SPEECH = 1, /** * Music content. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ CONTENT_TYPE_MUSIC = 2, /** * Movie content. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ CONTENT_TYPE_MOVIE = 3, /** * Notification content. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ CONTENT_TYPE_SONIFICATION = 4, /** * Ringtone content. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ CONTENT_TYPE_RINGTONE = 5, /** * Ultrasonic content. - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Core * @systemapi + * @since 10 */ CONTENT_TYPE_ULTRASONIC = 9 } /** * Enumerates the stream usage. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ enum StreamUsage { /** * Unknown usage. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ STREAM_USAGE_UNKNOWN = 0, /** * Media usage. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ STREAM_USAGE_MEDIA = 1, /** * Voice communication usage. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ STREAM_USAGE_VOICE_COMMUNICATION = 2, /** * Voice assistant broadcast usage. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ STREAM_USAGE_VOICE_ASSISTANT = 3, /** * Alarm usage. - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 10 */ STREAM_USAGE_ALARM = 4, /** * Notification or ringtone usage. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ STREAM_USAGE_NOTIFICATION_RINGTONE = 6, /** * Accessibility usage, such as screen reader. - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 10 */ STREAM_USAGE_ACCESSIBILITY = 8, /** * System usage, such as screen lock or key click. - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Core * @systemapi + * @since 10 */ STREAM_USAGE_SYSTEM = 9, } /** * Enumerates the audio interrupt request type. - * @since 9 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi + * @since 9 */ enum InterruptRequestType { /** * Default type to request audio interrupt. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi + * @since 9 */ INTERRUPT_REQUEST_TYPE_DEFAULT = 0, } /** * Describes audio stream information. - * @since 8 + * @typedef AudioStreamInfo * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ interface AudioStreamInfo { /** * Sampling rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ samplingRate: AudioSamplingRate; /** * Audio channels. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ channels: AudioChannel; /** * Audio sample format. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ sampleFormat: AudioSampleFormat; /** * Audio encoding type. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ encodingType: AudioEncodingType; } /** * Describes audio renderer information. - * @since 8 + * @typedef AudioRendererInfo * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ interface AudioRendererInfo { /** * Content type. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ content: ContentType; /** * Stream usage. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ usage: StreamUsage; /** * Audio renderer flags. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ rendererFlags: number; } /** * Describes audio renderer filter. - * @since 9 + * @typedef AudioRendererFilter * @syscap SystemCapability.Multimedia.Audio.Core * @systemapi + * @since 9 */ interface AudioRendererFilter { /** * Application uid. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core * @systemapi + * @since 9 */ uid?: number; /** * Renderer information. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer * @systemapi + * @since 9 */ rendererInfo?: AudioRendererInfo; /** * AudioRenderer id. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer * @systemapi + * @since 9 */ rendererId?: number; } /** * Describes audio renderer configuration options. - * @since 8 + * @typedef AudioRendererOptions * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ interface AudioRendererOptions { /** * Stream information. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ streamInfo: AudioStreamInfo; /** * Renderer information. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ rendererInfo: AudioRendererInfo; } /** * Enumerates the interrupt modes. - * @since 9 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @since 9 */ enum InterruptMode { /** * Mode that different stream share one interrupt unit. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @since 9 */ SHARE_MODE = 0, /** * Mode that each stream has independent interrupt unit. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @since 9 */ INDEPENDENT_MODE = 1 } /** * Enumerates the audio renderer rates. - * @since 8 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ enum AudioRendererRate { /** * Normal rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ RENDER_RATE_NORMAL = 0, /** * Double rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ RENDER_RATE_DOUBLE = 1, /** * Half rate. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ RENDER_RATE_HALF = 2 } /** * Enumerates the interrupt types. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 */ enum InterruptType { /** * Audio playback interruption started. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 */ INTERRUPT_TYPE_BEGIN = 1, /** * Audio playback interruption ended. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 */ INTERRUPT_TYPE_END = 2 } /** * Enumerates the interrupt hints. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 */ enum InterruptHint { /** * None. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ INTERRUPT_HINT_NONE = 0, /** * Resume the playback. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 */ INTERRUPT_HINT_RESUME = 1, /** * Paused/Pause the playback. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 */ INTERRUPT_HINT_PAUSE = 2, /** * Stopped/Stop the playback. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 */ INTERRUPT_HINT_STOP = 3, /** * Ducked the playback. (In ducking, the audio volume is reduced, but not silenced.) - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 */ INTERRUPT_HINT_DUCK = 4, /** * Unducked the playback. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ INTERRUPT_HINT_UNDUCK = 5, } /** * Enumerates the interrupt force types. - * @since 9 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ enum InterruptForceType { /** * Forced action taken by system. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ INTERRUPT_FORCE = 0, /** * Share type, application can choose to take action or ignore. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ INTERRUPT_SHARE = 1 } /** * Describes the interrupt event received by the app when playback is interrupted. - * @since 9 + * @typedef InterruptEvent * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ interface InterruptEvent { /** * Indicates whether the interruption has started or finished. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ eventType: InterruptType; /** * Indicates whether the action is taken by system or to be taken by the app. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ forceType: InterruptForceType; /** * Indicates the kind of action. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ hintType: InterruptHint; } /** * Enumerates interrupt action types. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ enum InterruptActionType { /** * Focus gain event. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ TYPE_ACTIVATED = 0, /** * Audio interruption event. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ TYPE_INTERRUPT = 1 @@ -1052,415 +1082,420 @@ declare namespace audio { /** * Enumerates device change types. - * @since 7 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ enum DeviceChangeType { /** * Device connection. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ CONNECT = 0, /** * Device disconnection. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ DISCONNECT = 1, } /** * Enumerates audio scenes. - * @since 8 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 8 */ enum AudioScene { /** * Default audio scene - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 8 */ AUDIO_SCENE_DEFAULT = 0, /** * Ringing audio scene - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication * @systemapi + * @since 8 */ AUDIO_SCENE_RINGING = 1, /** * Phone call audio scene - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication * @systemapi + * @since 8 */ AUDIO_SCENE_PHONE_CALL = 2, /** * Voice chat audio scene - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 8 */ AUDIO_SCENE_VOICE_CHAT = 3 } /** * Implements audio volume and audio device management. - * @since 7 + * @typedef AudioManager * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ interface AudioManager { /** * Sets the volume for a stream. This method uses an asynchronous callback to return the result. - * @param volumeType Audio stream type. - * @param volume Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. - * @param callback Callback used to return the result. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { number } volume - Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setVolume */ setVolume(volumeType: AudioVolumeType, volume: number, callback: AsyncCallback): void; /** * Sets the volume for a stream. This method uses a promise to return the result. - * @param volumeType Audio stream type. - * @param volume Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. - * @returns Promise used to return the result. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { number } volume - Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setVolume */ setVolume(volumeType: AudioVolumeType, volume: number): Promise; /** * Obtains the volume of a stream. This method uses an asynchronous callback to return the query result. - * @param volumeType Audio stream type. - * @param callback Callback used to return the volume. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { AsyncCallback } callback - Callback used to return the volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getVolume */ getVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** * Obtains the volume of a stream. This method uses a promise to return the query result. - * @param volumeType Audio stream type. - * @returns Promise used to return the volume. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @returns { Promise } Promise used to return the volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getVolume */ getVolume(volumeType: AudioVolumeType): Promise; /** * Obtains the minimum volume allowed for a stream. This method uses an asynchronous callback to return the query result. - * @param volumeType Audio stream type. - * @param callback Callback used to return the minimum volume. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { AsyncCallback } callback - Callback used to return the minimum volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMinVolume */ getMinVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** * Obtains the minimum volume allowed for a stream. This method uses a promise to return the query result. - * @param volumeType Audio stream type. - * @returns Promise used to return the minimum volume. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @returns { Promise } Promise used to return the minimum volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMinVolume */ getMinVolume(volumeType: AudioVolumeType): Promise; /** * Obtains the maximum volume allowed for a stream. This method uses an asynchronous callback to return the query result. - * @param volumeType Audio stream type. - * @param callback Callback used to return the maximum volume. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { AsyncCallback } callback - Callback used to return the maximum volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMaxVolume */ getMaxVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** * Obtains the maximum volume allowed for a stream. This method uses a promise to return the query result. - * @param volumeType Audio stream type. - * @returns Promise used to return the maximum volume. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @returns { Promise } Promise used to return the maximum volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMaxVolume */ getMaxVolume(volumeType: AudioVolumeType): Promise; /** * Obtains the audio devices with a specific flag. This method uses an asynchronous callback to return the query result. - * @param deviceFlag Audio device flag. - * @param callback Callback used to return the device list. - * @since 7 + * @param { DeviceFlag } deviceFlag - Audio device flag. + * @param { AsyncCallback } callback - Callback used to return the device list. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioRoutingManager#getDevices */ getDevices(deviceFlag: DeviceFlag, callback: AsyncCallback): void; /** * Obtains the audio devices with a specific flag. This method uses a promise to return the query result. - * @param deviceFlag Audio device flag. - * @returns Promise used to return the device list. - * @since 7 + * @param { DeviceFlag } deviceFlag - Audio device flag. + * @returns { Promise } Promise used to return the device list. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioRoutingManager#getDevices */ getDevices(deviceFlag: DeviceFlag): Promise; /** * Mutes a stream. This method uses an asynchronous callback to return the result. - * @param volumeType Audio stream type. - * @param mute Mute status to set. The value true means to mute the stream, and false means the opposite. - * @param callback Callback used to return the result. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { boolean } mute - Mute status to set. The value true means to mute the stream, and false means the opposite. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#mute */ mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback): void; /** * Mutes a stream. This method uses a promise to return the result. - * @param volumeType Audio stream type. - * @param mute Mute status to set. The value true means to mute the stream, and false means the opposite. - * @returns Promise used to return the result. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { boolean } mute - Mute status to set. The value true means to mute the stream, and false means the opposite. + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#mute */ mute(volumeType: AudioVolumeType, mute: boolean): Promise; /** * Checks whether a stream is muted. This method uses an asynchronous callback to return the query result. - * @param volumeType Audio stream type. - * @param callback Callback used to return the mute status of the stream. The value true means that the stream is - * muted, and false means the opposite. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { AsyncCallback } callback - Callback used to return the mute status of the stream. + * The value true means that the stream is muted, and false means the opposite. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMute */ isMute(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** * Checks whether a stream is muted. This method uses a promise to return the result. - * @param volumeType Audio stream type. - * @returns Promise used to return the mute status of the stream. The value true means that the stream is muted, - * and false means the opposite. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @returns { Promise } Promise used to return the mute status of the stream. The value true means + * that the stream is muted, and false means the opposite. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMute */ isMute(volumeType: AudioVolumeType): Promise; /** * Checks whether a stream is active. This method uses an asynchronous callback to return the query result. - * @param volumeType Audio stream type. - * @param callback Callback used to return the active status of the stream. The value true means that the stream is - * active, and false means the opposite. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { AsyncCallback } callback - Callback used to return the active status of the stream. + * The value true means that the stream is active, and false means the opposite. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioStreamManager#isActive */ isActive(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** * Checks whether a stream is active. This method uses a promise to return the query result. - * @param volumeType Audio stream type. - * @returns Promise used to return the active status of the stream. The value true means that the stream is active, - * and false means the opposite. - * @since 7 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @returns { Promise } Promise used to return the active status of the stream. The value true means + * that the stream is active, and false means the opposite. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioStreamManager#isActive */ isActive(volumeType: AudioVolumeType): Promise; /** * Mutes or unmutes the microphone. This method uses an asynchronous callback to return the result. - * @param mute Mute status to set. The value true means to mute the microphone, and false means the opposite. - * @param callback Callback used to return the result. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Device * @permission ohos.permission.MICROPHONE + * @param { boolean } mute - Mute status to set. The value true means to mute the microphone, and false means the opposite. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setMicrophoneMute */ setMicrophoneMute(mute: boolean, callback: AsyncCallback): void; /** * Mutes or unmutes the microphone. This method uses a promise to return the result. - * @param mute Mute status to set. The value true means to mute the microphone, and false means the opposite. - * @returns Promise used to return the result. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Device * @permission ohos.permission.MICROPHONE + * @param { boolean } mute - Mute status to set. The value true means to mute the microphone, and false means the opposite. + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setMicrophoneMute */ setMicrophoneMute(mute: boolean): Promise; /** * Checks whether the microphone is muted. This method uses an asynchronous callback to return the query result. - * @param Callback used to return the mute status of the microphone. The value true means that the microphone is - * muted, and false means the opposite. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Device * @permission ohos.permission.MICROPHONE + * @param { AsyncCallback } callback - used to return the mute status of the microphone. The value + * true means that the microphone is muted, and false means the opposite. + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMicrophoneMute */ isMicrophoneMute(callback: AsyncCallback): void; /** * Checks whether the microphone is muted. This method uses a promise to return the query result. - * @returns Promise used to return the mute status of the microphone. The value true means that the microphone is - * muted, and false means the opposite. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Device * @permission ohos.permission.MICROPHONE + * @returns { Promise } Promise used to return the mute status of the microphone. The value + * true means that the microphone is muted, and false means the opposite. + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMicrophoneMute */ isMicrophoneMute(): Promise; /** * Sets the ringer mode. This method uses an asynchronous callback to return the result. - * @param mode Ringer mode. - * @param callback Callback used to return the result. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Communication * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioRingMode } mode - Ringer mode. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setRingerMode */ setRingerMode(mode: AudioRingMode, callback: AsyncCallback): void; /** * Sets the ringer mode. This method uses a promise to return the result. - * @param mode Ringer mode. - * @returns Promise used to return the result. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Communication * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioRingMode } mode - Ringer mode. + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setRingerMode */ setRingerMode(mode: AudioRingMode): Promise; /** * Obtains the ringer mode. This method uses an asynchronous callback to return the query result. - * @param callback Callback used to return the ringer mode. - * @since 7 + * @param { AsyncCallback } callback - Callback used to return the ringer mode. * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getRingerMode */ getRingerMode(callback: AsyncCallback): void; /** * Obtains the ringer mode. This method uses a promise to return the query result. - * @returns Promise used to return the ringer mode. - * @since 7 + * @returns { Promise } Promise used to return the ringer mode. * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getRingerMode */ getRingerMode(): Promise; /** * Sets an audio parameter. This method uses an asynchronous callback to return the result. - * @param key Key of the audio parameter to set. - * @param value Value of the audio parameter to set. - * @param callback Callback used to return the result. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Core * @permission ohos.permission.MODIFY_AUDIO_SETTINGS + * @param { string } key - Key of the audio parameter to set. + * @param { string } value - Value of the audio parameter to set. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ setAudioParameter(key: string, value: string, callback: AsyncCallback): void; /** * Sets an audio parameter. This method uses a promise to return the result. - * @param key Key of the audio parameter to set. - * @param value Value of the audio parameter to set. - * @returns Promise used to return the result. - * @since 7 - * @syscap SystemCapability.Multimedia.Audio.Core * @permission ohos.permission.MODIFY_AUDIO_SETTINGS + * @param { string } key - Key of the audio parameter to set. + * @param { string } value - Value of the audio parameter to set. + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ setAudioParameter(key: string, value: string): Promise; /** * Obtains the value of an audio parameter. This method uses an asynchronous callback to return the query result. - * @param key Key of the audio parameter whose value is to be obtained. - * @param callback Callback used to return the value of the audio parameter. - * @since 7 + * @param { string } key - Key of the audio parameter whose value is to be obtained. + * @param { AsyncCallback } callback - Callback used to return the value of the audio parameter. * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ getAudioParameter(key: string, callback: AsyncCallback): void; /** * Obtains the value of an audio parameter. This method uses a promise to return the query result. - * @param key Key of the audio parameter whose value is to be obtained. - * @returns Promise used to return the value of the audio parameter. - * @since 7 + * @param { string } key - Key of the audio parameter whose value is to be obtained. + * @returns { Promise } Promise used to return the value of the audio parameter. * @syscap SystemCapability.Multimedia.Audio.Core + * @since 7 */ getAudioParameter(key: string): Promise; /** * Sets a device to the active state. This method uses an asynchronous callback to return the result. - * @param deviceType Audio device type. - * @param active Active status to set. The value true means to set the device to the active status, and false - * means the opposite. - * @param callback Callback used to return the result. - * @since 7 + * @param { ActiveDeviceType } deviceType - Audio device type. + * @param { boolean } active - Active status to set. The value true means to set the device to the active + * status, and false means the opposite. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioRoutingManager#setCommunicationDevice */ setDeviceActive(deviceType: ActiveDeviceType, active: boolean, callback: AsyncCallback): void; /** * Sets a device to the active state. This method uses a promise to return the result. - * @param deviceType Audio device type. - * @param active Active status to set. The value true means to set the device to the active status, and false - * means the opposite. - * @returns Promise used to return the result. - * @since 7 + * @param { ActiveDeviceType } deviceType - Audio device type. + * @param { boolean } active - Active status to set. The value true means to set the device to the active + * status, and false means the opposite. + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioRoutingManager#setCommunicationDevice */ setDeviceActive(deviceType: ActiveDeviceType, active: boolean): Promise; /** * Checks whether a device is active. This method uses an asynchronous callback to return the query result. - * @param deviceType Audio device type. - * @param callback Callback used to return the active status of the device. - * @since 7 + * @param { ActiveDeviceType } deviceType - Audio device type. + * @param { AsyncCallback } callback - Callback used to return the active status of the device. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioRoutingManager#isCommunicationDeviceActive */ isDeviceActive(deviceType: ActiveDeviceType, callback: AsyncCallback): void; /** * Checks whether a device is active. This method uses a promise to return the query result. - * @param deviceType Audio device type. - * @returns Promise used to return the active status of the device. - * @since 7 + * @param { ActiveDeviceType } deviceType - Audio device type. + * @returns { Promise } Promise used to return the active status of the device. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioRoutingManager#isCommunicationDeviceActive */ isDeviceActive(deviceType: ActiveDeviceType): Promise; /** * Listens for system volume change events. This method uses a callback to get volume change events. - * @param callback Callback used to get the system volume change event. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the volumeChange event is supported. + * @param { Callback } callback - Callback used to get the system volume change event. * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 8 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeManager#event:volumeChange */ on(type: 'volumeChange', callback: Callback): void; /** * Listens for ringer mode change events. This method uses a callback to get ringer mode changes. - * @param callback Callback used to get the updated ringer mode. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the ringerModeChange event is supported. + * @param { Callback } callback - Callback used to get the updated ringer mode. * @syscap SystemCapability.Multimedia.Audio.Communication * @systemapi + * @since 8 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#event:ringerModeChange */ @@ -1468,42 +1503,43 @@ declare namespace audio { /** * Sets the audio scene mode to change audio strategies. This method uses an asynchronous callback to return the * result. - * @param scene Audio scene mode. - * @param callback Callback used to return the result. - * @since 8 + * @param { AudioScene } scene - Audio scene mode. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Communication * @systemapi + * @since 8 */ setAudioScene(scene: AudioScene, callback: AsyncCallback): void; /** * Sets the audio scene mode to change audio strategies. This method uses a promise to return the result. - * @param scene Audio scene mode. - * @returns Promise used to return the result. - * @since 8 + * @param { AudioScene } scene - Audio scene mode. + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Communication * @systemapi + * @since 8 */ setAudioScene(scene: AudioScene): Promise; /** * Obtains the audio scene mode. This method uses an asynchronous callback to return the query result. - * @param callback Callback used to return the audio scene mode. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the audio scene mode. * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 8 */ getAudioScene(callback: AsyncCallback): void; /** * Obtains the audio scene mode. This method uses a promise to return the query result. - * @returns Promise used to return the audio scene mode. - * @since 8 + * @returns { Promise } Promise used to return the audio scene mode. * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 8 */ getAudioScene(): Promise; /** * Subscribes to device change events. When a device is connected/disconnected, registered clients will receive * the callback. - * @param callback Callback used to obtain the device update details. - * @since 7 + * @param { string } type - Type of the event to listen for. Only the deviceChange event is supported. + * @param { Callback } callback - Callback used to obtain the device update details. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioRoutingManager#event:deviceChange */ @@ -1511,9 +1547,10 @@ declare namespace audio { /** * UnSubscribes to device change events. - * @param callback Callback used to obtain the device update details. - * @since 7 + * @param { string } type - Type of the event to listen for. Only the deviceChange event is supported. + * @param { Callback } callback - Callback used to obtain the device update details. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.AudioRoutingManager#event:deviceChange */ @@ -1522,950 +1559,987 @@ declare namespace audio { /** * Listens for audio interruption events. When the audio of an application is interrupted by another application, * the callback is invoked to notify the former application. - * @param type Type of the event to listen for. Only the interrupt event is supported. - * @param interrupt Parameters of the audio interruption event type. - * @param callback Callback invoked for the audio interruption event. - * @since 7 + * @param { string } type - Type of the event to listen for. Only the interrupt event is supported. + * @param { AudioInterrupt } interrupt - Parameters of the audio interruption event type. + * @param { Callback } callback - Callback invoked for the audio interruption event. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 */ on(type: 'interrupt', interrupt: AudioInterrupt, callback: Callback): void; /** * Cancels the listening of audio interruption events. - * @param type Type of the event to listen for. Only the interrupt event is supported. - * @param interrupt Input parameters of the audio interruption event. - * @param callback Callback invoked for the audio interruption event. - * @since 7 + * @param { string } type - Type of the event to listen for. Only the interrupt event is supported. + * @param { AudioInterrupt } interrupt - Input parameters of the audio interruption event. + * @param { Callback } callback - Callback invoked for the audio interruption event. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 */ off(type: 'interrupt', interrupt: AudioInterrupt, callback?: Callback): void; /** * Obtains an {@link AudioVolumeManager} instance. - * @returns AudioVolumeManager instance. - * @since 9 + * @returns { AudioVolumeManager } AudioVolumeManager instance. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getVolumeManager(): AudioVolumeManager; /** * Obtains an {@link AudioStreamManager} instance. - * @returns AudioStreamManager instance. - * @since 9 + * @returns { AudioStreamManager } AudioStreamManager instance. * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ getStreamManager(): AudioStreamManager; /** * Obtains an {@link AudioRoutingManager} instance. - * @returns AudioRoutingManager instance. - * @since 9 + * @returns { AudioRoutingManager } AudioRoutingManager instance. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ getRoutingManager(): AudioRoutingManager; } /** * Enumerates audio interrupt request result type. - * @since 9 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi + * @since 9 */ enum InterruptRequestResultType { /** * Request audio interrupt success - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi + * @since 9 */ INTERRUPT_REQUEST_GRANT = 0, /** * Request audio interrupt fail, may have higher priority type - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi + * @since 9 */ INTERRUPT_REQUEST_REJECT = 1 } /** * Describes audio interrupt operation results. - * @since 9 + * @typedef InterruptResult * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi + * @since 9 */ interface InterruptResult { /** * Interrupt request or abandon result. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi + * @since 9 */ requestResult: InterruptRequestResultType; /** * Interrupt node as a unit to receive interrupt change event. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi + * @since 9 */ interruptNode: number; } /** * Implements audio router management. - * @since 9 + * @typedef AudioRoutingManager * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ interface AudioRoutingManager { /** * Obtains the audio devices with a specific flag. This method uses an asynchronous callback to return the query result. - * @param deviceFlag Audio device flag. - * @param callback Callback used to return the device list. - * @since 9 + * @param { DeviceFlag } deviceFlag - Audio device flag. + * @param { AsyncCallback } callback - Callback used to return the device list. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ getDevices(deviceFlag: DeviceFlag, callback: AsyncCallback): void; /** * Obtains the audio devices with a specific flag. This method uses a promise to return the query result. - * @param deviceFlag Audio device flag. - * @returns Promise used to return the device list. - * @since 9 + * @param { DeviceFlag } deviceFlag - Audio device flag. + * @returns { Promise } Promise used to return the device list. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ getDevices(deviceFlag: DeviceFlag): Promise; /** * Subscribes to device change events. When a device is connected/disconnected, registered clients will receive * the callback. - * @param deviceFlag Audio device flag. - * @param callback Callback used to obtain the device update details. + * @param { string } type - Type of the event to listen for. Only the deviceChange event is supported. + * @param { DeviceFlag } deviceFlag - Audio device flag. + * @param { Callback } callback - Callback used to obtain the device update details. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ on(type: 'deviceChange', deviceFlag: DeviceFlag, callback: Callback): void; /** * UnSubscribes to device change events. - * @param callback Callback used to obtain the device update details. + * @param { string } type - Type of the event to listen for. Only the deviceChange event is supported. + * @param { Callback } callback - Callback used to obtain the device update details. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ off(type: 'deviceChange', callback?: Callback): void; /** * Sets a device to the active state. This method uses an asynchronous callback to return the result. - * @param deviceType Audio device type. - * @param active Active status to set. The value true means to set the device to the active status, and false - * means the opposite. - * @param callback Callback used to return the result. - * @since 9 + * @param { CommunicationDeviceType } deviceType - Audio device type. + * @param { boolean } active - Active status to set. The value true means to set the device to + * the active status, and false means the opposite. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 9 */ setCommunicationDevice(deviceType: CommunicationDeviceType, active: boolean, callback: AsyncCallback): void; /** * Sets a device to the active state. This method uses a promise to return the result. - * @param deviceType Audio device type. - * @param active Active status to set. The value true means to set the device to the active status, and false - * means the opposite. - * @returns Promise used to return the result. - * @since 9 + * @param { CommunicationDeviceType } deviceType - Audio device type. + * @param { boolean } active - Active status to set. The value true means to set the device to the active status, + * and false means the opposite. + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 9 */ setCommunicationDevice(deviceType: CommunicationDeviceType, active: boolean): Promise; /** * Checks whether a device is active. This method uses an asynchronous callback to return the query result. - * @param deviceType Audio device type. - * @param callback Callback used to return the active status of the device. - * @since 9 + * @param { CommunicationDeviceType } deviceType - Audio device type. + * @param { AsyncCallback } callback - Callback used to return the active status of the device. * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 9 */ isCommunicationDeviceActive(deviceType: CommunicationDeviceType, callback: AsyncCallback): void; /** * Checks whether a device is active. This method uses a promise to return the query result. - * @param deviceType Audio device type. - * @returns Promise used to return the active status of the device. - * @since 9 + * @param { CommunicationDeviceType } deviceType - Audio device type. + * @returns { Promise } Promise used to return the active status of the device. * @syscap SystemCapability.Multimedia.Audio.Communication + * @since 9 */ isCommunicationDeviceActive(deviceType: CommunicationDeviceType): Promise; /** * Select the output device. This method uses an asynchronous callback to return the result. - * @param outputAudioDevices Audio device description - * @param callback Callback used to return the result. - * @since 9 + * @param { AudioDeviceDescriptors } outputAudioDevices - Audio device description + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors, callback: AsyncCallback): void; /** * Select the output device. This method uses a promise to return the result. - * @param outputAudioDevices Audio device description - * @returns Promise used to return the result. - * @since 9 + * @param { AudioDeviceDescriptors } outputAudioDevices - Audio device description + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors): Promise; /** * Select the output device with desired AudioRenderer. This method uses an asynchronous callback to return the result. - * @param filter Filter for AudioRenderer. - * @param outputAudioDevices Audio device description - * @param callback Callback used to return the result. - * @since 9 + * @param { AudioRendererFilter } filter - Filter for AudioRenderer. + * @param { AudioDeviceDescriptors } outputAudioDevices - Audio device description. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: AudioDeviceDescriptors, callback: AsyncCallback): void; /** * Select the output device with desired AudioRenderer. This method uses a promise to return the result. - * @param filter Filter for AudioRenderer. - * @param outputAudioDevices Audio device description - * @returns Promise used to return the result. - * @since 9 + * @param { AudioRendererFilter } filter - Filter for AudioRenderer. + * @param { AudioDeviceDescriptors } outputAudioDevices - Audio device description + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: AudioDeviceDescriptors): Promise; /** * Select the input device. This method uses an asynchronous callback to return the result. - * @param inputAudioDevices Audio device description - * @param callback Callback used to return the result. - * @since 9 + * @param { AudioDeviceDescriptors } inputAudioDevices - Audio device description + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ selectInputDevice(inputAudioDevices: AudioDeviceDescriptors, callback: AsyncCallback): void; /** * Select the input device. This method uses a promise to return the result. - * @param inputAudioDevices Audio device description - * @returns Promise used to return the result. - * @since 9 + * @param { AudioDeviceDescriptors } inputAudioDevices - Audio device description + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ selectInputDevice(inputAudioDevices: AudioDeviceDescriptors): Promise; /** * Get output device for target audio renderer info. - * @param rendererInfo Audio renderer information - * @param callback Callback used to return the result. - * @since 10 + * @param { AudioRendererInfo } rendererInfo - Audio renderer information + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 10 */ getPreferOutputDeviceForRendererInfo(rendererInfo: AudioRendererInfo, callback: AsyncCallback): void; /** * Get output device for target audio renderer info. - * @param rendererInfo Audio renderer information - * @returns Promise used to return the result. - * @since 10 + * @param { AudioRendererInfo } rendererInfo - Audio renderer information. + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Device + * @since 10 */ getPreferOutputDeviceForRendererInfo(rendererInfo: AudioRendererInfo): Promise; /** * Subscribes to prefer output device change events. When prefer device for target audio renderer info changes, * registered clients will receive the callback. - * @param rendererInfo Audio renderer information. - * @param callback Callback used to obtain the changed prefer devices information. + * @param { string } type - Type of the event to listen for. Only the + * preferOutputDeviceChangeForRendererInfo event is supported. + * @param { AudioRendererInfo } rendererInfo - Audio renderer information. + * @param { Callback } callback - Callback used to obtain the changed prefer devices information. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 10 */ on(type: 'preferOutputDeviceChangeForRendererInfo', rendererInfo: AudioRendererInfo, callback: Callback): void; /** * UnSubscribes to prefer output device change events. - * @param callback Callback used to obtain the changed prefer devices in subscribe. + * @param { string } type - Type of the event to listen for. Only the preferOutputDeviceChangeForRendererInfo event is supported. + * @param { Callback } callback - Callback used to obtain the changed prefer devices in subscribe. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 10 */ off(type: 'preferOutputDeviceChangeForRendererInfo', callback?: Callback): void; } /** * Implements audio stream management. - * @since 9 + * @typedef AudioStreamManager * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ interface AudioStreamManager { /** * Get information of current existing audio renderers. - * @param callback Callback used to return the information of current existing audio renderers. - * @since 9 + * @param { AsyncCallback } callback - Callback used to return the information + * of current existing audio renderers. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ getCurrentAudioRendererInfoArray(callback: AsyncCallback): void; /** * Get information of current existing audio renderers. - * @returns Promise used to return the information of current existing audio renderers. - * @since 9 + * @returns { Promise } Promise used to return the information of current + * existing audio renderers. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ getCurrentAudioRendererInfoArray(): Promise; /** * Get information of current existing audio capturers. - * @param callback Callback used to return the information of current existing audio capturers. - * @since 9 + * @param { AsyncCallback } callback - Callback used to return the information + * of current existing audio capturers. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ getCurrentAudioCapturerInfoArray(callback: AsyncCallback): void; /** * Get information of current existing audio capturers. - * @returns Promise used to return the information of current existing audio capturers. - * @since 9 + * @returns { Promise } Promise used to return the information of current existing + * audio capturers. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ getCurrentAudioCapturerInfoArray(): Promise; /** * Listens for audio renderer change events. When there is any audio renderer change, * registered clients will receive the callback. - * @param type Type of the event to listen for. Only the audioRendererChange event is supported. - * @param callback Callback invoked for the audio renderer change event. + * @param { string } type - Type of the event to listen for. Only the audioRendererChange event is supported. + * @param { Callback } callback - Callback invoked for the audio renderer change event. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ on(type: "audioRendererChange", callback: Callback): void; /** * UnSubscribes to audio renderer change events. + * @param { string } type - Type of the event to listen for. Only the audioRendererChange event is supported. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ off(type: "audioRendererChange"): void; /** * Listens for audio capturer change events. When there is any audio capturer change, * registered clients will receive the callback. - * @param type Type of the event to listen for. Only the audioCapturerChange event is supported. - * @param callback Callback invoked for the audio capturer change event. + * @param { string } type - Type of the event to listen for. Only the audioCapturerChange event is supported. + * @param { Callback } callback - Callback invoked for the audio capturer change event. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 9 */ on(type: "audioCapturerChange", callback: Callback): void; /** * UnSubscribes to audio capturer change events. + * @param { string } type - Type of the event to listen for. Only the audioCapturerChange event is supported. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 9 */ off(type: "audioCapturerChange"): void; /** * Checks whether a stream is active. This method uses an asynchronous callback to return the query result. - * @param volumeType Audio stream type. - * @param callback Callback used to return the active status of the stream. The value true means that the stream is - * active, and false means the opposite. - * @since 9 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { AsyncCallback } callback - Callback used to return the active status of the stream. + * The value true means that the stream is active, and false means the opposite. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ isActive(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** * Checks whether a stream is active. This method uses a promise to return the query result. - * @param volumeType Audio stream type. - * @returns Promise used to return the active status of the stream. The value true means that the stream is active, - * and false means the opposite. - * @since 9 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @returns { Promise } Promise used to return the active status of the stream. The value + * true means that the stream is active, and false means the opposite. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ isActive(volumeType: AudioVolumeType): Promise; } /** * Implements audio volume management. - * @since 9 + * @typedef AudioVolumeManager * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ interface AudioVolumeManager { /** * Get the volume group list for a networkId. This method uses an asynchronous callback to return the result. - * @param networkId Distributed deice net work id - * @param callback Callback used to return the result. - * @since 9 + * @param { string } networkId - Distributed deice net work id + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ getVolumeGroupInfos(networkId: string, callback: AsyncCallback): void; /** * Get the volume group list for a networkId. This method uses a promise to return the result. - * @param networkId Distributed deice net work id - * @returns Promise used to return the result. - * @since 9 + * @param { string } networkId - Distributed deice net work id + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ getVolumeGroupInfos(networkId: string): Promise; /** * Obtains an AudioVolumeGroupManager instance. This method uses an asynchronous callback to return the result. - * @param groupId volume group id, use LOCAL_VOLUME_GROUP_ID in default - * @param callback Callback used to return the result. - * @since 9 + * @param { number } groupId - volume group id, use LOCAL_VOLUME_GROUP_ID in default + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getVolumeGroupManager(groupId: number, callback: AsyncCallback): void; /** * Obtains an AudioVolumeGroupManager instance. This method uses a promise to return the result. - * @param groupId volume group id, use LOCAL_VOLUME_GROUP_ID in default - * @param callback Callback used to return the result. - * @since 9 + * @param { number } groupId - volume group id, use LOCAL_VOLUME_GROUP_ID in default + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getVolumeGroupManager(groupId: number): Promise; /** * Listens for system volume change events. This method uses a callback to get volume change events. - * @param callback Callback used to get the system volume change event. + * @param { string } type - Type of the event to listen for. Only the volumeChange event is supported. + * @param { Callback } callback - Callback used to get the system volume change event. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ on(type: 'volumeChange', callback: Callback): void; } /** * Implements audio volume group management. - * @since 9 + * @typedef AudioVolumeGroupManager * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ interface AudioVolumeGroupManager { /** * Sets the volume for a stream. This method uses an asynchronous callback to return the result. - * @param volumeType Audio stream type. - * @param volume Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { number } volume - Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ setVolume(volumeType: AudioVolumeType, volume: number, callback: AsyncCallback): void; /** * Sets the volume for a stream. This method uses a promise to return the result. - * @param volumeType Audio stream type. - * @param volume Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. - * @returns Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { number } volume - Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ setVolume(volumeType: AudioVolumeType, volume: number): Promise; /** * Obtains the volume of a stream. This method uses an asynchronous callback to return the query result. - * @param volumeType Audio stream type. - * @param callback Callback used to return the volume. - * @since 9 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { AsyncCallback } callback - Callback used to return the volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** * Obtains the volume of a stream. This method uses a promise to return the query result. - * @param volumeType Audio stream type. - * @returns Promise used to return the volume. - * @since 9 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @returns { Promise } Promise used to return the volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getVolume(volumeType: AudioVolumeType): Promise; /** * Obtains the minimum volume allowed for a stream. This method uses an asynchronous callback to return the query result. - * @param volumeType Audio stream type. - * @param callback Callback used to return the minimum volume. - * @since 9 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { AsyncCallback } callback - Callback used to return the minimum volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getMinVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** * Obtains the minimum volume allowed for a stream. This method uses a promise to return the query result. - * @param volumeType Audio stream type. - * @returns Promise used to return the minimum volume. - * @since 9 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @returns { Promise } Promise used to return the minimum volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getMinVolume(volumeType: AudioVolumeType): Promise; /** * Obtains the maximum volume allowed for a stream. This method uses an asynchronous callback to return the query result. - * @param volumeType Audio stream type. - * @param callback Callback used to return the maximum volume. - * @since 9 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { AsyncCallback } callback - Callback used to return the maximum volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getMaxVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** * Obtains the maximum volume allowed for a stream. This method uses a promise to return the query result. - * @param volumeType Audio stream type. - * @returns Promise used to return the maximum volume. - * @since 9 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @returns { Promise } Promise used to return the maximum volume. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getMaxVolume(volumeType: AudioVolumeType): Promise; /** * Mutes a stream. This method uses an asynchronous callback to return the result. - * @param volumeType Audio stream type. - * @param mute Mute status to set. The value true means to mute the stream, and false means the opposite. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { boolean } mute - Mute status to set. The value true means to mute the stream, and false means the opposite. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback): void; /** * Mutes a stream. This method uses a promise to return the result. - * @param volumeType Audio stream type. - * @param mute Mute status to set. The value true means to mute the stream, and false means the opposite. - * @returns Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { boolean } mute - Mute status to set. The value true means to mute the stream, and false means the opposite. + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ mute(volumeType: AudioVolumeType, mute: boolean): Promise; /** * Checks whether a stream is muted. This method uses an asynchronous callback to return the query result. - * @param volumeType Audio stream type. - * @param callback Callback used to return the mute status of the stream. The value true means that the stream is - * muted, and false means the opposite. - * @since 9 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { AsyncCallback } callback - Callback used to return the mute status of the stream. The + * value true means that the stream is muted, and false means the opposite. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ isMute(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** * Checks whether a stream is muted. This method uses a promise to return the result. - * @param volumeType Audio stream type. - * @returns Promise used to return the mute status of the stream. The value true means that the stream is muted, - * and false means the opposite. - * @since 9 + * @param { AudioVolumeType } volumeType - Audio stream type. + * @returns { Promise } Promise used to return the mute status of the stream. The value true + * means that the stream is muted, and false means the opposite. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ isMute(volumeType: AudioVolumeType): Promise; /** * Sets the ringer mode. This method uses an asynchronous callback to return the result. - * @param mode Ringer mode. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioRingMode } mode - Ringer mode. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ setRingerMode(mode: AudioRingMode, callback: AsyncCallback): void; /** * Sets the ringer mode. This method uses a promise to return the result. - * @param mode Ringer mode. - * @returns Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioRingMode } mode - Ringer mode. + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ setRingerMode(mode: AudioRingMode): Promise; /** * Obtains the ringer mode. This method uses an asynchronous callback to return the query result. - * @param callback Callback used to return the ringer mode. - * @since 9 + * @param { AsyncCallback } callback - Callback used to return the ringer mode. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getRingerMode(callback: AsyncCallback): void; /** * Obtains the ringer mode. This method uses a promise to return the query result. - * @returns Promise used to return the ringer mode. - * @since 9 + * @returns { Promise } Promise used to return the ringer mode. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ getRingerMode(): Promise; /** * Listens for ringer mode change events. This method uses a callback to get ringer mode changes. - * @param callback Callback used to get the updated ringer mode. + * @param { string } type - Type of the event to listen for. Only the ringerModeChange event is supported. + * @param { Callback } callback - Callback used to get the updated ringer mode. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ on(type: 'ringerModeChange', callback: Callback): void; /** * Mutes or unmutes the microphone. This method uses an asynchronous callback to return the result. - * @param mute Mute status to set. The value true means to mute the microphone, and false means the opposite. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.MANAGE_AUDIO_CONFIG + * @param { boolean } mute - Mute status to set. The value true means to mute the microphone, and false means the opposite. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ setMicrophoneMute(mute: boolean, callback: AsyncCallback): void; /** * Mutes or unmutes the microphone. This method uses a promise to return the result. - * @param mute Mute status to set. The value true means to mute the microphone, and false means the opposite. - * @returns Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.MANAGE_AUDIO_CONFIG + * @param { boolean } mute - Mute status to set. The value true means to mute the microphone, and false means the opposite. + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ setMicrophoneMute(mute: boolean): Promise; /** * Checks whether the microphone is muted. This method uses an asynchronous callback to return the query result. - * @param Callback used to return the mute status of the microphone. The value true means that the microphone is - * muted, and false means the opposite. - * @since 9 + * @param { AsyncCallback } callback - used to return the mute status of the microphone. The value + * true means that the microphone is muted, and false means the opposite. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ isMicrophoneMute(callback: AsyncCallback): void; /** * Checks whether the microphone is muted. This method uses a promise to return the query result. - * @returns Promise used to return the mute status of the microphone. The value true means that the microphone is - * muted, and false means the opposite. - * @since 9 + * @returns { Promise } Promise used to return the mute status of the microphone. The value true + * means that the microphone is muted, and false means the opposite. * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ isMicrophoneMute(): Promise; /** * Listens for system microphone state change events. This method uses a callback to get microphone change events. - * @param callback Callback used to get the system microphone state change event. + * @param { string } type - Type of the event to listen for. Only the micStateChange event is supported. + * @param { Callback } callback - Callback used to get the system microphone state change event. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @since 9 */ on(type: 'micStateChange', callback: Callback): void; } /** * Describes an audio volume group. - * @since 9 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ enum ConnectType { /** * Connect type for local device. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 9 */ CONNECT_TYPE_LOCAL = 1, /** * Connect type for distributed device. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 9 */ CONNECT_TYPE_DISTRIBUTED = 2 } /** * Describes an audio volume group. - * @since 9 + * @typedef VolumeGroupInfo * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ interface VolumeGroupInfo { /** * Device network id. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ readonly networkId: string; /** * Volume group id. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 9 */ readonly groupId: number; /** * Volume mapping group id. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 9 */ readonly mappingId: number; /** * Volume group name. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 9 */ readonly groupName: string; /** * Connect type of device for this group. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 9 */ readonly type: ConnectType; } /** * Array of VolumeGroupInfos, which is read-only. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 9 */ type VolumeGroupInfos = Array>; /** * Array of AudioRendererChangeInfo, which is read-only. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ type AudioRendererChangeInfoArray = Array>; /** * Describes audio renderer change information. - * @since 9 + * @typedef AudioRendererChangeInfo * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ interface AudioRendererChangeInfo { /** * Audio stream unique id. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ readonly streamId: number; /** * Uid for audio renderer client application. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer * @systemapi + * @since 9 */ readonly clientUid: number; /** * Audio renderer information. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ readonly rendererInfo: AudioRendererInfo; /** * Audio state. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer * @systemapi + * @since 9 */ readonly rendererState: AudioState; /** * Audio output devices. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ readonly deviceDescriptors: AudioDeviceDescriptors; } /** * Array of AudioCapturerChangeInfo, which is read-only. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 9 */ type AudioCapturerChangeInfoArray = Array>; /** * Describes audio capturer change information. - * @since 9 + * @typedef AudioCapturerChangeInfo * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 9 */ interface AudioCapturerChangeInfo { /** * Audio stream unique id. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 9 */ readonly streamId: number; /** * Uid for audio capturer client application. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Capturer * @systemapi + * @since 9 */ readonly clientUid: number; /** * Audio capturer information. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 9 */ readonly capturerInfo: AudioCapturerInfo; /** * Audio state. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Capturer * @systemapi + * @since 9 */ readonly capturerState: AudioState; /** * Audio input devices. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 9 */ readonly deviceDescriptors: AudioDeviceDescriptors; } /** * Describes an audio device. - * @since 7 + * @typedef AudioDeviceDescriptor * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ interface AudioDeviceDescriptor { /** * Audio device role. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ readonly deviceRole: DeviceRole; /** * Audio device type. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ readonly deviceType: DeviceType; /** * Audio device id. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ readonly id: number; /** * Audio device name. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ readonly name: string; /** * Audio device address. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ readonly address: string; /** * Supported sampling rates. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ readonly sampleRates: Array; /** * Supported channel counts. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ readonly channelCounts: Array; /** * Supported channel masks. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ readonly channelMasks: Array; /** * Device network id - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ readonly networkId: string; /** * Interrupt group id - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ readonly interruptGroupId: number; /** * Volume group id - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device * @systemapi + * @since 9 */ readonly volumeGroupId: number; /** * Name used to display, considering distributed device situation. - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 10 */ readonly displayName: string; } /** * Array of AudioDeviceDescriptors, which is read-only. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ type AudioDeviceDescriptors = Array>; /** * Describes the volume event received by the app when the volume is changed. - * @since 8 + * @typedef VolumeEvent * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @since 8 */ interface VolumeEvent { /** * Volume type of the current stream. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 8 */ volumeType: AudioVolumeType; /** * Volume level. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 8 */ volume: number; /** * Whether to show the volume change in UI. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 8 */ updateUi: boolean; /** * volumeGroup id - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 9 */ volumeGroupId: number; /** * Device network id - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 9 */ networkId: string; } @@ -2473,8 +2547,9 @@ declare namespace audio { /** * Describes the callback invoked for audio interruption or focus gain events.When the audio of an application * is interrupted by another application, the callback is invoked to notify the former application. - * @since 7 + * @typedef InterruptAction * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 * @useinstead ohos.multimedia.audio.InterruptEvent */ @@ -2483,24 +2558,24 @@ declare namespace audio { /** * Event type. * The value TYPE_ACTIVATED means the focus gain event, and TYPE_INTERRUPT means the audio interruption event. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ actionType: InterruptActionType; /** * Type of the audio interruption event. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ type?: InterruptType; /** * Hint for the audio interruption event. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ hint?: InterruptHint; @@ -2508,8 +2583,8 @@ declare namespace audio { /** * Whether the focus is gained or released. The value true means that the focus is gained or released, * and false means that the focus fails to be gained or released. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ activated?: boolean; @@ -2517,24 +2592,25 @@ declare namespace audio { /** * Describes input parameters of audio listening events. - * @since 7 + * @typedef AudioInterrupt * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ interface AudioInterrupt { /** * Audio stream usage type. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ streamUsage: StreamUsage; /** * Type of the media interrupted. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ contentType: ContentType; @@ -2542,8 +2618,8 @@ declare namespace audio { /** * Whether audio playback can be paused when it is interrupted. * The value true means that audio playback can be paused when it is interrupted, and false means the opposite. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 7 * @deprecated since 9 */ pauseWhenDucked: boolean; @@ -2551,860 +2627,918 @@ declare namespace audio { /** * Describes the microphone state change event received by the app when the microphone state is changed. - * @since 9 + * @typedef MicStateChangeEvent * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ interface MicStateChangeEvent { /** * Mic mute state. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 9 */ mute: boolean; } /** * Describes the device change type and device information. - * @since 7 + * @typedef DeviceChangeAction * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ interface DeviceChangeAction { /** * Device change type. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ type: DeviceChangeType; /** * Device information. - * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @since 7 */ deviceDescriptors: AudioDeviceDescriptors; } /** * Provides audio playback APIs. - * @since 8 + * @typedef AudioRenderer * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ interface AudioRenderer { /** * Defines the current render state. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ readonly state: AudioState; /** * Obtains the renderer information provided while creating a renderer instance. This method uses an asynchronous * callback to return the result. - * @param callback Callback used to return the renderer information. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the renderer information. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ getRendererInfo(callback: AsyncCallback): void; /** * Obtains the renderer information provided while creating a renderer instance. This method uses a promise to * return the result. - * @returns Promise used to return the renderer information. - * @since 8 + * @returns { Promise } Promise used to return the renderer information. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ getRendererInfo(): Promise; /** * Obtains the renderer stream information. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the stream information. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the stream information. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ getStreamInfo(callback: AsyncCallback): void; /** * Obtains the renderer stream information. This method uses a promise to return the result. - * @returns Promise used to return the stream information. - * @since 8 + * @returns { Promise } Promise used to return the stream information. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ getStreamInfo(): Promise; /** * Obtains the renderer stream id. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the stream id. - * @since 9 + * @param { AsyncCallback } callback - Callback used to return the stream id. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ getAudioStreamId(callback: AsyncCallback): void; /** * Obtains the renderer stream id. This method uses a promise to return the result. - * @returns Promise used to return the stream id. - * @since 9 + * @returns { Promise } Promise used to return the stream id. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ getAudioStreamId(): Promise; /** * Starts the renderer. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ start(callback: AsyncCallback): void; /** * Starts the renderer. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 8 + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ start(): Promise; /** * Writes the buffer. This method uses an asynchronous callback to return the result. - * @param buffer Buffer to be written. - * @param callback Returns the number of bytes written if the operation is successful; returns an error code - * otherwise. - * @since 8 + * @param { ArrayBuffer } buffer - Buffer to be written. + * @param { AsyncCallback } callback - Returns the number of bytes written if the operation is successful. + * Returns an error code otherwise. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ write(buffer: ArrayBuffer, callback: AsyncCallback): void; /** * Writes the buffer. This method uses a promise to return the result. - * @param buffer Buffer to be written. - * @returns Returns the number of bytes written if the operation is successful; returns an error code otherwise. - * @since 8 + * @param { ArrayBuffer } buffer - Buffer to be written. + * @returns { Promise } Returns the number of bytes written if the operation is successful. + * Returns an error code otherwise. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ write(buffer: ArrayBuffer): Promise; /** * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses an * asynchronous callback to return the result. - * @param callback Callback used to return the timestamp. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the timestamp. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ getAudioTime(callback: AsyncCallback): void; /** * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses a * promise to return the result. - * @returns Promise used to return the timestamp. - * @since 8 + * @returns { Promise } Promise used to return the timestamp. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ getAudioTime(): Promise; /** * Drains the playback buffer. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ drain(callback: AsyncCallback): void; /** * Drains the playback buffer. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 8 + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ drain(): Promise; /** * Pauses rendering. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ pause(callback: AsyncCallback): void; /** * Pauses rendering. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 8 + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ pause(): Promise; /** * Stops rendering. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ stop(callback: AsyncCallback): void; /** * Stops rendering. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 8 + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ stop(): Promise; /** * Releases the renderer. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ release(callback: AsyncCallback): void; /** * Releases the renderer. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 8 + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ release(): Promise; /** * Obtains a reasonable minimum buffer size in bytes for rendering. This method uses an asynchronous callback to * return the result. - * @param callback Callback used to return the buffer size. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the buffer size. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ getBufferSize(callback: AsyncCallback): void; /** * Obtains a reasonable minimum buffer size in bytes for rendering. This method uses a promise to return the result. - * @returns Promise used to return the buffer size. - * @since 8 + * @returns { Promise } Promise used to return the buffer size. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ getBufferSize(): Promise; /** * Sets the render rate. This method uses an asynchronous callback to return the result. - * @param rate Audio render rate. - * @param callback Callback used to return the result. - * @since 8 + * @param { AudioRendererRate } rate - Audio render rate. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ setRenderRate(rate: AudioRendererRate, callback: AsyncCallback): void; /** * Sets the render rate. This method uses a promise to return the result. - * @param rate Audio render rate. - * @returns Promise used to return the result. - * @since 8 + * @param { AudioRendererRate } rate - Audio render rate. + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ setRenderRate(rate: AudioRendererRate): Promise; /** * Obtains the current render rate. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the audio render rate. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the audio render rate. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ getRenderRate(callback: AsyncCallback): void; /** * Obtains the current render rate. This method uses a promise to return the result. - * @returns Promise used to return the audio render rate. - * @since 8 + * @returns { Promise } Promise used to return the audio render rate. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ getRenderRate(): Promise; /** * Set interrupt mode. - * @param mode The interrupt mode. - * @param callback Callback used to return the result. - * @since 9 + * @param { InterruptMode } mode - The interrupt mode. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @since 9 */ setInterruptMode(mode: InterruptMode, callback: AsyncCallback): void; /** * Set interrupt mode. - * @param mode The interrupt mode. - * @returns Promise used to return the result. - * @since 9 + * @param { InterruptMode } mode - The interrupt mode. + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @since 9 */ setInterruptMode(mode: InterruptMode): Promise; /** * Sets the volume for this stream. This method uses an asynchronous callback to return the result. - * @param volume Volume to set. The value type is float, form 0.0 to 1.0. - * @param callback Callback used to return the result. - * @since 9 + * @param { number } volume - Volume to set. The value type is float, form 0.0 to 1.0. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ setVolume(volume: number, callback: AsyncCallback): void; /** * Sets the volume for a stream. This method uses a promise to return the result. - * @param volume Volume to set. The value type is float, form 0.0 to 1.0. - * @returns Promise used to return the result. - * @since 9 + * @param { number } volume - Volume to set. The value type is float, form 0.0 to 1.0. + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 9 */ setVolume(volume: number): Promise; /** * Listens for audio interrupt events. This method uses a callback to get interrupt events. The interrupt event is * triggered when audio playback is interrupted. - * @param callback Callback used to listen for interrupt callback. + * @param { string } type - Type of the event to listen for. Only the audioInterrupt event is supported. + * @param { Callback } callback - Callback used to listen for interrupt callback. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @since 9 */ on(type: 'audioInterrupt', callback: Callback): void; /** * Subscribes to mark reached events. When the number of frames rendered reaches the value of the frame parameter, * the callback is invoked. - * @param frame Number of frames to trigger the event. The value must be greater than 0. - * @param callback Callback invoked when the event is triggered. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the markReach event is supported. + * @param { number } frame - Number of frames to trigger the event. The value must be greater than 0. + * @param { Callback } callback - Callback invoked when the event is triggered. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ on(type: "markReach", frame: number, callback: Callback): void; /** * Unsubscribes from mark reached events. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the markReach event is supported. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ off(type: "markReach"): void; /** * Subscribes to period reached events. When the period of frame rendering reaches the value of frame parameter, * the callback is invoked. - * @param frame Period during which frame rendering is listened. The value must be greater than 0. - * @param callback Callback invoked when the event is triggered. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the periodReach event is supported. + * @param { number } frame - Period during which frame rendering is listened. The value must be greater than 0. + * @param { Callback } callback - Callback invoked when the event is triggered. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ on(type: "periodReach", frame: number, callback: Callback): void; /** * Unsubscribes from period reached events. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the periodReach event is supported. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ off(type: "periodReach"): void; /** * Subscribes audio state change event callback. - * @param callback Callback invoked when state change. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the stateChange event is supported. + * @param { Callback } callback - Callback invoked when state change. * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 8 */ on(type: "stateChange", callback: Callback): void; } /** * Enumerates source types. - * @since 8 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ enum SourceType { /** * Invalid source type. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SOURCE_TYPE_INVALID = -1, /** * Mic source type. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SOURCE_TYPE_MIC = 0, /** * Voice recognition source type. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 9 */ SOURCE_TYPE_VOICE_RECOGNITION = 1, /** * Voice communication source type. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ SOURCE_TYPE_VOICE_COMMUNICATION = 7 } /** * Describes audio capturer information. - * @since 8 + * @typedef AudioCapturerInfo * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ interface AudioCapturerInfo { /** * Audio source type. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ source: SourceType; /** * Audio capturer flags. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Core + * @since 8 */ capturerFlags: number; } /** * Describes audio capturer configuration options. - * @since 8 + * @typedef AudioCapturerOptions * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ interface AudioCapturerOptions { /** * Stream information. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ streamInfo: AudioStreamInfo; /** * Capturer information. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ capturerInfo: AudioCapturerInfo; } /** * Provides APIs for audio recording. - * @since 8 + * @typedef AudioCapturer * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ interface AudioCapturer { /** * Defines the current capture state. - * @since 8 * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ readonly state: AudioState; /** * Obtains the capturer information provided while creating a capturer instance. This method uses an asynchronous * callback to return the result. - * @param callback Callback used to return the capturer information. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the capturer information. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ getCapturerInfo(callback: AsyncCallback): void; /** * Obtains the capturer information provided while creating a capturer instance. This method uses a promise to * return the result. - * @returns Promise used to return the capturer information. - * @since 8 + * @returns { Promise } Promise used to return the capturer information. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ getCapturerInfo(): Promise; /** * Obtains the capturer stream information. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the stream information. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the stream information. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ getStreamInfo(callback: AsyncCallback): void; /** * Obtains the capturer stream information. This method uses a promise to return the result. - * @returns Promise used to return the stream information. - * @since 8 + * @returns { Promise } Promise used to return the stream information. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ getStreamInfo(): Promise; /** * Obtains the capturer stream id. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the stream id. - * @since 9 + * @param { AsyncCallback } callback - Callback used to return the stream id. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 9 */ getAudioStreamId(callback: AsyncCallback): void; /** * Obtains the capturer stream id. This method uses a promise to return the result. - * @returns Promise used to return the stream id. - * @since 9 + * @returns { Promise } Promise used to return the stream id. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 9 */ getAudioStreamId(): Promise; /** * Starts capturing. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ start(callback: AsyncCallback): void; /** * Starts capturing. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 8 + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ start(): Promise; /** * Reads the buffer from the audio capturer. This method uses an asynchronous callback to return the result. - * @param size Number of bytes to read. - * @param isBlockingRead Whether the read operation should be blocked. - * @param callback Callback used to return the buffer. - * @since 8 + * @param { number } size - Number of bytes to read. + * @param { boolean } isBlockingRead - Whether the read operation should be blocked. + * @param { AsyncCallback } callback - Callback used to return the buffer. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ read(size: number, isBlockingRead: boolean, callback: AsyncCallback): void; /** * Reads the buffer from the audio capturer. This method uses a promise to return the result. - * @param size Number of bytes to read. - * @param isBlockingRead Whether the read operation should be blocked. - * @returns Returns the buffer data read if the operation is successful; returns an error code otherwise. - * @since 8 + * @param { number } size - Number of bytes to read. + * @param { boolean } isBlockingRead - Whether the read operation should be blocked. + * @returns { Promise } Returns the buffer data read if the operation is successful. + * Returns an error code otherwise. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ read(size: number, isBlockingRead: boolean): Promise; /** * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses an * asynchronous callback to return the result. - * @param callback Callback used to return the timestamp. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the timestamp. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ getAudioTime(callback: AsyncCallback): void; /** * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses a * promise to return the result. - * @returns Promise used to return the timestamp. - * @since 8 + * @returns { Promise } Promise used to return the timestamp. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ getAudioTime(): Promise; /** * Stops capturing. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ stop(callback: AsyncCallback): void; /** * Stops capturing. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 8 + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ stop(): Promise; /** * Releases the capturer. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ release(callback: AsyncCallback): void; /** * Releases the capturer. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 8 + * @returns { Promise } - Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ release(): Promise; /** * Obtains a reasonable minimum buffer size in bytes for capturing. This method uses an asynchronous callback to * return the result. - * @param callback Callback used to return the buffer size. - * @since 8 + * @param { AsyncCallback } callback - Callback used to return the buffer size. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ getBufferSize(callback: AsyncCallback): void; /** * Obtains a reasonable minimum buffer size in bytes for capturing. This method uses a promise to return the result. - * @returns Promise used to return the buffer size. - * @since 8 + * @returns { Promise } Promise used to return the buffer size. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ getBufferSize(): Promise; /** * Subscribes to mark reached events. When the number of frames captured reaches the value of the frame parameter, * the callback is invoked. - * @param frame Number of frames to trigger the event. The value must be greater than 0. - * @param callback Callback invoked when the event is triggered. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the markReach event is supported. + * @param { number } frame - Number of frames to trigger the event. The value must be greater than 0. + * @param { Callback } callback - Callback invoked when the event is triggered. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ on(type: "markReach", frame: number, callback: Callback): void; /** * Unsubscribes from the mark reached events. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the markReach event is supported. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ off(type: "markReach"): void; /** * Subscribes to period reached events. When the period of frame capturing reaches the value of frame parameter, * the callback is invoked. - * @param frame Period during which frame capturing is listened. The value must be greater than 0. - * @param callback Callback invoked when the event is triggered. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the periodReach event is supported. + * @param { number } frame - Period during which frame capturing is listened. The value must be greater than 0. + * @param { Callback } callback - Callback invoked when the event is triggered. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ on(type: "periodReach", frame: number, callback: Callback): void; /** * Unsubscribes from period reached events. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the periodReach event is supported. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ off(type: "periodReach"): void; /** * Subscribes audio state change event callback. - * @param callback Callback used to listen for the audio state change event. - * @since 8 + * @param { string } type - Type of the event to listen for. Only the stateChange event is supported. + * @param { Callback } callback - Callback used to listen for the audio state change event. * @syscap SystemCapability.Multimedia.Audio.Capturer + * @since 8 */ on(type: "stateChange", callback: Callback): void; /** * Listens for audio interrupt events. This method uses a callback to get interrupt events. The interrupt event is * triggered when audio recording is interrupted. - * @param callback Callback used to listen for interrupt callback. + * @param { string } type - Type of the event to listen for. Only the audioInterrupt event is supported. + * @param { Callback } callback - Callback used to listen for interrupt callback. * @throws { BusinessError } 401 - if input parameter type or number mismatch * @throws { BusinessError } 6800101 - if input parameter value error - * @since 10 * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @since 10 */ on(type: 'audioInterrupt', callback: Callback): void; } /** * Enumerates tone types for player. - * @since 9 + * @enum { number } * @syscap SystemCapability.Multimedia.Audio.Tone * @systemapi + * @since 9 */ enum ToneType { /** * Dial tone for key 0. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_0 = 0, /** * Dial tone for key 1. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_1 = 1, /** * Dial tone for key 2. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_2 = 2, /** * Dial tone for key 3. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_3 = 3, /** * Dial tone for key 4. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_4 = 4, /** * Dial tone for key 5. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_5 = 5, /** * Dial tone for key 6. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_6 = 6, /** * Dial tone for key 7. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_7 = 7, /** * Dial tone for key 8. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_8 = 8, /** * Dial tone for key 9. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_9 = 9, /** * Dial tone for key *. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_S = 10, /** * Dial tone for key #. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_P = 11, /** * Dial tone for key A. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_A = 12, /** * Dial tone for key B. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_B = 13, /** * Dial tone for key C. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_C = 14, /** * Dial tone for key D. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_DIAL_D = 15, /** * Supervisory tone for dial. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_SUPERVISORY_DIAL = 100, /** * Supervisory tone for busy. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_SUPERVISORY_BUSY = 101, /** * Supervisory tone for dial. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_SUPERVISORY_CONGESTION = 102, /** * Supervisory tone for radio path acknowledgment. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_SUPERVISORY_RADIO_ACK = 103, /** * Supervisory tone for radio path not available. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_SUPERVISORY_RADIO_NOT_AVAILABLE = 104, /** * Supervisory tone for call waiting. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_SUPERVISORY_CALL_WAITING = 106, /** * Supervisory tone for ringtone. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_SUPERVISORY_RINGTONE = 107, /** * Proprietary tone for beep. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_PROPRIETARY_BEEP = 200, /** * Proprietary tone for positive acknowledgment. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_PROPRIETARY_ACK = 201, /** * Proprietary tone for prompt. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_PROPRIETARY_PROMPT = 203, /** * Proprietary tone for double beep. - * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ TONE_TYPE_COMMON_PROPRIETARY_DOUBLE_BEEP = 204, } /** * Provides APIs for tone playing. - * @since 9 + * @typedef TonePlayer * @syscap SystemCapability.Multimedia.Audio.Tone * @systemapi + * @since 9 */ interface TonePlayer { /** * Loads tone. This method uses an asynchronous callback to return the result. - * @param type Tone type to play. - * @param callback Callback used to return the result. - * @since 9 + * @param { ToneType } type - Tone type to play. + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ load(type: ToneType, callback: AsyncCallback): void; /** * Loads tone. This method uses a promise to return the result. - * @param type Tone type to play. - * @returns Promise used to return the result. - * @since 9 + * @param { ToneType } type - Tone type to play. + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ load(type: ToneType): Promise; /** * Starts player. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 9 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ start(callback: AsyncCallback): void; /** * Starts player. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 9 + * @returns { Promise }Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ start(): Promise; /** * Stops player. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 9 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ stop(callback: AsyncCallback): void; /** * Stops player. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 9 + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ stop(): Promise; /** * Releases the player. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 9 + * @param { AsyncCallback } callback - Callback used to return the result. * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ release(callback: AsyncCallback): void; /** * Releases the player. This method uses a promise to return the result. - * @returns Promise used to return the result. - * @since 9 + * @returns { Promise } Promise used to return the result. * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + * @since 9 */ release(): Promise; }