提交 b8f9aec0 编写于 作者: W wuzhihuitmac

Merge branch 'master' of gitee.com:openharmony/docs into wzh

Change-Id: I56fc83de30e5a7696be3b3a826c939129df123df
...@@ -10,7 +10,7 @@ The current Linux kernel baseline evolves based on the Linux LTS version 4.19 an ...@@ -10,7 +10,7 @@ The current Linux kernel baseline evolves based on the Linux LTS version 4.19 an
### Bootloader<a name="section19062510518"></a> ### Bootloader<a name="section19062510518"></a>
You can use the Bootloader provided by the chipset vendor or open-source U-Boot to load the kernel image. For example, you can use [U-Boot](https://gitee.com/openharmony/device_hisilicon_third_party_uboot) for the Hi3516D V300 development board. You can use the Bootloader provided by the chipset vendor or open-source U-Boot to load the kernel image. For example, you can use [U-Boot](https://gitee.com/openharmony/third_party_u-boot) for the Hi3516D V300 development board.
## Adaptation, Building, Burning, and Startup<a name="section11112101695215"></a> ## Adaptation, Building, Burning, and Startup<a name="section11112101695215"></a>
...@@ -60,7 +60,7 @@ Based on the preceding process, the recommended verification procedure is as fol ...@@ -60,7 +60,7 @@ Based on the preceding process, the recommended verification procedure is as fol
1. Create a root file system image. 1. Create a root file system image.
Create a root file system image **rootfs.img** by following instructions in [Adding a Chipset Solution and a Product Solution](../subsystems/subsys-build-mini-lite.md). As shown in the preceding figure, the startup process is closely related to the product configuration. You need to complete the following configuration when creating **rootfs.img**: Create a root file system image **rootfs.img** by following instructions in [Adding a Chipset Solution and a Product Solution](../subsystems/subsys-build-all.md). As shown in the preceding figure, the startup process is closely related to the product configuration. You need to complete the following configuration when creating **rootfs.img**:
- Component configuration - Component configuration
......
# Ability框架概述 # Ability框架概述
Ability是应用所具备能力的抽象,也是应用程序的重要组成部分。Ability是系统调度应用的最小单元,是能够完成一个独立功能的组件。一个应用可以包含一个或多个Ability。 Ability是应用所具备能力的抽象,也是应用程序的重要组成部分。Ability是系统调度应用的最小单元,是能够完成一个独立功能的组件。一个应用可以包含一个或多个Ability。
Ability框架模型具有两种形态: Ability框架模型具有两种形态:
...@@ -14,7 +14,7 @@ Stage模型的设计,主要是为了开发者更加方便地开发出分布式 ...@@ -14,7 +14,7 @@ Stage模型的设计,主要是为了开发者更加方便地开发出分布式
| 开发方式 | 提供类Web的API,UI开发与Stage模型一致。 | 提供面向对象的开发方式,UI开发与FA模型一致。 | | 开发方式 | 提供类Web的API,UI开发与Stage模型一致。 | 提供面向对象的开发方式,UI开发与FA模型一致。 |
| 引擎实例 | 每个进程内的每个Ability实例独享一个JS VM引擎实例。 | 每个进程内的多个Ability实例共享一个JS VM引擎实例。 | | 引擎实例 | 每个进程内的每个Ability实例独享一个JS VM引擎实例。 | 每个进程内的多个Ability实例共享一个JS VM引擎实例。 |
| 进程内对象共享 | 不支持。 | 支持。 | | 进程内对象共享 | 不支持。 | 支持。 |
| 包描述文件 | 使用config.json描述HAP包和组件信息,组件必须使用固定的文件名。 | 使用module.json描述HAP包和组件信息,可以指定入口文件名。 | | 包描述文件 | 使用config.json描述HAP包和组件信息,组件必须使用固定的文件名。 | 使用module.json5描述HAP包和组件信息,可以指定入口文件名。 |
| 组件 | 提供PageAbility(页面展示),ServiceAbility(服务),DataAbility(数据分享)以及FormAbility(卡片)。 | 提供Ability(页面展示)、Extension(基于场景的服务扩展)。 | | 组件 | 提供PageAbility(页面展示),ServiceAbility(服务),DataAbility(数据分享)以及FormAbility(卡片)。 | 提供Ability(页面展示)、Extension(基于场景的服务扩展)。 |
除了上述设计上的差异外,对于开发者而言,两种模型的主要区别在于: 除了上述设计上的差异外,对于开发者而言,两种模型的主要区别在于:
......
# Ability开发指导 # Ability开发指导
## 场景介绍 ## 场景介绍
Stage模型是区别于FA模型的一种应用开发模型,对此模型的介绍详见[Stage模型综述](stage-brief.md)。开发Stage模型应用时,需要在module.json和app.json配置文件中对应用的包结构进行声明,对应用包结构配置文件的说明详见[应用包结构配置文件的说明](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/stage-structure.md)。基于Stage模型的Ability应用开发,主要涉及如下功能逻辑: Stage模型是区别于FA模型的一种应用开发模型,对此模型的介绍详见[Stage模型综述](stage-brief.md)。开发Stage模型应用时,需要在module.json5和app.json5配置文件中对应用的包结构进行声明,对应用包结构配置文件的说明详见[应用包结构配置文件的说明](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/stage-structure.md)。基于Stage模型的Ability应用开发,主要涉及如下功能逻辑:
- 创建支持使用屏幕浏览及人机交互的Ability应用,包括实现Ability的生命周期、获取Ability配置信息、向用户申请授权及环境变化通知等场景。 - 创建支持使用屏幕浏览及人机交互的Ability应用,包括实现Ability的生命周期、获取Ability配置信息、向用户申请授权及环境变化通知等场景。
- 启动Ability应用,包括相同设备启动Ability、跨设备启动Ability以及指定页面启动Ability等场景。 - 启动Ability应用,包括相同设备启动Ability、跨设备启动Ability以及指定页面启动Ability等场景。
- 通用组件Call功能,详见[Call调用开发指导](stage-call.md) - 通用组件Call功能,详见[Call调用开发指导](stage-call.md)
...@@ -8,7 +8,7 @@ Stage模型是区别于FA模型的一种应用开发模型,对此模型的介 ...@@ -8,7 +8,7 @@ Stage模型是区别于FA模型的一种应用开发模型,对此模型的介
- 应用迁移,详见[应用迁移开发指导](stage-ability-continuation.md) - 应用迁移,详见[应用迁移开发指导](stage-ability-continuation.md)
### 启动模式 ### 启动模式
Ability支持单实例、多实例和指定实例3种启动模式,在module.json中通过launchType配置。启动模式对应Ability被启动时的行为,对启动模式的详细说明如下: Ability支持单实例、多实例和指定实例3种启动模式,在module.json5中通过launchType配置。启动模式对应Ability被启动时的行为,对启动模式的详细说明如下:
| 启动模式 | 描述 |说明 | | 启动模式 | 描述 |说明 |
| ----------- | ------- |---------------- | | ----------- | ------- |---------------- |
...@@ -16,7 +16,7 @@ Ability支持单实例、多实例和指定实例3种启动模式,在module.js ...@@ -16,7 +16,7 @@ Ability支持单实例、多实例和指定实例3种启动模式,在module.js
| singleton | 单实例 | 系统中只存在唯一一个实例,startAbility时,如果已存在,则复用系统中的唯一一个实例 | | singleton | 单实例 | 系统中只存在唯一一个实例,startAbility时,如果已存在,则复用系统中的唯一一个实例 |
| specified | 指定实例 | 运行时由Ability内部业务决定是否创建多实例 | | specified | 指定实例 | 运行时由Ability内部业务决定是否创建多实例 |
缺省情况下是singleton模式,module.json示例如下: 缺省情况下是singleton模式,module.json5示例如下:
```json ```json
{ {
"module": { "module": {
...@@ -149,9 +149,9 @@ export default class MainAbility extends Ability { ...@@ -149,9 +149,9 @@ export default class MainAbility extends Ability {
} }
``` ```
### 应用向用户申请授权 ### 应用向用户申请授权
应用需要获取用户的隐私信息或使用系统能力时,比如获取位置信息、使用相机拍摄照片或录制视频等,需要向用户申请授权。在开发过程中,首先需要明确涉及的敏感权限并在module.json中声明需要的权限,同时通过接口`requestPermissionsFromUser`以动态弹窗的方式向用户申请授权。以访问日历为例,具体示例代码如下: 应用需要获取用户的隐私信息或使用系统能力时,比如获取位置信息、使用相机拍摄照片或录制视频等,需要向用户申请授权。在开发过程中,首先需要明确涉及的敏感权限并在module.json5中声明需要的权限,同时通过接口`requestPermissionsFromUser`以动态弹窗的方式向用户申请授权。以访问日历为例,具体示例代码如下:
在module.json声明需要的权限: 在module.json5声明需要的权限:
```json ```json
"requestPermissions": [ "requestPermissions": [
{ {
......
...@@ -24,7 +24,7 @@ OpenHarmony当前不支持三方应用创建ServiceExtensionAbility。 ...@@ -24,7 +24,7 @@ OpenHarmony当前不支持三方应用创建ServiceExtensionAbility。
## 开发步骤 ## 开发步骤
1. 需要在应用配置文件module.json中进行注册,注册类型type需要设置为service。module.json配置样例如下所示: 1. 需要在应用配置文件module.json5中进行注册,注册类型type需要设置为service。module.json5配置样例如下所示:
```json ```json
......
...@@ -42,7 +42,7 @@ module.exports = { ...@@ -42,7 +42,7 @@ module.exports = {
``` ```
// hellp.cpp 读取 // hello.cpp 读取
#define _NWEBEX_VERSION(v) #v #define _NWEBEX_VERSION(v) #v
#define _NWEBEX_VER2STR(v) _NWEBEX_VERSION(v) #define _NWEBEX_VER2STR(v) _NWEBEX_VERSION(v)
......
...@@ -73,29 +73,32 @@ import Want from '@ohos.application.Want'; ...@@ -73,29 +73,32 @@ import Want from '@ohos.application.Want';
- 传递RemoteObject数据 - 传递RemoteObject数据
``` js ``` js
import rpc from '@ohos.rpc';
import Ability from '@ohos.application.Ability'
class Stub extends rpc.RemoteObject { class Stub extends rpc.RemoteObject {
constructor(des) { constructor(des) {
if (typeof des == 'string') { if (typeof des == 'string') {
super(des); super(des);
} else { } else {
return null; return null;
} }
} }
onRemoteRequest(code, data, reply, option) { onRemoteRequest(code, data, reply, option) {
if (code === 1) { if (code === 1) {
console.log('onRemoteRequest called') console.log('onRemoteRequest called')
let token = data.readInterfaceToken(); let token = data.readInterfaceToken();
let num = data.readInt(); let num = data.readInt();
this.method(); this.method();
return true; return true;
} }
return false; return false;
} }
method() { method() {
console.log('method called'); console.log('method called');
} }
} }
var remoteObject = new Stub('want-test'); var remoteObject = new Stub('want-test');
...@@ -103,15 +106,17 @@ import Want from '@ohos.application.Want'; ...@@ -103,15 +106,17 @@ import Want from '@ohos.application.Want';
"deviceId": "", // deviceId为空表示本设备 "deviceId": "", // deviceId为空表示本设备
"bundleName": "com.extreme.test", "bundleName": "com.extreme.test",
"abilityName": "MainAbility", "abilityName": "MainAbility",
"moduleName": "entry" // moduleName非必选 "moduleName": "entry", // moduleName非必选
"parameters": { "parameters": {
"keyRemoteObject":{"type":"RemoteObject", "value":remoteObject} "keyRemoteObject":{"type":"RemoteObject", "value":remoteObject}
} }
}; };
this.context.startAbility(want, (error) => { this.context.startAbility(want, (error) => {
// 显式拉起Ability,通过bundleName、abilityName和moduleName可以唯一确定一个Ability // 显式拉起Ability,通过bundleName、abilityName和moduleName可以唯一确定一个Ability
console.log("error.code = " + error.code) console.log("error.code = " + error.code)
}) })
``` ```
<!--no_check--> <!--no_check-->
......
...@@ -112,33 +112,37 @@ register(options?: ContinuationExtraParams): Promise\<number>; ...@@ -112,33 +112,37 @@ register(options?: ContinuationExtraParams): Promise\<number>;
``` ```
## continuationManager.on("deviceConnect")<sup>(deprecated)</sup> ## continuationManager.on("deviceConnect")<sup>(deprecated)</sup>
> 从API Version 9开始不再维护,建议使用[on](#continuationmanagerondeviceconnect)替代。
on(type: "deviceConnect", callback: Callback\<ContinuationResult>): void; on(type: "deviceConnect", callback: Callback\<ContinuationResult>): void;
异步方法,监听设备连接状态,使用Callback形式返回连接的设备信息。 异步方法,监听设备连接状态,使用Callback形式返回连接的设备信息。
> 从API Version 9开始不再维护,建议使用[on](#continuationmanagerondeviceconnect9)替代。
## continuationManager.on("deviceDisconnect")<sup>(deprecated)</sup> ## continuationManager.on("deviceDisconnect")<sup>(deprecated)</sup>
> 从API Version 9开始不再维护,建议使用[on](#continuationmanagerondevicedisconnect)替代。
on(type: "deviceDisconnect", callback: Callback\<string>): void; on(type: "deviceDisconnect", callback: Callback\<string>): void;
异步方法,监听设备断开状态,使用Callback形式返回断开的设备信息。 异步方法,监听设备断开状态,使用Callback形式返回断开的设备信息。
> 从API Version 9开始不再维护,建议使用[on](#continuationmanagerondevicedisconnect9)替代。
## continuationManager.off("deviceConnect")<sup>(deprecated)</sup> ## continuationManager.off("deviceConnect")<sup>(deprecated)</sup>
> 从API Version 9开始不再维护,建议使用[off](#continuationmanageroffdeviceconnect)替代。
off(type: "deviceConnect", callback?: Callback\<ContinuationResult>): void; off(type: "deviceConnect", callback?: Callback\<ContinuationResult>): void;
异步方法,取消监听设备连接状态,使用Callback形式返回连接的设备信息。 异步方法,取消监听设备连接状态,使用Callback形式返回连接的设备信息。
> 从API Version 9开始不再维护,建议使用[off](#continuationmanageroffdeviceconnect9)替代。
## continuationManager.off("deviceDisconnect")<sup>(deprecated)</sup> ## continuationManager.off("deviceDisconnect")<sup>(deprecated)</sup>
> 从API Version 9开始不再维护,建议使用[off](#continuationmanageroffdevicedisconnect)替代。
off(type: "deviceDisconnect", callback?: Callback\<string>): void; off(type: "deviceDisconnect", callback?: Callback\<string>): void;
异步方法,取消监听设备断开状态,使用Callback形式返回连接的设备信息。 异步方法,取消监听设备断开状态,使用Callback形式返回连接的设备信息。
> 从API Version 9开始不再维护,建议使用[off](#continuationmanageroffdevicedisconnect9)替代。
## continuationManager.on("deviceConnect")<sup>9+</sup> ## continuationManager.on("deviceConnect")<sup>9+</sup>
on(type: "deviceConnect", token: number, callback: Callback\<Array\<ContinuationResult>>): void; on(type: "deviceConnect", token: number, callback: Callback\<Array\<ContinuationResult>>): void;
......
...@@ -382,7 +382,7 @@ let promise = preferences.put('startup', 'auto'); ...@@ -382,7 +382,7 @@ let promise = preferences.put('startup', 'auto');
promise.then(() => { promise.then(() => {
console.info("Succeeded in putting value of 'startup'."); console.info("Succeeded in putting value of 'startup'.");
}).catch((err) => { }).catch((err) => {
console.info("Failed to put value of 'startup'. Cause: " + err)); console.info("Failed to put value of 'startup'. Cause: " + err);
}) })
``` ```
......
...@@ -54,13 +54,13 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -54,13 +54,13 @@ import featureAbility from '@ohos.ability.featureAbility';
var path; var path;
var context = featureAbility.getContext(); var context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromsie====================>"); console.info("======================>getFilesDirPromsie====================>");
});
let storage = data_storage.getStorageSync(path + '/mystore'); let storage = data_storage.getStorageSync(path + '/mystore');
storage.putSync('startup', 'auto'); storage.putSync('startup', 'auto');
storage.flushSync(); storage.flushSync();
});
``` ```
...@@ -87,18 +87,18 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -87,18 +87,18 @@ import featureAbility from '@ohos.ability.featureAbility';
var path; var path;
var context = featureAbility.getContext(); var context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromsie====================>"); console.info("======================>getFilesDirPromsie====================>");
});
data_storage.getStorage(path + '/mystore', function (err, storage) { data_storage.getStorage(path + '/mystore', function (err, storage) {
if (err) { if (err) {
console.info("Failed to get the storage. path: " + path + '/mystore'); console.info("Failed to get the storage. path: " + path + '/mystore');
return; return;
} }
storage.putSync('startup', 'auto'); storage.putSync('startup', 'auto');
storage.flushSync(); storage.flushSync();
}) })
});
``` ```
...@@ -130,17 +130,17 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -130,17 +130,17 @@ import featureAbility from '@ohos.ability.featureAbility';
var path; var path;
var context = featureAbility.getContext(); var context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromsie====================>"); console.info("======================>getFilesDirPromsie====================>");
});
let getPromise = data_storage.getStorage(path + '/mystore'); let getPromise = data_storage.getStorage(path + '/mystore');
getPromise.then((storage) => { getPromise.then((storage) => {
storage.putSync('startup', 'auto'); storage.putSync('startup', 'auto');
storage.flushSync(); storage.flushSync();
}).catch((err) => { }).catch((err) => {
console.info("Failed to get the storage. path: " + path + '/mystore'); console.info("Failed to get the storage. path: " + path + '/mystore');
}) })
});
``` ```
...@@ -168,12 +168,11 @@ var context = featureAbility.getContext(); ...@@ -168,12 +168,11 @@ var context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromsie====================>"); console.info("======================>getFilesDirPromsie====================>");
});
data_storage.deleteStorageSync(path + '/mystore'); data_storage.deleteStorageSync(path + '/mystore');
});
``` ```
## data_storage.deleteStorage ## data_storage.deleteStorage
deleteStorage(path: string, callback: AsyncCallback&lt;void&gt;): void deleteStorage(path: string, callback: AsyncCallback&lt;void&gt;): void
...@@ -197,17 +196,17 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -197,17 +196,17 @@ import featureAbility from '@ohos.ability.featureAbility';
var path; var path;
var context = featureAbility.getContext(); var context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromsie====================>"); console.info("======================>getFilesDirPromsie====================>");
});
data_storage.deleteStorage(path + '/mystore', function (err) { data_storage.deleteStorage(path + '/mystore', function (err) {
if (err) { if (err) {
console.info("Failed to delete the storage with err: " + err); console.info("Failed to delete the storage with err: " + err);
return; return;
} }
console.info("Succeeded in deleting the storage."); console.info("Succeeded in deleting the storage.");
}) })
});
``` ```
...@@ -239,16 +238,16 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -239,16 +238,16 @@ import featureAbility from '@ohos.ability.featureAbility';
var path; var path;
var context = featureAbility.getContext(); var context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromsie====================>"); console.info("======================>getFilesDirPromsie====================>");
});
let promisedelSt = data_storage.deleteStorage(path + '/mystore'); let promisedelSt = data_storage.deleteStorage(path + '/mystore');
promisedelSt.then(() => { promisedelSt.then(() => {
console.info("Succeeded in deleting the storage."); console.info("Succeeded in deleting the storage.");
}).catch((err) => { }).catch((err) => {
console.info("Failed to delete the storage with err: " + err); console.info("Failed to delete the storage with err: " + err);
}) })
});
``` ```
...@@ -275,9 +274,9 @@ var context = featureAbility.getContext(); ...@@ -275,9 +274,9 @@ var context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromsie====================>"); console.info("======================>getFilesDirPromsie====================>");
data_storage.removeStorageFromCacheSync(path + '/mystore');
}); });
data_storage.removeStorageFromCacheSync(path + '/mystore');
``` ```
...@@ -304,17 +303,17 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -304,17 +303,17 @@ import featureAbility from '@ohos.ability.featureAbility';
var path; var path;
var context = featureAbility.getContext(); var context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromsie====================>"); console.info("======================>getFilesDirPromsie====================>");
});
data_storage.removeStorageFromCache(path + '/mystore', function (err) { data_storage.removeStorageFromCache(path + '/mystore', function (err) {
if (err) { if (err) {
console.info("Failed to remove storage from cache with err: " + err); console.info("Failed to remove storage from cache with err: " + err);
return; return;
} }
console.info("Succeeded in removing storage from cache."); console.info("Succeeded in removing storage from cache.");
}) })
});
``` ```
...@@ -346,24 +345,22 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -346,24 +345,22 @@ import featureAbility from '@ohos.ability.featureAbility';
var path; var path;
var context = featureAbility.getContext(); var context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromsie====================>"); console.info("======================>getFilesDirPromsie====================>");
});
let promiserevSt = data_storage.removeStorageFromCache(path + '/mystore') let promiserevSt = data_storage.removeStorageFromCache(path + '/mystore')
promiserevSt.then(() => { promiserevSt.then(() => {
console.info("Succeeded in removing storage from cache."); console.info("Succeeded in removing storage from cache.");
}).catch((err) => { }).catch((err) => {
console.info("Failed to remove storage from cache with err: " + err); console.info("Failed to remove storage from cache with err: " + err);
}) })
});
``` ```
## Storage ## Storage
提供获取和修改存储数据的接口。 提供获取和修改存储数据的接口。
### getSync ### getSync
getSync(key: string, defValue: ValueType): ValueType getSync(key: string, defValue: ValueType): ValueType
......
...@@ -185,9 +185,9 @@ getAllDisplay(): Promise&lt;Array&lt;Display&gt;&gt; ...@@ -185,9 +185,9 @@ getAllDisplay(): Promise&lt;Array&lt;Display&gt;&gt;
```js ```js
let promise = display.getAllDisplay(); let promise = display.getAllDisplay();
promise.then((data) => { promise.then((data) => {
console.error('Failed to obtain all the display objects. Code: ' + JSON.stringify(err));
}).catch((err) => {
console.info('Succeeded in obtaining all the display objects. Data: ' + JSON.stringify(data)); console.info('Succeeded in obtaining all the display objects. Data: ' + JSON.stringify(data));
}).catch((err) => {
console.error('Failed to obtain all the display objects. Code: ' + JSON.stringify(err));
}); });
``` ```
...@@ -216,14 +216,24 @@ hasPrivateWindow(displayId: number): boolean ...@@ -216,14 +216,24 @@ hasPrivateWindow(displayId: number): boolean
**示例:** **示例:**
```js ```js
var displayClass = null;
display.getDefaultDisplay((err, data) => {
if (err.code) {
console.error('Failed to obtain the default display object. Code: ' + JSON.stringify(err));
return;
}
console.info('Succeeded in obtaining the default display object. Data:' + JSON.stringify(data));
displayClass = data;
});
var ret = display.hasPrivateWindow(displayClass.id); var ret = display.hasPrivateWindow(displayClass.id);
if (ret == undefined) { if (ret == undefined) {
console.log("Failed to check has privateWindow or not."); console.log("Failed to check has privateWindow or not.");
} }
if (ret) { if (ret) {
console.log("There has privateWindow."); console.log("There has privateWindow.");
} else if (!ret) { } else if (!ret) {
console.log("There has no privateWindow."); console.log("There has no privateWindow.");
} }
``` ```
......
...@@ -33,14 +33,8 @@ var observer = { ...@@ -33,14 +33,8 @@ var observer = {
console.log('onUnhandledException, errorMsg: ', errorMsg) console.log('onUnhandledException, errorMsg: ', errorMsg)
} }
} }
errorManager.registerErrorObserver(observer) const registerErrorObserverNumber=errorManager.registerErrorObserver(observer)
.then((data) => { console.info(registerErrorObserverNumber)
console.log('----------- registerErrorObserver success ----------', data);
})
.catch((err) => {
console.log('----------- registerErrorObserver fail ----------', err);
})
``` ```
## ErrorManager.unregisterErrorObserver ## ErrorManager.unregisterErrorObserver
......
...@@ -336,7 +336,7 @@ InputMethodSetting.listInputMethod((err,data) => { ...@@ -336,7 +336,7 @@ InputMethodSetting.listInputMethod((err,data) => {
### listInputMethod ### listInputMethod
listInputMethod(): Promise&lt;Array<InputMethodProperty>&gt; listInputMethod(): Promise&lt;Array&lt;InputMethodProperty&gt;&gt;
查询已安装的输入法列表。使用promise形式返回结果。参数个数为0,否则抛出异常。 查询已安装的输入法列表。使用promise形式返回结果。参数个数为0,否则抛出异常。
......
...@@ -64,7 +64,7 @@ media.createVideoPlayer((error, video) => { ...@@ -64,7 +64,7 @@ media.createVideoPlayer((error, video) => {
videoPlayer = video; videoPlayer = video;
console.info('video createVideoPlayer success'); console.info('video createVideoPlayer success');
} else { } else {
console.info(`video createVideoPlayer fail, error:${error.message}`); console.info(`video createVideoPlayer fail, error:${error}`);
} }
}); });
``` ```
...@@ -96,7 +96,7 @@ media.createVideoPlayer().then((video) => { ...@@ -96,7 +96,7 @@ media.createVideoPlayer().then((video) => {
console.info('video createVideoPlayer fail'); console.info('video createVideoPlayer fail');
} }
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -146,7 +146,7 @@ media.createVideoRecorder((error, video) => { ...@@ -146,7 +146,7 @@ media.createVideoRecorder((error, video) => {
videoRecorder = video; videoRecorder = video;
console.info('video createVideoRecorder success'); console.info('video createVideoRecorder success');
} else { } else {
console.info(`video createVideoRecorder fail, error:${error.message}`); console.info(`video createVideoRecorder fail, error:${error}`);
} }
}); });
``` ```
...@@ -179,7 +179,7 @@ media.createVideoRecorder().then((video) => { ...@@ -179,7 +179,7 @@ media.createVideoRecorder().then((video) => {
console.info('video createVideoRecorder fail'); console.info('video createVideoRecorder fail');
} }
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -447,7 +447,7 @@ audioPlayer.getTrackDescription((error, arrlist) => { ...@@ -447,7 +447,7 @@ audioPlayer.getTrackDescription((error, arrlist) => {
printfDescription(arrlist[i]); printfDescription(arrlist[i]);
} }
} else { } else {
console.log(`audio getTrackDescription fail, error:${error.message}`); console.log(`audio getTrackDescription fail, error:${error}`);
} }
}); });
``` ```
...@@ -484,7 +484,7 @@ audioPlayer.getTrackDescription().then((arrlist) => { ...@@ -484,7 +484,7 @@ audioPlayer.getTrackDescription().then((arrlist) => {
console.log('audio getTrackDescription fail'); console.log('audio getTrackDescription fail');
} }
}).catch((error) => { }).catch((error) => {
console.info(`audio catchCallback, error:${error.message}`); console.info(`audio catchCallback, error:${error}`);
}); });
for (let i = 0; i < arrayDescription.length; i++) { for (let i = 0; i < arrayDescription.length; i++) {
...@@ -569,9 +569,7 @@ audioPlayer.on('finish', () => { //设置'finish'事件回调 ...@@ -569,9 +569,7 @@ audioPlayer.on('finish', () => { //设置'finish'事件回调
audioPlayer.stop(); //停止播放,并触发'stop'事件回调 audioPlayer.stop(); //停止播放,并触发'stop'事件回调
}); });
audioPlayer.on('error', (error) => { //设置'error'事件回调 audioPlayer.on('error', (error) => { //设置'error'事件回调
console.info(`audio error called, errName is ${error.name}`); console.info(`audio error called, error: ${error}`);
console.info(`audio error called, errCode is ${error.code}`);
console.info(`audio error called, errMessage is ${error.message}`);
}); });
// 用户选择视频设置fd(本地播放) // 用户选择视频设置fd(本地播放)
...@@ -636,9 +634,7 @@ on(type: 'error', callback: ErrorCallback): void ...@@ -636,9 +634,7 @@ on(type: 'error', callback: ErrorCallback): void
```js ```js
audioPlayer.on('error', (error) => { //设置'error'事件回调 audioPlayer.on('error', (error) => { //设置'error'事件回调
console.info(`audio error called, errName is ${error.name}`); //打印错误类型名称 console.info(`audio error called, error: ${error}`);
console.info(`audio error called, errCode is ${error.code}`); //打印错误码
console.info(`audio error called, errMessage is ${error.message}`);//打印错误类型详细描述
}); });
audioPlayer.setVolume(3); //设置volume为无效值,触发'error'事件 audioPlayer.setVolume(3); //设置volume为无效值,触发'error'事件
``` ```
...@@ -762,7 +758,7 @@ setDisplaySurface(surfaceId: string): Promise\<void> ...@@ -762,7 +758,7 @@ setDisplaySurface(surfaceId: string): Promise\<void>
videoPlayer.setDisplaySurface(surfaceId).then(() => { videoPlayer.setDisplaySurface(surfaceId).then(() => {
console.info('setDisplaySurface success'); console.info('setDisplaySurface success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -812,7 +808,7 @@ prepare(): Promise\<void> ...@@ -812,7 +808,7 @@ prepare(): Promise\<void>
videoPlayer.prepare().then(() => { videoPlayer.prepare().then(() => {
console.info('prepare success'); console.info('prepare success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -862,7 +858,7 @@ play(): Promise\<void>; ...@@ -862,7 +858,7 @@ play(): Promise\<void>;
videoPlayer.play().then(() => { videoPlayer.play().then(() => {
console.info('play success'); console.info('play success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -912,7 +908,7 @@ pause(): Promise\<void> ...@@ -912,7 +908,7 @@ pause(): Promise\<void>
videoPlayer.pause().then(() => { videoPlayer.pause().then(() => {
console.info('pause success'); console.info('pause success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -962,7 +958,7 @@ stop(): Promise\<void> ...@@ -962,7 +958,7 @@ stop(): Promise\<void>
videoPlayer.stop().then(() => { videoPlayer.stop().then(() => {
console.info('stop success'); console.info('stop success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -1012,7 +1008,7 @@ reset(): Promise\<void> ...@@ -1012,7 +1008,7 @@ reset(): Promise\<void>
videoPlayer.reset().then(() => { videoPlayer.reset().then(() => {
console.info('reset success'); console.info('reset success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -1103,13 +1099,13 @@ let seekTime = 5000; ...@@ -1103,13 +1099,13 @@ let seekTime = 5000;
videoPlayer.seek(seekTime).then((seekDoneTime) => { // seekDoneTime表示seek完成后的时间点 videoPlayer.seek(seekTime).then((seekDoneTime) => { // seekDoneTime表示seek完成后的时间点
console.info('seek success'); console.info('seek success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
videoPlayer.seek(seekTime, seekMode).then((seekDoneTime) => { videoPlayer.seek(seekTime, seekMode).then((seekDoneTime) => {
console.info('seek success'); console.info('seek success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -1168,7 +1164,7 @@ let vol = 0.5; ...@@ -1168,7 +1164,7 @@ let vol = 0.5;
videoPlayer.setVolume(vol).then() => { videoPlayer.setVolume(vol).then() => {
console.info('setVolume success'); console.info('setVolume success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -1218,7 +1214,7 @@ release(): Promise\<void> ...@@ -1218,7 +1214,7 @@ release(): Promise\<void>
videoPlayer.release().then() => { videoPlayer.release().then() => {
console.info('release success'); console.info('release success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -1253,7 +1249,7 @@ videoPlayer.getTrackDescription((error, arrlist) => { ...@@ -1253,7 +1249,7 @@ videoPlayer.getTrackDescription((error, arrlist) => {
printfDescription(arrlist[i]); printfDescription(arrlist[i]);
} }
} else { } else {
console.log(`video getTrackDescription fail, error:${error.message}`); console.log(`video getTrackDescription fail, error:${error}`);
} }
}); });
``` ```
...@@ -1291,7 +1287,7 @@ videoPlayer.getTrackDescription().then((arrlist) => { ...@@ -1291,7 +1287,7 @@ videoPlayer.getTrackDescription().then((arrlist) => {
console.log('video getTrackDescription fail'); console.log('video getTrackDescription fail');
} }
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
for (let i = 0; i < arrayDescription.length; i++) { for (let i = 0; i < arrayDescription.length; i++) {
printfDescription(arrayDescription[i]); printfDescription(arrayDescription[i]);
...@@ -1357,7 +1353,7 @@ let speed = media.PlaybackSpeed.SPEED_FORWARD_2_00_X; ...@@ -1357,7 +1353,7 @@ let speed = media.PlaybackSpeed.SPEED_FORWARD_2_00_X;
videoPlayer.setSpeed(speed).then() => { videoPlayer.setSpeed(speed).then() => {
console.info('setSpeed success'); console.info('setSpeed success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -1416,7 +1412,7 @@ let bitrate = 1024000; ...@@ -1416,7 +1412,7 @@ let bitrate = 1024000;
videoPlayer.selectBitrate(bitrate).then() => { videoPlayer.selectBitrate(bitrate).then() => {
console.info('selectBitrate success'); console.info('selectBitrate success');
}).catch((error) => { }).catch((error) => {
console.info(`video catchCallback, error:${error.message}`); console.info(`video catchCallback, error:${error}`);
}); });
``` ```
...@@ -1533,9 +1529,7 @@ on(type: 'error', callback: ErrorCallback): void ...@@ -1533,9 +1529,7 @@ on(type: 'error', callback: ErrorCallback): void
```js ```js
videoPlayer.on('error', (error) => { // 设置'error'事件回调 videoPlayer.on('error', (error) => { // 设置'error'事件回调
console.info(`video error called, errName is ${error.name}`); // 打印错误类型名称 console.info(`video error called, error: ${error}`);
console.info(`video error called, errCode is ${error.code}`); // 打印错误码
console.info(`video error called, errMessage is ${error.message}`);// 打印错误类型详细描述
}); });
videoPlayer.url = 'fd://error'; //设置错误的播放地址,触发'error'事件 videoPlayer.url = 'fd://error'; //设置错误的播放地址,触发'error'事件
``` ```
...@@ -1644,7 +1638,7 @@ audioPlayer.getTrackDescription((error, arrlist) => { ...@@ -1644,7 +1638,7 @@ audioPlayer.getTrackDescription((error, arrlist) => {
printfItemDescription(arrlist[i], MD_KEY_TRACK_TYPE); //打印出每条轨道MD_KEY_TRACK_TYPE的值 printfItemDescription(arrlist[i], MD_KEY_TRACK_TYPE); //打印出每条轨道MD_KEY_TRACK_TYPE的值
} }
} else { } else {
console.log(`audio getTrackDescription fail, error:${error.message}`); console.log(`audio getTrackDescription fail, error:${error}`);
} }
}); });
``` ```
...@@ -1824,9 +1818,7 @@ let audioRecorderConfig = { ...@@ -1824,9 +1818,7 @@ let audioRecorderConfig = {
location : { latitude : 30, longitude : 130}, location : { latitude : 30, longitude : 130},
} }
audioRecorder.on('error', (error) => { // 设置'error'事件回调 audioRecorder.on('error', (error) => { // 设置'error'事件回调
console.info(`audio error called, errName is ${error.name}`); console.info(`audio error called, error: ${error}`);
console.info(`audio error called, errCode is ${error.code}`);
console.info(`audio error called, errMessage is ${error.message}`);
}); });
audioRecorder.on('prepare', () => { // 设置'prepare'事件回调 audioRecorder.on('prepare', () => { // 设置'prepare'事件回调
console.log('prepare success'); console.log('prepare success');
...@@ -1872,9 +1864,7 @@ on(type: 'error', callback: ErrorCallback): void ...@@ -1872,9 +1864,7 @@ on(type: 'error', callback: ErrorCallback): void
```js ```js
audioRecorder.on('error', (error) => { // 设置'error'事件回调 audioRecorder.on('error', (error) => { // 设置'error'事件回调
console.info(`audio error called, errName is ${error.name}`); // 打印错误类型名称 console.info(`audio error called, error: ${error}`);
console.info(`audio error called, errCode is ${error.code}`); // 打印错误码
console.info(`audio error called, errMessage is ${error.message}`); // 打印错误类型详细描述
}); });
audioRecorder.prepare(); // prepare不设置参数,触发'error'事件 audioRecorder.prepare(); // prepare不设置参数,触发'error'事件
``` ```
...@@ -2492,10 +2482,7 @@ on(type: 'error', callback: ErrorCallback): void ...@@ -2492,10 +2482,7 @@ on(type: 'error', callback: ErrorCallback): void
```js ```js
videoRecorder.on('error', (error) => { // 设置'error'事件回调 videoRecorder.on('error', (error) => { // 设置'error'事件回调
console.info(`audio error called, errName is ${error.name}`); // 打印错误类型名称 console.info(`audio error called, error: ${error}`);
console.info(`audio error called, errCode is ${error.code}`); // 打印错误码
console.info(`audio error called, errMessage is ${error.message}`); // 打印错误类型详细描述
});
// 当获取videoRecordState接口出错时通过此订阅事件上报 // 当获取videoRecordState接口出错时通过此订阅事件上报
``` ```
......
...@@ -1428,7 +1428,7 @@ Notification.getSlotNumByBundle(bundle).then((data) => { ...@@ -1428,7 +1428,7 @@ Notification.getSlotNumByBundle(bundle).then((data) => {
## Notification.remove ## Notification.remove
remove(bundle: BundleOption, notificationKey: NotificationKey, callback: AsyncCallback\<void\>): void remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, callback: AsyncCallback\<void\>): void
删除指定通知(Callback形式)。 删除指定通知(Callback形式)。
...@@ -1441,9 +1441,10 @@ remove(bundle: BundleOption, notificationKey: NotificationKey, callback: AsyncCa ...@@ -1441,9 +1441,10 @@ remove(bundle: BundleOption, notificationKey: NotificationKey, callback: AsyncCa
**参数:** **参数:**
| 名称 | 类型 | 必填 | 描述 | | 名称 | 类型 | 必填 | 描述 |
| --------------- | ----------------------------------- | ---- | -------------------- | | --------------- | ----------------------------------| ---- | -------------------- |
| bundle | [BundleOption](#bundleoption) | 是 | 指定包信息。 | | bundle | [BundleOption](#bundleoption) | 是 | 指定包信息。 |
| notificationKey | [NotificationKey](#notificationkey) | 是 | 通知键值。 | | notificationKey | [NotificationKey](#notificationkey) | 是 | 通知键值。 |
| reason | [RemoveReason](#removereason9) | 是 | 通知删除原因。 |
| callback | AsyncCallback\<void\> | 是 | 删除指定通知回调函数。 | | callback | AsyncCallback\<void\> | 是 | 删除指定通知回调函数。 |
**示例:** **示例:**
...@@ -1459,14 +1460,15 @@ var notificationKey = { ...@@ -1459,14 +1460,15 @@ var notificationKey = {
id: 0, id: 0,
label: "label", label: "label",
} }
Notification.remove(bundle, notificationKey, removeCallback); var reason = Notification.RemoveReason.CLICK_REASON_REMOVE;
Notification.remove(bundle, notificationKey, reason, removeCallback);
``` ```
## Notification.remove ## Notification.remove
remove(bundle: BundleOption, notificationKey: NotificationKey): Promise\<void\> remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason): Promise\<void\>
删除指定通知(Promise形式)。 删除指定通知(Promise形式)。
...@@ -1482,6 +1484,7 @@ remove(bundle: BundleOption, notificationKey: NotificationKey): Promise\<void\> ...@@ -1482,6 +1484,7 @@ remove(bundle: BundleOption, notificationKey: NotificationKey): Promise\<void\>
| --------------- | --------------- | ---- | ---------- | | --------------- | --------------- | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | 是 | 指定包信息。 | | bundle | [BundleOption](#bundleoption) | 是 | 指定包信息。 |
| notificationKey | [NotificationKey](#notificationkey) | 是 | 通知键值。 | | notificationKey | [NotificationKey](#notificationkey) | 是 | 通知键值。 |
| reason | [RemoveReason](#removereason9) | 是 | 通知删除原因。 |
**示例:** **示例:**
...@@ -1493,7 +1496,8 @@ var notificationKey = { ...@@ -1493,7 +1496,8 @@ var notificationKey = {
id: 0, id: 0,
label: "label", label: "label",
} }
Notification.remove(bundle, notificationKey).then(() => { var reason = Notification.RemoveReason.CLICK_REASON_REMOVE;
Notification.remove(bundle, notificationKey, reason).then(() => {
console.info("==========================>removeCallback=======================>"); console.info("==========================>removeCallback=======================>");
}); });
``` ```
...@@ -1502,7 +1506,7 @@ Notification.remove(bundle, notificationKey).then(() => { ...@@ -1502,7 +1506,7 @@ Notification.remove(bundle, notificationKey).then(() => {
## Notification.remove ## Notification.remove
remove(hashCode: string, callback: AsyncCallback\<void\>): void remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback\<void\>): void
删除指定通知(Callback形式)。 删除指定通知(Callback形式)。
...@@ -1517,6 +1521,7 @@ remove(hashCode: string, callback: AsyncCallback\<void\>): void ...@@ -1517,6 +1521,7 @@ remove(hashCode: string, callback: AsyncCallback\<void\>): void
| 名称 | 类型 | 必填 | 描述 | | 名称 | 类型 | 必填 | 描述 |
| -------- | --------------------- | ---- | -------------------- | | -------- | --------------------- | ---- | -------------------- |
| hashCode | string | 是 | 通知唯一ID。 | | hashCode | string | 是 | 通知唯一ID。 |
| reason | [RemoveReason](#removereason9) | 是 | 通知删除原因。 |
| callback | AsyncCallback\<void\> | 是 | 删除指定通知回调函数。 | | callback | AsyncCallback\<void\> | 是 | 删除指定通知回调函数。 |
**示例:** **示例:**
...@@ -1527,15 +1532,15 @@ var hashCode = 'hashCode' ...@@ -1527,15 +1532,15 @@ var hashCode = 'hashCode'
function removeCallback(err) { function removeCallback(err) {
console.info("==========================>removeCallback=======================>"); console.info("==========================>removeCallback=======================>");
} }
var reason = Notification.RemoveReason.CANCEL_REASON_REMOVE;
Notification.remove(hashCode, removeCallback); Notification.remove(hashCode, reason, removeCallback);
``` ```
## Notification.remove ## Notification.remove
remove(hashCode: string): Promise\<void\> remove(hashCode: string, reason: RemoveReason): Promise\<void\>
删除指定通知(Promise形式)。 删除指定通知(Promise形式)。
...@@ -1550,13 +1555,14 @@ remove(hashCode: string): Promise\<void\> ...@@ -1550,13 +1555,14 @@ remove(hashCode: string): Promise\<void\>
| 名称 | 类型 | 必填 | 描述 | | 名称 | 类型 | 必填 | 描述 |
| -------- | ---------- | ---- | ---------- | | -------- | ---------- | ---- | ---------- |
| hashCode | string | 是 | 通知唯一ID。 | | hashCode | string | 是 | 通知唯一ID。 |
| reason | [RemoveReason](#removereason9) | 是 | 通知删除原因。 |
**示例:** **示例:**
```js ```js
var hashCode = 'hashCode' var hashCode = 'hashCode'
var reason = Notification.RemoveReason.CLICK_REASON_REMOVE;
Notification.remove(hashCode).then(() => { Notification.remove(hashCode, reason).then(() => {
console.info("==========================>removeCallback=======================>"); console.info("==========================>removeCallback=======================>");
}); });
``` ```
...@@ -3876,4 +3882,15 @@ Notification.subscribe(subscriber, subscribeCallback); ...@@ -3876,4 +3882,15 @@ Notification.subscribe(subscriber, subscribeCallback);
| -------------------- | --- | -------------------- | | -------------------- | --- | -------------------- |
| TYPE_NORMAL | 0 | 一般通知。 | | TYPE_NORMAL | 0 | 一般通知。 |
| TYPE_CONTINUOUS | 1 | 连续通知。 | | TYPE_CONTINUOUS | 1 | 连续通知。 |
| TYPE_TIMER | 2 | 计划通知。 | | TYPE_TIMER | 2 | 计划通知。 |
\ No newline at end of file
## RemoveReason<sup>9+</sup>
**系统能力**:SystemCapability.Notification.Notification
**系统API**: 此接口为系统接口,三方应用不支持调用。
| 名称 | 值 | 描述 |
| -------------------- | --- | -------------------- |
| CLICK_REASON_REMOVE | 1 | 点击通知后删除通知。 |
| CANCEL_REASON_REMOVE | 2 | 用户删除通知。 |
\ No newline at end of file
...@@ -25,6 +25,7 @@ import pasteboard from '@ohos.pasteboard'; ...@@ -25,6 +25,7 @@ import pasteboard from '@ohos.pasteboard';
| MIMETYPE_TEXT_WANT<sup>7+</sup> | string | 是 | 否 | Want的MIME类型定义。 | | MIMETYPE_TEXT_WANT<sup>7+</sup> | string | 是 | 否 | Want的MIME类型定义。 |
| MIMETYPE_TEXT_PLAIN<sup>7+</sup> | string | 是 | 否 | Plain&nbsp;text文本的MIME类型定义。 | | MIMETYPE_TEXT_PLAIN<sup>7+</sup> | string | 是 | 否 | Plain&nbsp;text文本的MIME类型定义。 |
| MIMETYPE_TEXT_URI<sup>7+</sup> | string | 是 | 否 | URI文本的MIME类型定义。 | | MIMETYPE_TEXT_URI<sup>7+</sup> | string | 是 | 否 | URI文本的MIME类型定义。 |
| MIMETYPE_PIXELMAP<sup>9+</sup> | string | 是 | 否 | PixelMap的MIME类型定义。 |
## pasteboard.createPlainTextData ## pasteboard.createPlainTextData
...@@ -128,7 +129,43 @@ createUriData(uri:string): PasteData ...@@ -128,7 +129,43 @@ createUriData(uri:string): PasteData
**示例** **示例**
```js ```js
var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1?user.txt"); var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1/user.txt");
```
## pasteboard.createPixelMapData<sup>9+</sup>
createPixelMapData((pixelMap: image.PixelMap): PasteData
构建一个PixelMap剪贴板内容对象。
**系统能力**: SystemCapability.MiscServices.Pasteboard
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| pixelMap | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 待保存的PixelMap内容。 |
**返回值**
| 类型 | 说明 |
| -------- | -------- |
| [PasteData](#pastedata) | 包含此内容的剪贴板内容对象。 |
**示例**
```js
import image from '@ohos.multimedia.image';
var buffer = new ArrayBuffer(128)
var opt = {
size: { height: 3, width: 5 },
pixelFormat: 3,
editable: true,
alphaType: 1,
scaleMode: 1
}
image.createPixelMap(buffer, opt).then((pixelMap) => {
var pasteData = pasteboard.createPixelMapData(pixelMap);
})
``` ```
...@@ -233,23 +270,72 @@ createUriRecord(uri:string): PasteDataRecord ...@@ -233,23 +270,72 @@ createUriRecord(uri:string): PasteDataRecord
**示例** **示例**
```js ```js
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt"); var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1/user.txt");
```
## pasteboard.createPixelMapRecord<sup>9+</sup>
createPixelMapRecord(pixelMap:image.PixelMap): PasteDataRecord
创建一条PixelMap对象内容的条目。
**系统能力**: SystemCapability.MiscServices.Pasteboard
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| pixelMap | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | PixelMap对象内容。 |
**返回值**
| 类型 | 说明 |
| -------- | -------- |
| [PasteDataRecord](#pastedatarecord7) | 一条新建的PixelMap对象内容条目。 |
**示例**
```js
import image from '@ohos.multimedia.image';
var buffer = new ArrayBuffer(128)
var opt = {
size: { height: 3, width: 5 },
pixelFormat: 3,
editable: true,
alphaType: 1,
scaleMode: 1
}
image.createPixelMap(buffer, opt).then((pixelMap) => {
var record = pasteboard.createPixelMapRecord(pixelMap);
})
``` ```
## ShareOption<sup>9+</sup>
可粘贴数据的范围类型枚举。
**系统能力**: SystemCapability.MiscServices.Pasteboard
| 名称 | 说明 |
| ----- | ----------------------- |
| InApp |InApp表示仅允许同应用内粘贴。 |
| LocalDevice |LocalDevice表示仅允许在此设备中粘贴。 |
## PasteDataProperty<sup>7+</sup> ## PasteDataProperty<sup>7+</sup>
定义了剪贴板中所有内容条目的属性,包含时间戳、数据类型以及一些附加数据等。 定义了剪贴板中所有内容条目的属性,包含时间戳、数据类型、粘贴范围以及一些附加数据等。
**系统能力**: 以下各项对应的系统能力均为SystemCapability.MiscServices.Pasteboard。 **系统能力**: 以下各项对应的系统能力均为SystemCapability.MiscServices.Pasteboard。
| 名称 | 参数类型 | 可读 | 可写 | 说明 | | 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| additions | {[key:&nbsp;string]:&nbsp;object} | 是 | 是 | 设置的其他附加属性数据。 | | additions<sup>7+</sup> | {[key:&nbsp;string]:&nbsp;object} | 是 | 是 | 设置的其他附加属性数据。 |
| mimeTypes | Array&lt;string&gt; | 是 | 否 | 剪贴板内容条目的数据类型,&nbsp;非重复的类型列表。 | | mimeTypes<sup>7+</sup> | Array&lt;string&gt; | 是 | 否 | 剪贴板内容条目的数据类型,&nbsp;非重复的类型列表。 |
| tag | string | 是 | 是 | 用户自定义标签。 | | tag<sup>7+</sup> | string | 是 | 是 | 用户自定义标签。 |
| timestamp | number | 是 | 否 | 剪贴板数据的写入时间戳(毫秒)。 | | timestamp<sup>7+</sup> | number | 是 | 否 | 剪贴板数据的写入时间戳(毫秒)。 |
| localOnly | boolean | 是 | 是 | 配置剪贴板内容的“仅在本地”标志位。<br/>-&nbsp;默认情况为true。<br/>-&nbsp;配置为true时,表示内容仅在本地,不会在设备之间传递。<br/>-&nbsp;配置为false时,表示内容将在设备间传递。 | | localOnly<sup>7+</sup> | boolean | 是 | 是 | 配置剪贴板内容的“仅在本地”标志位。<br/>-&nbsp;默认情况为true。<br/>-&nbsp;配置为true时,表示内容仅在本地,不会在设备之间传递。<br/>-&nbsp;配置为false时,表示内容将在设备间传递。 |
| shareOption<sup>9+</sup> | [ShareOption](#shareoption9) | 是 | 是 | 指示剪贴板数据可以粘贴到的范围。 |
## PasteDataRecord<sup>7+</sup> ## PasteDataRecord<sup>7+</sup>
...@@ -268,6 +354,7 @@ createUriRecord(uri:string): PasteDataRecord ...@@ -268,6 +354,7 @@ createUriRecord(uri:string): PasteDataRecord
| mimeType<sup>7+</sup> | string | 是 | 否 | 数据类型。 | | mimeType<sup>7+</sup> | string | 是 | 否 | 数据类型。 |
| plainText<sup>7+</sup> | string | 是 | 否 | 文本内容。 | | plainText<sup>7+</sup> | string | 是 | 否 | 文本内容。 |
| uri<sup>7+</sup> | string | 是 | 否 | URI内容。 | | uri<sup>7+</sup> | string | 是 | 否 | URI内容。 |
| pixelMap<sup>9+</sup> | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 否 | PixelMap内容。 |
### convertToText<sup>7+</sup> ### convertToText<sup>7+</sup>
...@@ -286,10 +373,10 @@ convertToText(): Promise&lt;string&gt; ...@@ -286,10 +373,10 @@ convertToText(): Promise&lt;string&gt;
**示例** **示例**
```js ```js
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt"); var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1/user.txt");
record.convertToText().then((data) => { record.convertToText().then((data) => {
console.info('convertToText success data : ' + JSON.stringify(data)); console.info('convertToText success data : ' + JSON.stringify(data));
}).catch((error) => { }).catch((error) => {
console.error('convertToText failed because ' + JSON.stringify(error)); console.error('convertToText failed because ' + JSON.stringify(error));
}); });
``` ```
...@@ -311,7 +398,7 @@ convertToText(callback: AsyncCallback&lt;string&gt;): void ...@@ -311,7 +398,7 @@ convertToText(callback: AsyncCallback&lt;string&gt;): void
**示例** **示例**
```js ```js
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt"); var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1/user.txt");
record.convertToText((err, data) => { record.convertToText((err, data) => {
if (err) { if (err) {
console.error('convertToText failed because ' + JSON.stringify(err)); console.error('convertToText failed because ' + JSON.stringify(err));
...@@ -416,11 +503,44 @@ getPrimaryUri(): string ...@@ -416,11 +503,44 @@ getPrimaryUri(): string
**示例** **示例**
```js ```js
var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1?user.txt"); var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1/user.txt");
var uri = pasteData.getPrimaryUri(); var uri = pasteData.getPrimaryUri();
``` ```
### getPrimaryPixelMap<sup>9+</sup>
getPrimaryPixelMap(): image.PixelMap
获取首个条目的PixelMap对象内容。
**系统能力**: SystemCapability.MiscServices.Pasteboard
**返回值**
| 类型 | 说明 |
| -------- | -------- |
| [image.PixelMap](js-apis-image.md#pixelmap7) | PixelMap对象内容。 |
**示例**
```js
import image from '@ohos.multimedia.image';
var buffer = new ArrayBuffer(128)
var opt = {
size: { height: 3, width: 5 },
pixelFormat: 3,
editable: true,
alphaType: 1,
scaleMode: 1
}
image.createPixelMap(buffer, opt).then((pixelMap) => {
var pasteData = pasteboard.createPixelMapData(pixelMap);
var pixelMap = pasteData.getPrimaryPixelMap();
})
```
### addTextRecord<sup>7+</sup> ### addTextRecord<sup>7+</sup>
addTextRecord(text: string): void addTextRecord(text: string): void
...@@ -514,7 +634,39 @@ addUriRecord(uri: string): void ...@@ -514,7 +634,39 @@ addUriRecord(uri: string): void
```js ```js
var pasteData = pasteboard.createPlainTextData("hello"); var pasteData = pasteboard.createPlainTextData("hello");
pasteData.addUriRecord("dataability:///com.example.myapplication1?user.txt"); pasteData.addUriRecord("dataability:///com.example.myapplication1/user.txt");
```
### addPixelMapRecord<sup>9+</sup>
addPixelMapRecord(pixelMap: image.PixelMap): void
向当前剪贴板内容中添加一条pixelMap条目,并将MIMETYPE_PIXELMAP添加到[PasteDataProperty](#pastedataproperty7)的mimeTypes中。入参均不能为空,否则添加失败。
剪贴板内容中添加的条目达到数量上限512后,后续的添加操作无效。
**系统能力**: SystemCapability.MiscServices.Pasteboard
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| pixelMap | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | PixelMap对象内容。 |
**示例**
```js
import image from '@ohos.multimedia.image';
var buffer = new ArrayBuffer(128)
var opt = {
size: { height: 3, width: 5 },
pixelFormat: 3,
editable: true,
alphaType: 1,
scaleMode: 1
}
image.createPixelMap(buffer, opt).then((pixelMap) => {
var record = pasteboard.createPlainTextData("hello").addPixelMapRecord(pixelMap);
})
``` ```
...@@ -536,7 +688,7 @@ addRecord(record: PasteDataRecord): void ...@@ -536,7 +688,7 @@ addRecord(record: PasteDataRecord): void
**示例** **示例**
```js ```js
var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1?user.txt"); var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1/user.txt");
var textRecord = pasteboard.createPlainTextRecord("hello"); var textRecord = pasteboard.createPlainTextRecord("hello");
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>"; var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
var htmlRecord = pasteboard.createHtmlTextRecord(html); var htmlRecord = pasteboard.createHtmlTextRecord(html);
...@@ -608,6 +760,29 @@ getProperty(): PasteDataProperty ...@@ -608,6 +760,29 @@ getProperty(): PasteDataProperty
``` ```
### setProperty<sup>9+</sup>
setProperty(property: PasteDataProperty): void
设置属性描述对象,当前仅支持设置shareOption属性。
**系统能力**: SystemCapability.MiscServices.Pasteboard
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| property | [PasteDataProperty](#pastedataproperty7) | 是 | 属性描述对象。 |
**示例**
```js
var pasteData = pasteboard.createHtmlData('application/xml');
let prop = pasteData.getProperty();
prop.shareOption = pasteboard.ShareOption.InApp;
pasteData.setProperty(prop);
```
### getRecordAt<sup>7+</sup> ### getRecordAt<sup>7+</sup>
getRecordAt(index: number): PasteDataRecord getRecordAt(index: number): PasteDataRecord
...@@ -751,7 +926,7 @@ replaceRecordAt(index: number, record: PasteDataRecord): boolean ...@@ -751,7 +926,7 @@ replaceRecordAt(index: number, record: PasteDataRecord): boolean
```js ```js
var pasteData = pasteboard.createPlainTextData("hello"); var pasteData = pasteboard.createPlainTextData("hello");
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt"); var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1/user.txt");
var isReplace = pasteData.replaceRecordAt(0, record); var isReplace = pasteData.replaceRecordAt(0, record);
``` ```
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
import pointer from '@ohos.multimodalInput.pointer'; import pointer from '@ohos.multimodalInput.pointer';
``` ```
## pointer.setPointerVisibele ## pointer.setPointerVisibele<sup>9+</sup>
setPointerVisible(visible: boolean, callback: AsyncCallback&lt;void&gt;): void setPointerVisible(visible: boolean, callback: AsyncCallback&lt;void&gt;): void
设置鼠标指针显示或者隐藏,使用callback方式作为异步方法 设置鼠标指针显示或者隐藏,使用callback异步回调
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer **系统能力**:SystemCapability.MultimodalInput.Input.Pointer
...@@ -25,21 +25,21 @@ setPointerVisible(visible: boolean, callback: AsyncCallback&lt;void&gt;): void ...@@ -25,21 +25,21 @@ setPointerVisible(visible: boolean, callback: AsyncCallback&lt;void&gt;): void
| 参数 | 类型 | 必填 | 说明 | | 参数 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ------------------------------------------------------------------- | | -------- | ------------------------- | ---- | ------------------------------------------------------------------- |
| visible | boolean | 是 | 鼠标指针显示或者隐藏状态,true: 鼠标指针显示; false: 鼠标指针隐藏。 | | visible | boolean | 是 | 鼠标指针显示或者隐藏状态,true: 鼠标指针显示; false: 鼠标指针隐藏。 |
| callback | AysncCallback&lt;void&gt; | 是 | 回调函数,异步返回查询结果。 | | callback | AysncCallback&lt;void&gt; | 是 | 回调函数。当设置鼠标显示或隐藏成功,err为undefined,否则为错误对象。 |
**示例** **示例**
```js ```js
pointer.setPointerVisible(true, (err, data) => { pointer.setPointerVisible(true, (err, data) => {
if (err) { if (err) {
console.log(`set pointer visible failed. err=${JSON.stringify(err)}`); console.log(`set pointer visible failed. err=${JSON.stringify(err)}`);
return; return;
} }
console.log(`set pointer visible success.`); console.log(`set pointer visible success.`);
); );
``` ```
## pointer.setPointerVisible ## pointer.setPointerVisible<sup>9+</sup>
setPointerVisible(visible: boolean): Promise&lt;void&gt; setPointerVisible(visible: boolean): Promise&lt;void&gt;
...@@ -62,18 +62,18 @@ setPointerVisible(visible: boolean): Promise&lt;void&gt; ...@@ -62,18 +62,18 @@ setPointerVisible(visible: boolean): Promise&lt;void&gt;
**示例** **示例**
```js ```js
pointer.setPointerVisible(false).then( data => { pointer.setPointerVisible(false).then(data => {
console.log(`set mouse pointer visible success`); console.log(`set mouse pointer visible success`);
}, data => { }, data => {
console.log(`set mouse pointer visible failed err=${JSON.stringify(data)}`); console.log(`set mouse pointer visible failed err=${JSON.stringify(data)}`);
}); });
``` ```
## pointer.isPointerVisible ## pointer.isPointerVisible<sup>9+</sup>
isPointerVisible(callback: AsyncCallback&lt;boolean&gt;): void isPointerVisible(callback: AsyncCallback&lt;boolean&gt;): void
获取鼠标指针显示或隐藏状态,使用callback方式作为异步方法 获取鼠标指针显示或隐藏状态,使用callback异步回调
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer **系统能力**:SystemCapability.MultimodalInput.Input.Pointer
...@@ -87,11 +87,11 @@ isPointerVisible(callback: AsyncCallback&lt;boolean&gt;): void ...@@ -87,11 +87,11 @@ isPointerVisible(callback: AsyncCallback&lt;boolean&gt;): void
```js ```js
pointer.isPointerVisible((visible)=>{ pointer.isPointerVisible((visible)=>{
console.log("The mouse pointer visible attributes is " + visible); console.log("The mouse pointer visible attributes is " + visible);
}); });
``` ```
## pointer.isPointerVisible ## pointer.isPointerVisible<sup>9+</sup>
isPointerVisible(): Promise&lt;boolean&gt; isPointerVisible(): Promise&lt;boolean&gt;
...@@ -109,6 +109,285 @@ isPointerVisible(): Promise&lt;boolean&gt; ...@@ -109,6 +109,285 @@ isPointerVisible(): Promise&lt;boolean&gt;
```js ```js
pointer.isPointerVisible().then( data => { pointer.isPointerVisible().then( data => {
console.log(`isPointerThen success data=${JSON.stringify(data)}`); console.log(`isPointerThen success data=${JSON.stringify(data)}`);
}); });
``` ```
## pointer.setPointerSpeed<sup>9+</sup>
setPointerSpeed(speed: number, callback: AsyncCallback&lt;void&gt;): void
设置鼠标移动速度,使用callback异步回调。
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ------------------------------------------------------------------- |
| speed | number | 是 | 鼠标移动速度设置挡位值1-11,最大值:11,最小值:1,标准值:5。 |
| callback | AysncCallback&lt;void&gt; | 是 | 回调函数。当设置鼠标速度成功,err为undefined,否则为错误对象。 |
**示例**
```js
pointer.setPointerSpeed(5, (err, data) => {
if (err) {
console.log(`set pointer speed failed. err=${JSON.stringify(err)}`);
return;
}
console.log(`set pointer speed success.`);
);
```
## pointer.setPointerSpeed<sup>9+</sup>
setPointerSpeed(speed: number): Promise&lt;void&gt;
设置鼠标移动速度,使用Promise异步回调。
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer
**参数**
| 参数 | 类型 | 必填 | 说明 |
| ------- | ------- | ---- | ------------------------------------------------------------------- |
| speed | number | 是 | 鼠标移动速度设置挡位值1-11,最大值:11,最小值:1,标准值:5。 |
**返回值**
| 参数 | 说明 |
| ------------------- | ------------------------------- |
| Promise&lt;void&gt; | 无返回结果的Promise对象。 |
**示例**
```js
pointer.setPointerSpeed(5).then(data => {
console.log(`set pointer speed success`);
}, err => {
console.log(`set pointer speed failed err=${JSON.stringify(err)}`);
});
```
## pointer.getPointerSpeed<sup>9+</sup>
getPointerSpeed(callback: AsyncCallback&lt;number&gt;): void
获取当前鼠标移动速度,使用callback异步回调。
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------- | ---- | ---------------------------- |
| callback | AsyncCallback&lt;number&gt; | 是 | 回调函数,异步返回查询结果。 |
**示例**
```js
pointer.getPointerSpeed((speed)=>{
console.log("The pointer speed is " + speed);
});
```
## pointer.getPointerSpeed<sup>9+</sup>
getPointerSpeed(): Promise&lt;number&gt;
获取当前鼠标移动速度,使用Promise异步回调。
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer
**返回值**
| 参数 | 说明 |
| ---------------------- | ------------------------------- |
| Promise&lt;number&gt; | Promise实例,用于异步获取结果。 |
**示例**
```js
pointer.getPointerSpeed().then( data => {
console.log(`getPointerSpeed success data=${JSON.stringify(data)}`);
});
```
## pointer.getPointerStyle<sup>9+</sup>
getPointerStyle(windowId: number, callback: AsyncCallback&lt;PointerStyle&gt;): void
获取鼠标样式类型,使用callback异步回调。
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------------------------------- |
| windowId | number | 是 | 输入设备的窗口id。 |
| callback | AsyncCallback&lt;[PointerStyle](#pointerstyle9)&gt; | 是 | 回调函数,异步返回查询结果。|
**示例**
```js
// 获取设备的鼠标样式。
import window from '@ohos.window';
var windowClass = null;
window.getTopWindow((err, data) => {
windowClass = data;
windowClass.getProperties((err, data) => {
var windowId = data.id;
pointer.getPointerStyle(windowId, (err, ret) => {
console.log("The mouse pointer style is: " + ret);
});
});
});
```
## pointer.getPointerStyle<sup>9+</sup>
getPointerStyle(windowId: number): Promise&lt;PointerStyle&gt;
获取鼠标样式类型,使用Promise方式作为异步方法。
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer
**参数**
| 参数 | 说明 |
| -------- | --------------------------------- |
| Promise&lt;[PointerStyle](#pointerstyle9)&gt; |Promise实例,用于异步获取结果。|
**示例**
```js
// 获取设备的鼠标样式。
import window from '@ohos.window';
var windowClass = null;
window.getTopWindow((err, data) => {
windowClass = data;
windowClass.getProperties((err, data) => {
var windowId = data.id;
pointer.getPointerStyle(windowId).then((ret) => {
console.log("The mouse pointer style is: " + ret);
});
});
});
```
## pointer.setPointerStyle<sup>9+</sup>
setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback&lt;void&gt;): void
设置鼠标的样式类型,使用callback异步回调。
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------| ---- | --------------------------------- |
| windowId | number | 是 | 输入设备的窗口id。 |
| pointerStyle | [PointerStyle](#pointerstyle9) | 是 | 鼠标样式id。 |
| callback | AysncCallback&lt;void&gt; | 是 | 回调函数。当设置样式成功,err为undefined,否则为错误对象。|
**示例**
```js
// 设置设备的鼠标样式。
import window from '@ohos.window';
var windowClass = null;
window.getTopWindow((err, data) => {
windowClass = data;
windowClass.getProperties((err, data) => {
var windowId = data.id;
pointer.setPointerStyle(windowId, pointer.PointerStyle.CROSS, (err) => {
console.log(`Set mouse pointer style success.`);
});
});
});
```
## pointer.setPointerStyle<sup>9+</sup>
setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise&lt;void&gt;
设置鼠标的样式类型,使用Promise方式作为异步方法。
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer
**参数**
| 参数 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | --------------------------------- |
| windowId | number | 是 | 输入设备的窗口id。 |
| pointerStyle | [PointerStyle](#pointerstyle9) | 是 | 鼠标样式id。 |
| Promise&lt;void&gt; | void | 是 |无返回结果的Promise对象。 |
**示例**
```js
// 设置设备的鼠标样式。
import window from '@ohos.window';
var windowClass = null;
window.getTopWindow((err, data) => {
windowClass = data;
windowClass.getProperties((err, data) => {
var windowId = data.id;
pointer.setPointerStyle(windowId, pointer.PointerStyle.CROSS).then(() => {
console.log(`Set mouse pointer style success`);
});
});
});
```
## PointerStyle<sup>9+</sup>
定义鼠标样式类型。
**系统能力**:SystemCapability.MultimodalInput.Input.Pointer
| 名称 | 值 | 说明 |
| ------------------- | ---- | --------- |
| DEFAULT | 0 | 默认 |
| EAST | 1 | 向东箭头 |
| WEST | 2 | 向西箭头|
| SOUTH | 3 | 向南箭头 |
| NORTH | 4 | 向北箭头 |
| WEST_EAST | 5 | 向西东箭头 |
| NORTH_SOUTH | 6 | 向北南箭头 |
| NORTH_EAST | 7 | 向东北箭头 |
| NORTH_WEST | 8 | 向西北箭头 |
| SOUTH_EAST | 9 | 向东南箭头 |
| SOUTH_WEST | 10 | 向西南箭头 |
| NORTH_EAST_SOUTH_WEST | 11 | 东北西南调整 |
| NORTH_WEST_SOUTH_EAST | 12 | 西北东南调整 |
| CROSS | 13 | 准确选择 |
| CURSOR_COPY | 14 | 拷贝 |
| CURSOR_FORBID | 15 | 不可用 |
| COLOR_SUCKER | 16 | 滴管 |
| HAND_GRABBING | 17 | 并拢的手 |
| HAND_OPEN | 18 | 张开的手 |
| HAND_POINTING | 19 | 手形指针 |
| HELP | 20 | 帮助选择 |
| MOVE | 21 | 移动 |
| RESIZE_LEFT_RIGHT | 22 | 内部左右调整 |
| RESIZE_UP_DOWN | 23 | 内部上下调整 |
| SCREENSHOT_CHOOSE | 24 | 截图十字准星 |
| SCREENSHOT_CURSOR | 25 | 截图 |
| TEXT_CURSOR | 26 | 文本选择 |
| ZOOM_IN | 27 | 放大 |
| ZOOM_OUT | 28 | 缩小 |
| MIDDLE_BTN_EAST | 29 | 向东滚动 |
| MIDDLE_BTN_WEST | 30 | 向西滚动 |
| MIDDLE_BTN_SOUTH | 31 | 向南滚动 |
| MIDDLE_BTN_NORTH | 32 | 向北滚动 |
| MIDDLE_BTN_NORTH_SOUTH | 33 | 向北南滚动 |
| MIDDLE_BTN_NORTH_EAST | 34 | 向东北滚动 |
| MIDDLE_BTN_NORTH_WEST | 35 | 向西北滚动 |
| MIDDLE_BTN_SOUTH_EAST | 36 | 向东南滚动 |
| MIDDLE_BTN_SOUTH_WEST | 37 | 向西南滚动 |
| MIDDLE_BTN_NORTH_SOUTH_WEST_EAST | 38 | 四向锥形移动 |
...@@ -17,7 +17,7 @@ import radio from '@ohos.telephony.radio' ...@@ -17,7 +17,7 @@ import radio from '@ohos.telephony.radio'
getRadioTech\(slotId: number, callback: AsyncCallback<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\>\): void getRadioTech\(slotId: number, callback: AsyncCallback<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\>\): void
获取当前接入的CS域和PS域无线接入技术,使用callback方式作为异步方法 获取当前接入的CS域和PS域无线接入技术。使用callback异步回调
**需要权限**:ohos.permission.GET_NETWORK_INFO **需要权限**:ohos.permission.GET_NETWORK_INFO
...@@ -44,7 +44,7 @@ radio.getRadioTech(slotId, (err, data) =>{ ...@@ -44,7 +44,7 @@ radio.getRadioTech(slotId, (err, data) =>{
getRadioTech\(slotId: number\): Promise<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\> getRadioTech\(slotId: number\): Promise<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\>
获取当前接入的CS域和PS域无线接入技术,使用Promise方式作为异步方法 获取当前接入的CS域和PS域无线接入技术。使用Promise异步回调
**需要权限**:ohos.permission.GET_NETWORK_INFO **需要权限**:ohos.permission.GET_NETWORK_INFO
...@@ -70,7 +70,7 @@ let promise = radio.getRadioTech(slotId); ...@@ -70,7 +70,7 @@ let promise = radio.getRadioTech(slotId);
promise.then(data => { promise.then(data => {
console.log(`getRadioTech success, data->${JSON.stringify(data)}`); console.log(`getRadioTech success, data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`getRadioTech fail, err->${JSON.stringify(err)}`); console.log(`getRadioTech failed, err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -79,7 +79,7 @@ promise.then(data => { ...@@ -79,7 +79,7 @@ promise.then(data => {
getNetworkState\(callback: AsyncCallback<NetworkState\>\): void getNetworkState\(callback: AsyncCallback<NetworkState\>\): void
获取网络状态,使用callback方式作为异步方法 获取网络状态。使用callback异步回调
**需要权限**:ohos.permission.GET_NETWORK_INFO **需要权限**:ohos.permission.GET_NETWORK_INFO
...@@ -104,7 +104,7 @@ radio.getNetworkState((err, data) =>{ ...@@ -104,7 +104,7 @@ radio.getNetworkState((err, data) =>{
getNetworkState\(slotId: number, callback: AsyncCallback<NetworkState\>\): void getNetworkState\(slotId: number, callback: AsyncCallback<NetworkState\>\): void
获取网络状态,使用callback方式作为异步方法 获取网络状态。使用callback异步回调
**需要权限**:ohos.permission.GET_NETWORK_INFO **需要权限**:ohos.permission.GET_NETWORK_INFO
...@@ -131,7 +131,7 @@ radio.getNetworkState(slotId, (err, data) => { ...@@ -131,7 +131,7 @@ radio.getNetworkState(slotId, (err, data) => {
getNetworkState\(slotId?: number\): Promise<NetworkState\> getNetworkState\(slotId?: number\): Promise<NetworkState\>
获取网络状态,使用Promise方式作为异步方法 获取网络状态。使用Promise异步回调
**需要权限**:ohos.permission.GET_NETWORK_INFO **需要权限**:ohos.permission.GET_NETWORK_INFO
...@@ -157,7 +157,7 @@ let promise = radio.getNetworkState(slotId); ...@@ -157,7 +157,7 @@ let promise = radio.getNetworkState(slotId);
promise.then(data => { promise.then(data => {
console.log(`getNetworkState success, promise: data->${JSON.stringify(data)}`); console.log(`getNetworkState success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`getNetworkState fail, promise: err->${JSON.stringify(err)}`); console.log(`getNetworkState failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -166,7 +166,7 @@ promise.then(data => { ...@@ -166,7 +166,7 @@ promise.then(data => {
getNetworkSelectionMode\(slotId: number, callback: AsyncCallback<NetworkSelectionMode\>\): void getNetworkSelectionMode\(slotId: number, callback: AsyncCallback<NetworkSelectionMode\>\): void
获取当前选网模式,使用callback方式作为异步方法 获取当前选网模式。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -191,7 +191,7 @@ radio.getNetworkSelectionMode(slotId, (err, data) => { ...@@ -191,7 +191,7 @@ radio.getNetworkSelectionMode(slotId, (err, data) => {
getNetworkSelectionMode\(slotId: number\): Promise<NetworkSelectionMode\> getNetworkSelectionMode\(slotId: number\): Promise<NetworkSelectionMode\>
获取当前选网模式,使用Promise方式作为异步方法 获取当前选网模式。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -215,7 +215,7 @@ let promise = radio.getNetworkSelectionMode(slotId); ...@@ -215,7 +215,7 @@ let promise = radio.getNetworkSelectionMode(slotId);
promise.then(data => { promise.then(data => {
console.log(`getNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`); console.log(`getNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`getNetworkSelectionMode fail, promise: err->${JSON.stringify(err)}`); console.log(`getNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -224,7 +224,7 @@ promise.then(data => { ...@@ -224,7 +224,7 @@ promise.then(data => {
getISOCountryCodeForNetwork\(slotId: number, callback: AsyncCallback<string\>\): void getISOCountryCodeForNetwork\(slotId: number, callback: AsyncCallback<string\>\): void
获取注册网络所在国家的ISO国家码,使用callback方式作为异步方法 获取注册网络所在国家的ISO国家码。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -249,7 +249,7 @@ radio.getISOCountryCodeForNetwork(slotId, (err, data) => { ...@@ -249,7 +249,7 @@ radio.getISOCountryCodeForNetwork(slotId, (err, data) => {
getISOCountryCodeForNetwork\(slotId: number\): Promise<string\> getISOCountryCodeForNetwork\(slotId: number\): Promise<string\>
获取注册网络所在国家的ISO国家码,使用Promise方式作为异步方法 获取注册网络所在国家的ISO国家码。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -273,7 +273,7 @@ let promise = radio.getISOCountryCodeForNetwork(slotId); ...@@ -273,7 +273,7 @@ let promise = radio.getISOCountryCodeForNetwork(slotId);
promise.then(data => { promise.then(data => {
console.log(`getISOCountryCodeForNetwork success, promise: data->${JSON.stringify(data)}`); console.log(`getISOCountryCodeForNetwork success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`getISOCountryCodeForNetwork fail, promise: err->${JSON.stringify(err)}`); console.log(`getISOCountryCodeForNetwork failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -282,7 +282,7 @@ promise.then(data => { ...@@ -282,7 +282,7 @@ promise.then(data => {
getPrimarySlotId\(callback: AsyncCallback\<number\>\): void getPrimarySlotId\(callback: AsyncCallback\<number\>\): void
获取主卡所在卡槽的索引号,使用callback方式作为异步方法 获取主卡所在卡槽的索引号。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -305,7 +305,7 @@ radio.getPrimarySlotId((err, data) => { ...@@ -305,7 +305,7 @@ radio.getPrimarySlotId((err, data) => {
getPrimarySlotId\(\): Promise\<number\> getPrimarySlotId\(\): Promise\<number\>
获取主卡所在卡槽的索引号,使用Promise方式作为异步方法 获取主卡所在卡槽的索引号。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -322,7 +322,7 @@ let promise = radio.getPrimarySlotId(); ...@@ -322,7 +322,7 @@ let promise = radio.getPrimarySlotId();
promise.then(data => { promise.then(data => {
console.log(`getPrimarySlotId success, promise: data->${JSON.stringify(data)}`); console.log(`getPrimarySlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getPrimarySlotId fail, promise: err->${JSON.stringify(err)}`); console.error(`getPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -331,7 +331,7 @@ promise.then(data => { ...@@ -331,7 +331,7 @@ promise.then(data => {
getSignalInformation\(slotId: number, callback: AsyncCallback<Array<SignalInformation\>\>\): void getSignalInformation\(slotId: number, callback: AsyncCallback<Array<SignalInformation\>\>\): void
获取指定SIM卡槽对应的注册网络信号强度信息列表,使用callback方式作为异步方法 获取指定SIM卡槽对应的注册网络信号强度信息列表。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -356,7 +356,7 @@ radio.getSignalInformation(slotId, (err, data) => { ...@@ -356,7 +356,7 @@ radio.getSignalInformation(slotId, (err, data) => {
getSignalInformation\(slotId: number\): Promise<Array<SignalInformation\>\> getSignalInformation\(slotId: number\): Promise<Array<SignalInformation\>\>
获取指定SIM卡槽对应的注册网络信号强度信息列表,使用Promise方式作为异步方法 获取指定SIM卡槽对应的注册网络信号强度信息列表。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -380,7 +380,7 @@ let promise = radio.getSignalInformation(slotId); ...@@ -380,7 +380,7 @@ let promise = radio.getSignalInformation(slotId);
promise.then(data => { promise.then(data => {
console.log(`getSignalInformation success, promise: data->${JSON.stringify(data)}`); console.log(`getSignalInformation success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getSignalInformation fail, promise: err->${JSON.stringify(err)}`); console.error(`getSignalInformation failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -418,7 +418,7 @@ console.log("Result: "+ result); ...@@ -418,7 +418,7 @@ console.log("Result: "+ result);
isRadioOn\(callback: AsyncCallback<boolean\>\): void isRadioOn\(callback: AsyncCallback<boolean\>\): void
判断主卡的Radio是否打开,使用callback方式作为异步方法 判断主卡的Radio是否打开。使用callback异步回调
**需要权限**:ohos.permission.GET_NETWORK_INFO **需要权限**:ohos.permission.GET_NETWORK_INFO
...@@ -443,7 +443,7 @@ radio.isRadioOn((err, data) => { ...@@ -443,7 +443,7 @@ radio.isRadioOn((err, data) => {
isRadioOn\(slotId: number, callback: AsyncCallback<boolean\>\): void isRadioOn\(slotId: number, callback: AsyncCallback<boolean\>\): void
判断指定卡槽位的Radio是否打开,使用callback方式作为异步方法 判断指定卡槽位的Radio是否打开。使用callback异步回调
**需要权限**:ohos.permission.GET_NETWORK_INFO **需要权限**:ohos.permission.GET_NETWORK_INFO
...@@ -470,7 +470,7 @@ radio.isRadioOn(slotId, (err, data) => { ...@@ -470,7 +470,7 @@ radio.isRadioOn(slotId, (err, data) => {
isRadioOn\(slotId?: number\): Promise<boolean\> isRadioOn\(slotId?: number\): Promise<boolean\>
判断Radio是否打开,使用Promise方式作为异步方法 判断Radio是否打开。使用Promise异步回调
**需要权限**:ohos.permission.GET_NETWORK_INFO **需要权限**:ohos.permission.GET_NETWORK_INFO
...@@ -496,7 +496,7 @@ let promise = radio.isRadioOn(slotId); ...@@ -496,7 +496,7 @@ let promise = radio.isRadioOn(slotId);
promise.then(data => { promise.then(data => {
console.log(`isRadioOn success, promise: data->${JSON.stringify(data)}`); console.log(`isRadioOn success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`isRadioOn fail, promise: err->${JSON.stringify(err)}`); console.error(`isRadioOn failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -505,7 +505,7 @@ promise.then(data => { ...@@ -505,7 +505,7 @@ promise.then(data => {
getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void
获取运营商名称,使用callback方式作为异步方法 获取运营商名称。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -514,7 +514,7 @@ getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void ...@@ -514,7 +514,7 @@ getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ------------------------------------------ | | -------- | ----------------------- | ---- | ------------------------------------------ |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| callback | AsyncCallback\<string\> | 是 | 回调函数返回运营商名称,例如:中国移动。 | | callback | AsyncCallback\<string\> | 是 | 回调函数返回运营商名称,例如:中国移动。 |
**示例:** **示例:**
...@@ -530,7 +530,7 @@ radio.getOperatorName(slotId, (err, data) => { ...@@ -530,7 +530,7 @@ radio.getOperatorName(slotId, (err, data) => {
getOperatorName\(slotId: number\): Promise<string\> getOperatorName\(slotId: number\): Promise<string\>
获取运营商名称,使用Promise方式作为异步方法 获取运营商名称。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -554,7 +554,7 @@ let promise = radio.getOperatorName(slotId); ...@@ -554,7 +554,7 @@ let promise = radio.getOperatorName(slotId);
promise.then(data => { promise.then(data => {
console.log(`getOperatorName success, promise: data->${JSON.stringify(data)}`); console.log(`getOperatorName success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`getOperatorName fail, promise: err->${JSON.stringify(err)}`); console.log(`getOperatorName failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -562,7 +562,7 @@ promise.then(data => { ...@@ -562,7 +562,7 @@ promise.then(data => {
setPrimarySlotId(slotId: number, callback: AsyncCallback<void\>): void setPrimarySlotId(slotId: number, callback: AsyncCallback<void\>): void
设置主卡所在卡槽的索引号,使用callback方式作为异步方法 设置主卡所在卡槽的索引号。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -591,7 +591,7 @@ radio.setPrimarySlotId(slotId, (err, data) => { ...@@ -591,7 +591,7 @@ radio.setPrimarySlotId(slotId, (err, data) => {
setPrimarySlotId\(slotId: number\): Promise\<void\> setPrimarySlotId\(slotId: number\): Promise\<void\>
设置主卡所在卡槽的索引号,使用Promise方式作为异步方法 设置主卡所在卡槽的索引号。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -619,7 +619,7 @@ let promise = radio.setPrimarySlotId(slotId); ...@@ -619,7 +619,7 @@ let promise = radio.setPrimarySlotId(slotId);
promise.then(data => { promise.then(data => {
console.log(`setPrimarySlotId success, promise: data->${JSON.stringify(data)}`); console.log(`setPrimarySlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`setPrimarySlotId fail, promise: err->${JSON.stringify(err)}`); console.log(`setPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -627,7 +627,7 @@ promise.then(data => { ...@@ -627,7 +627,7 @@ promise.then(data => {
getIMEI(callback: AsyncCallback<string\>): void getIMEI(callback: AsyncCallback<string\>): void
获取设备的指定卡槽的IMEI,使用callback方式作为异步方法 获取设备的指定卡槽的IMEI。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -654,7 +654,7 @@ radio.getIMEI((err, data) => { ...@@ -654,7 +654,7 @@ radio.getIMEI((err, data) => {
getIMEI(slotId: number, callback: AsyncCallback<string\>): void getIMEI(slotId: number, callback: AsyncCallback<string\>): void
获取设备的指定卡槽的IMEI,使用callback方式作为异步方法 获取设备的指定卡槽的IMEI。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -683,7 +683,7 @@ radio.getIMEI(slotId, (err, data) => { ...@@ -683,7 +683,7 @@ radio.getIMEI(slotId, (err, data) => {
getIMEI(slotId?: number): Promise<string\> getIMEI(slotId?: number): Promise<string\>
获取设备的指定卡槽的IMEI,使用Promise方式作为异步方法 获取设备的指定卡槽的IMEI。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -711,7 +711,7 @@ let promise = radio.getIMEI(slotId); ...@@ -711,7 +711,7 @@ let promise = radio.getIMEI(slotId);
promise.then(data => { promise.then(data => {
console.log(`getIMEI success, promise: data->${JSON.stringify(data)}`); console.log(`getIMEI success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getIMEI fail, promise: err->${JSON.stringify(err)}`); console.error(`getIMEI failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -719,7 +719,7 @@ promise.then(data => { ...@@ -719,7 +719,7 @@ promise.then(data => {
getMEID(callback: AsyncCallback<string\>): void getMEID(callback: AsyncCallback<string\>): void
获取设备的指定卡槽的MEID,使用callback方式作为异步方法 获取设备的指定卡槽的MEID。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -746,7 +746,7 @@ radio.getMEID((err, data) => { ...@@ -746,7 +746,7 @@ radio.getMEID((err, data) => {
getMEID(slotId: number, callback: AsyncCallback<string\>): void getMEID(slotId: number, callback: AsyncCallback<string\>): void
获取设备的指定卡槽的MEID,使用callback方式作为异步方法 获取设备的指定卡槽的MEID。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -775,7 +775,7 @@ radio.getMEID(slotId, (err, data) => { ...@@ -775,7 +775,7 @@ radio.getMEID(slotId, (err, data) => {
getMEID(slotId?: number): Promise<string\> getMEID(slotId?: number): Promise<string\>
获取设备的指定卡槽的MEID,使用Promise方式作为异步方法 获取设备的指定卡槽的MEID。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -803,7 +803,7 @@ let promise = radio.getMEID(slotId); ...@@ -803,7 +803,7 @@ let promise = radio.getMEID(slotId);
promise.then(data => { promise.then(data => {
console.log(`getMEID success, promise: data->${JSON.stringify(data)}`); console.log(`getMEID success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getMEID fail, promise: err->${JSON.stringify(err)}`); console.error(`getMEID failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -811,7 +811,7 @@ promise.then(data => { ...@@ -811,7 +811,7 @@ promise.then(data => {
getUniqueDeviceId(callback: AsyncCallback<string\>): void getUniqueDeviceId(callback: AsyncCallback<string\>): void
获取设备的指定卡槽的唯一设备ID,使用callback方式作为异步方法 获取设备的指定卡槽的唯一设备ID。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -838,7 +838,7 @@ radio.getUniqueDeviceId((err, data) => { ...@@ -838,7 +838,7 @@ radio.getUniqueDeviceId((err, data) => {
getUniqueDeviceId(slotId: number, callback: AsyncCallback<string\>): void getUniqueDeviceId(slotId: number, callback: AsyncCallback<string\>): void
获取设备的指定卡槽的唯一设备ID,使用callback方式作为异步方法 获取设备的指定卡槽的唯一设备ID。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -867,7 +867,7 @@ radio.getUniqueDeviceId(slotId, (err, data) => { ...@@ -867,7 +867,7 @@ radio.getUniqueDeviceId(slotId, (err, data) => {
getUniqueDeviceId(slotId?: number): Promise<string\> getUniqueDeviceId(slotId?: number): Promise<string\>
获取设备的指定卡槽的唯一设备ID,使用Promise方式作为异步方法 获取设备的指定卡槽的唯一设备ID。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -895,7 +895,7 @@ let promise = radio.getUniqueDeviceId(slotId); ...@@ -895,7 +895,7 @@ let promise = radio.getUniqueDeviceId(slotId);
promise.then(data => { promise.then(data => {
console.log(`getUniqueDeviceId success, promise: data->${JSON.stringify(data)}`); console.log(`getUniqueDeviceId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getUniqueDeviceId fail, promise: err->${JSON.stringify(err)}`); console.error(`getUniqueDeviceId failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -903,7 +903,7 @@ promise.then(data => { ...@@ -903,7 +903,7 @@ promise.then(data => {
sendUpdateCellLocationRequest\(callback: AsyncCallback<void\>\): void sendUpdateCellLocationRequest\(callback: AsyncCallback<void\>\): void
发送更新小区位置请求,使用callback方式作为异步方法 发送更新小区位置请求。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -927,7 +927,7 @@ radio.sendUpdateCellLocationRequest((err, data) => { ...@@ -927,7 +927,7 @@ radio.sendUpdateCellLocationRequest((err, data) => {
sendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback<void\>\): void sendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback<void\>\): void
发送更新小区位置请求,使用callback方式作为异步方法 发送更新小区位置请求。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -953,7 +953,7 @@ radio.sendUpdateCellLocationRequest(slotId, (err, data) => { ...@@ -953,7 +953,7 @@ radio.sendUpdateCellLocationRequest(slotId, (err, data) => {
sendUpdateCellLocationRequest\(slotId?: number): Promise<void\> sendUpdateCellLocationRequest\(slotId?: number): Promise<void\>
发送更新小区位置请求,使用Promise方式作为异步方法 发送更新小区位置请求。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -979,7 +979,7 @@ let promise = radio.sendUpdateCellLocationRequest(slotId); ...@@ -979,7 +979,7 @@ let promise = radio.sendUpdateCellLocationRequest(slotId);
promise.then(data => { promise.then(data => {
console.log(`sendUpdateCellLocationRequest success, promise: data->${JSON.stringify(data)}`); console.log(`sendUpdateCellLocationRequest success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`sendUpdateCellLocationRequest fail, promise: err->${JSON.stringify(err)}`); console.log(`sendUpdateCellLocationRequest failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -987,7 +987,7 @@ promise.then(data => { ...@@ -987,7 +987,7 @@ promise.then(data => {
getCellInformation(callback: AsyncCallback<Array<CellInformation\>>): void getCellInformation(callback: AsyncCallback<Array<CellInformation\>>): void
获取小区信息,使用callback方式作为异步方法 获取小区信息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -999,7 +999,7 @@ getCellInformation(callback: AsyncCallback<Array<CellInformation\>>): void ...@@ -999,7 +999,7 @@ getCellInformation(callback: AsyncCallback<Array<CellInformation\>>): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------ |
| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | 是 | 回调函数,返回小区信息。 | | callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | 是 | 回调函数。 |
**示例:** **示例:**
...@@ -1014,7 +1014,7 @@ radio.getCellInformation((err, data) => { ...@@ -1014,7 +1014,7 @@ radio.getCellInformation((err, data) => {
getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation\>\>): void getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation\>\>): void
获取小区信息,使用callback方式作为异步方法 获取小区信息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1027,7 +1027,7 @@ getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation ...@@ -1027,7 +1027,7 @@ getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | | -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | 是 | 回调函数,返回小区信息。 | | callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | 是 | 回调函数。 |
**示例:** **示例:**
...@@ -1043,7 +1043,7 @@ radio.getCellInformation(slotId, (err, data) => { ...@@ -1043,7 +1043,7 @@ radio.getCellInformation(slotId, (err, data) => {
getCellInformation(slotId?: number): Promise<Array<CellInformation\>\> getCellInformation(slotId?: number): Promise<Array<CellInformation\>\>
获取小区信息,使用Promise方式作为异步方法 获取小区信息。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1071,7 +1071,7 @@ let promise = radio.getCellInformation(slotId); ...@@ -1071,7 +1071,7 @@ let promise = radio.getCellInformation(slotId);
promise.then(data => { promise.then(data => {
console.log(`getCellInformation success, promise: data->${JSON.stringify(data)}`); console.log(`getCellInformation success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getCellInformation fail, promise: err->${JSON.stringify(err)}`); console.error(`getCellInformation failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1079,7 +1079,7 @@ promise.then(data => { ...@@ -1079,7 +1079,7 @@ promise.then(data => {
setNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCallback<void\>\): void setNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCallback<void\>\): void
设置网络选择模式,使用callback方式作为异步方法 设置网络选择模式。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1118,7 +1118,7 @@ radio.setNetworkSelectionMode(networkSelectionModeOptions, (err, data) => { ...@@ -1118,7 +1118,7 @@ radio.setNetworkSelectionMode(networkSelectionModeOptions, (err, data) => {
setNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise<void\> setNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise<void\>
设置网络选择模式,使用Promise方式作为异步方法 设置网络选择模式。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1157,7 +1157,7 @@ let promise = radio.setNetworkSelectionMode(networkSelectionModeOptions); ...@@ -1157,7 +1157,7 @@ let promise = radio.setNetworkSelectionMode(networkSelectionModeOptions);
promise.then(data => { promise.then(data => {
console.log(`setNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`); console.log(`setNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`setNetworkSelectionMode fail, promise: err->${JSON.stringify(err)}`); console.log(`setNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1165,7 +1165,7 @@ promise.then(data => { ...@@ -1165,7 +1165,7 @@ promise.then(data => {
getNetworkSearchInformation\(slotId: number, callback: AsyncCallback<NetworkSearchResult\>\): void getNetworkSearchInformation\(slotId: number, callback: AsyncCallback<NetworkSearchResult\>\): void
获取网络搜索信息,使用callback方式作为异步方法 获取网络搜索信息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1178,7 +1178,7 @@ getNetworkSearchInformation\(slotId: number, callback: AsyncCallback<NetworkSear ...@@ -1178,7 +1178,7 @@ getNetworkSearchInformation\(slotId: number, callback: AsyncCallback<NetworkSear
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | | -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| callback | AsyncCallback\<[NetworkSearchResult](#networksearchresult)\> | 是 | 回调函数。返回网络搜索信息。 | | callback | AsyncCallback\<[NetworkSearchResult](#networksearchresult)\> | 是 | 回调函数。 |
**示例:** **示例:**
...@@ -1192,7 +1192,7 @@ radio.getNetworkSearchInformation(0, (err, data) => { ...@@ -1192,7 +1192,7 @@ radio.getNetworkSearchInformation(0, (err, data) => {
getNetworkSearchInformation\(slotId: number\): Promise<void\> getNetworkSearchInformation\(slotId: number\): Promise<void\>
获取网络搜索信息,使用Promise方式作为异步方法 获取网络搜索信息。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1219,7 +1219,7 @@ let promise = radio.getNetworkSearchInformation(0); ...@@ -1219,7 +1219,7 @@ let promise = radio.getNetworkSearchInformation(0);
promise.then(data => { promise.then(data => {
console.log(`getNetworkSearchInformation success, promise: data->${JSON.stringify(data)}`); console.log(`getNetworkSearchInformation success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`getNetworkSearchInformation fail, promise: err->${JSON.stringify(err)}`); console.log(`getNetworkSearchInformation failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1227,7 +1227,7 @@ promise.then(data => { ...@@ -1227,7 +1227,7 @@ promise.then(data => {
getNrOptionMode(callback: AsyncCallback<NrOptionMode\>): void getNrOptionMode(callback: AsyncCallback<NrOptionMode\>): void
获取Nr选项模式 ,使用callback方式作为异步方法 获取Nr选项模式 。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1252,7 +1252,7 @@ radio.getNrOptionMode((err, data) => { ...@@ -1252,7 +1252,7 @@ radio.getNrOptionMode((err, data) => {
getNrOptionMode(slotId: number, callback: AsyncCallback<NrOptionMode\>): void getNrOptionMode(slotId: number, callback: AsyncCallback<NrOptionMode\>): void
获取Nr选项模式 ,使用callback方式作为异步方法 获取Nr选项模式 。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1279,7 +1279,7 @@ radio.getNrOptionMode(slotId, (err, data) => { ...@@ -1279,7 +1279,7 @@ radio.getNrOptionMode(slotId, (err, data) => {
getNrOptionMode(slotId?: number): Promise<NrOptionMode\> getNrOptionMode(slotId?: number): Promise<NrOptionMode\>
获取Nr选项模式 ,使用Promise方式作为异步方法 获取Nr选项模式 。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1305,7 +1305,7 @@ let promise = radio.getNrOptionMode(slotId); ...@@ -1305,7 +1305,7 @@ let promise = radio.getNrOptionMode(slotId);
promise.then(data => { promise.then(data => {
console.log(`getNrOptionMode success, promise: data->${JSON.stringify(data)}`); console.log(`getNrOptionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getNrOptionMode fail, promise: err->${JSON.stringify(err)}`); console.error(`getNrOptionMode failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1313,7 +1313,7 @@ promise.then(data => { ...@@ -1313,7 +1313,7 @@ promise.then(data => {
turnOnRadio(callback: AsyncCallback<void\>): void turnOnRadio(callback: AsyncCallback<void\>): void
打开Radio,使用callback方式作为异步方法 打开Radio。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1340,7 +1340,7 @@ radio.turnOnRadio((err, data) => { ...@@ -1340,7 +1340,7 @@ radio.turnOnRadio((err, data) => {
turnOnRadio(slotId: number, callback: AsyncCallback<void\>): void turnOnRadio(slotId: number, callback: AsyncCallback<void\>): void
打开Radio,使用callback方式作为异步方法 打开Radio。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1369,7 +1369,7 @@ radio.turnOnRadio(slotId, (err, data) => { ...@@ -1369,7 +1369,7 @@ radio.turnOnRadio(slotId, (err, data) => {
turnOnRadio(slotId?: number): Promise<void\> turnOnRadio(slotId?: number): Promise<void\>
打开Radio,使用Promise方式作为异步方法 打开Radio。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1397,7 +1397,7 @@ let promise = radio.turnOnRadio(slotId); ...@@ -1397,7 +1397,7 @@ let promise = radio.turnOnRadio(slotId);
promise.then(data => { promise.then(data => {
console.log(`turnOnRadio success, promise: data->${JSON.stringify(data)}`); console.log(`turnOnRadio success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`turnOnRadio fail, promise: err->${JSON.stringify(err)}`); console.error(`turnOnRadio failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1405,7 +1405,7 @@ promise.then(data => { ...@@ -1405,7 +1405,7 @@ promise.then(data => {
turnOffRadio(callback: AsyncCallback<void\>): void turnOffRadio(callback: AsyncCallback<void\>): void
关闭Radio,使用callback方式作为异步方法 关闭Radio。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1432,7 +1432,7 @@ radio.turnOffRadio((err, data) => { ...@@ -1432,7 +1432,7 @@ radio.turnOffRadio((err, data) => {
turnOffRadio(slotId: number, callback: AsyncCallback<void\>): void turnOffRadio(slotId: number, callback: AsyncCallback<void\>): void
关闭Radio,使用callback方式作为异步方法 关闭Radio。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1461,7 +1461,7 @@ radio.turnOffRadio(slotId, (err, data) => { ...@@ -1461,7 +1461,7 @@ radio.turnOffRadio(slotId, (err, data) => {
turnOffRadio(slotId?: number): Promise<void\> turnOffRadio(slotId?: number): Promise<void\>
关闭Radio,使用Promise方式作为异步方法 关闭Radio。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1489,7 +1489,7 @@ let promise = radio.turnOffRadio(slotId); ...@@ -1489,7 +1489,7 @@ let promise = radio.turnOffRadio(slotId);
promise.then(data => { promise.then(data => {
console.log(`turnOffRadio success, promise: data->${JSON.stringify(data)}`); console.log(`turnOffRadio success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`turnOffRadio fail, promise: err->${JSON.stringify(err)}`); console.error(`turnOffRadio failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1497,7 +1497,7 @@ promise.then(data => { ...@@ -1497,7 +1497,7 @@ promise.then(data => {
setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback: AsyncCallback<void\>\): void setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback: AsyncCallback<void\>\): void
设置首选网络,使用callback方式作为异步方法 设置首选网络。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1510,7 +1510,7 @@ setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback ...@@ -1510,7 +1510,7 @@ setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ----------- | ---------------------------------------------- | ---- | -------------------------------------- | | ----------- | ---------------------------------------------- | ---- | -------------------------------------- |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | 是 | 设置首选网络模式 | | networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | 是 | 设置首选网络模式 |
| callback | AsyncCallback\<void\> | 是 | 回调函数。 | | callback | AsyncCallback\<void\> | 是 | 回调函数。 |
**示例:** **示例:**
...@@ -1525,7 +1525,7 @@ radio.setPreferredNetwork(0, 1, (err, data) => { ...@@ -1525,7 +1525,7 @@ radio.setPreferredNetwork(0, 1, (err, data) => {
setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<void\> setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<void\>
设置首选网络,使用Promise方式作为异步方法 设置首选网络。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1538,7 +1538,7 @@ setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise< ...@@ -1538,7 +1538,7 @@ setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ----------- | ---------------------------------------------- | ---- | -------------------------------------- | | ----------- | ---------------------------------------------- | ---- | -------------------------------------- |
| slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | 卡槽ID。<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | 是 | 设置首选网络模式 | | networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | 是 | 设置首选网络模式 |
**返回值:** **返回值:**
...@@ -1553,7 +1553,7 @@ let promise = radio.setPreferredNetwork(0, 1); ...@@ -1553,7 +1553,7 @@ let promise = radio.setPreferredNetwork(0, 1);
promise.then(data => { promise.then(data => {
console.log(`setPreferredNetwork success, promise: data->${JSON.stringify(data)}`); console.log(`setPreferredNetwork success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`setPreferredNetwork fail, promise: err->${JSON.stringify(err)}`); console.log(`setPreferredNetwork failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1561,7 +1561,7 @@ promise.then(data => { ...@@ -1561,7 +1561,7 @@ promise.then(data => {
getPreferredNetwork\(slotId: number, callback: AsyncCallback<PreferredNetworkMode\>\): void getPreferredNetwork\(slotId: number, callback: AsyncCallback<PreferredNetworkMode\>\): void
获取首选网络,使用callback方式作为异步方法 获取首选网络。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1588,7 +1588,7 @@ radio.getPreferredNetwork(0, (err, data) => { ...@@ -1588,7 +1588,7 @@ radio.getPreferredNetwork(0, (err, data) => {
getPreferredNetwork(slotId: number): Promise<void\> getPreferredNetwork(slotId: number): Promise<void\>
获取首选网络,使用Promise方式作为异步方法 获取首选网络。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1615,7 +1615,7 @@ let promise = radio.getPreferredNetwork(0); ...@@ -1615,7 +1615,7 @@ let promise = radio.getPreferredNetwork(0);
promise.then(data => { promise.then(data => {
console.log(`getPreferredNetwork success, promise: data->${JSON.stringify(data)}`); console.log(`getPreferredNetwork success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`getPreferredNetwork fail, promise: err->${JSON.stringify(err)}`); console.log(`getPreferredNetwork failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1623,7 +1623,7 @@ promise.then(data => { ...@@ -1623,7 +1623,7 @@ promise.then(data => {
getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<ImsRegInfo\>): void getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<ImsRegInfo\>): void
获取特定IMS服务类型的IMS注册状态信息,使用callback方式作为异步方法 获取特定IMS服务类型的IMS注册状态信息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1651,7 +1651,7 @@ radio.getImsRegInfo(0, 1, (err, data) => { ...@@ -1651,7 +1651,7 @@ radio.getImsRegInfo(0, 1, (err, data) => {
getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo\> getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo\>
获取特定IMS服务类型的IMS注册状态信息,使用Promise方式作为异步方法 获取特定IMS服务类型的IMS注册状态信息。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1679,7 +1679,7 @@ let promise = radio.getImsRegInfo(0, 1); ...@@ -1679,7 +1679,7 @@ let promise = radio.getImsRegInfo(0, 1);
promise.then(data => { promise.then(data => {
console.log(`getImsRegInfo success, promise: data->${JSON.stringify(data)}`); console.log(`getImsRegInfo success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.log(`getImsRegInfo fail, promise: err->${JSON.stringify(err)}`); console.log(`getImsRegInfo failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1756,7 +1756,7 @@ radio.off('imsRegStateChange', 0, 1, (err, data) => { ...@@ -1756,7 +1756,7 @@ radio.off('imsRegStateChange', 0, 1, (err, data) => {
| RADIO_TECHNOLOGY_HSPA | 4 | 无线接入技术HSPA(High Speed Packet Access)。 | | RADIO_TECHNOLOGY_HSPA | 4 | 无线接入技术HSPA(High Speed Packet Access)。 |
| RADIO_TECHNOLOGY_HSPAP | 5 | 无线接入技术HSPAP(High Speed packet access (HSPA+) )。 | | RADIO_TECHNOLOGY_HSPAP | 5 | 无线接入技术HSPAP(High Speed packet access (HSPA+) )。 |
| RADIO_TECHNOLOGY_TD_SCDMA | 6 | 无线接入技术TDSCDMA(TimeDivision-Synchronous Code Division Multiple Access)。 | | RADIO_TECHNOLOGY_TD_SCDMA | 6 | 无线接入技术TDSCDMA(TimeDivision-Synchronous Code Division Multiple Access)。 |
| RADIO_TECHNOLOGY_EVDO | 7 | 无线接入技术EVDO(EvolutionData Only)。 | | RADIO_TECHNOLOGY_EVDO | 7 | 无线接入技术EVDO(Evolution Data Only)。 |
| RADIO_TECHNOLOGY_EHRPD | 8 | 无线接入技术EHRPD(Evolved High Rate Package Data)。 | | RADIO_TECHNOLOGY_EHRPD | 8 | 无线接入技术EHRPD(Evolved High Rate Package Data)。 |
| RADIO_TECHNOLOGY_LTE | 9 | 无线接入技术LTE(Long Term Evolution)。 | | RADIO_TECHNOLOGY_LTE | 9 | 无线接入技术LTE(Long Term Evolution)。 |
| RADIO_TECHNOLOGY_LTE_CA | 10 | 无线接入技术LTE_CA(Long Term Evolution_Carrier Aggregation)。 | | RADIO_TECHNOLOGY_LTE_CA | 10 | 无线接入技术LTE_CA(Long Term Evolution_Carrier Aggregation)。 |
...@@ -1916,7 +1916,7 @@ radio.off('imsRegStateChange', 0, 1, (err, data) => { ...@@ -1916,7 +1916,7 @@ radio.off('imsRegStateChange', 0, 1, (err, data) => {
## CdmaCellInformation<sup>8+</sup> ## CdmaCellInformation<sup>8+</sup>
Cdma小区信息。 CDMA小区信息。
此接口为系统接口。 此接口为系统接口。
...@@ -1932,7 +1932,7 @@ Cdma小区信息。 ...@@ -1932,7 +1932,7 @@ Cdma小区信息。
## GsmCellInformation<sup>8+</sup> ## GsmCellInformation<sup>8+</sup>
Gsm小区信息。 GSM小区信息。
此接口为系统接口。 此接口为系统接口。
...@@ -1949,7 +1949,7 @@ Gsm小区信息。 ...@@ -1949,7 +1949,7 @@ Gsm小区信息。
## LteCellInformation<sup>8+</sup> ## LteCellInformation<sup>8+</sup>
Lte小区信息。 LTE小区信息。
此接口为系统接口。 此接口为系统接口。
...@@ -1968,7 +1968,7 @@ Lte小区信息。 ...@@ -1968,7 +1968,7 @@ Lte小区信息。
## NrCellInformation<sup>8+</sup> ## NrCellInformation<sup>8+</sup>
Nr小区信息。 NR小区信息。
此接口为系统接口。 此接口为系统接口。
...@@ -1985,7 +1985,7 @@ Nr小区信息。 ...@@ -1985,7 +1985,7 @@ Nr小区信息。
## TdscdmaCellInformation<sup>8+</sup> ## TdscdmaCellInformation<sup>8+</sup>
Tdscdma小区信息。 TD-SCDMA小区信息。
此接口为系统接口。 此接口为系统接口。
...@@ -2002,7 +2002,7 @@ Tdscdma小区信息。 ...@@ -2002,7 +2002,7 @@ Tdscdma小区信息。
## WcdmaCellInformation<sup>8+</sup> ## WcdmaCellInformation<sup>8+</sup>
Wcdma小区信息。 WCDMA小区信息。
此接口为系统接口。 此接口为系统接口。
...@@ -2019,7 +2019,7 @@ Wcdma小区信息。 ...@@ -2019,7 +2019,7 @@ Wcdma小区信息。
## NrOptionMode<sup>8+</sup> ## NrOptionMode<sup>8+</sup>
Nr的选择模式。 NR的选择模式。
此接口为系统接口。 此接口为系统接口。
...@@ -2027,10 +2027,10 @@ Nr的选择模式。 ...@@ -2027,10 +2027,10 @@ Nr的选择模式。
| 名称 | 值 | 说明 | | 名称 | 值 | 说明 |
| -------------------- | ---- | ---------------------------------- | | -------------------- | ---- | ---------------------------------- |
| NR_OPTION_UNKNOWN | 0 | 未知的Nr选择模式。 | | NR_OPTION_UNKNOWN | 0 | 未知的NR选择模式。 |
| NR_OPTION_NSA_ONLY | 1 | 仅非独立组网的Nr选择模式。 | | NR_OPTION_NSA_ONLY | 1 | 仅非独立组网的NR选择模式。 |
| NR_OPTION_SA_ONLY | 2 | 仅独立组网的Nr选择模式。 | | NR_OPTION_SA_ONLY | 2 | 仅独立组网的NR选择模式。 |
| NR_OPTION_NSA_AND_SA | 3 | 非独立组网和独立组网的Nr选择模式。 | | NR_OPTION_NSA_AND_SA | 3 | 非独立组网和独立组网的NR选择模式。 |
## NetworkSearchResult ## NetworkSearchResult
......
...@@ -169,6 +169,62 @@ unlockScreen(): Promise&lt;void&gt; ...@@ -169,6 +169,62 @@ unlockScreen(): Promise&lt;void&gt;
}); });
``` ```
## screenlock.lockScreen<sup>9+</sup>
lockScreen(callback: AsyncCallback&lt;void&gt;): void
锁定屏幕,使用callback作为异步方法。
**系统能力**: SystemCapability.MiscServices.ScreenLock
**系统API**:此接口为系统接口,三方应用不支持调用。
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数,失败时返回错误信息。 |
**示例**
```js
screenlock.lockScreen((err) => {
if (err) {
console.error('lockScreen callback error -> ${JSON.stringify(err)}');
return;
}
console.info('lockScreen callback success');
});
```
## screenlock.lockScreen<sup>9+</sup>
lockScreen(): Promise&lt;void&gt;
锁定屏幕,使用Promise作为异步方法。
**系统能力**: SystemCapability.MiscServices.ScreenLock
**系统API**:此接口为系统接口,三方应用不支持调用。
**返回值**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;void&gt; | 以Promise形式返回结果。 |
**示例**
```js
screenlock.lockScreen().then(() => {
console.log('lockScreen success');
}).catch((err) => {
console.error('lockScreen fail, promise: err->${JSON.stringify(err)}');
});
```
## screenlock.on<sup>9+</sup> ## screenlock.on<sup>9+</sup>
on(type: 'beginWakeUp' | 'endWakeUp' | 'beginScreenOn' | 'endScreenOn' | 'beginScreenOff' | 'endScreenOff' | 'unlockScreen' | 'beginExitAnimation', callback: Callback\<void\>): void on(type: 'beginWakeUp' | 'endWakeUp' | 'beginScreenOn' | 'endScreenOn' | 'beginScreenOff' | 'endScreenOff' | 'unlockScreen' | 'beginExitAnimation', callback: Callback\<void\>): void
......
...@@ -17,7 +17,7 @@ import sim from '@ohos.telephony.sim'; ...@@ -17,7 +17,7 @@ import sim from '@ohos.telephony.sim';
isSimActive\(slotId: number, callback: AsyncCallback<boolean\>\): void isSimActive\(slotId: number, callback: AsyncCallback<boolean\>\): void
获取指定卡槽SIM卡是否激活,使用callback方式作为异步方法 获取指定卡槽SIM卡是否激活。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -41,7 +41,7 @@ sim.isSimActive(0, (err, data) => { ...@@ -41,7 +41,7 @@ sim.isSimActive(0, (err, data) => {
isSimActive\(slotId: number\): Promise<boolean\> isSimActive\(slotId: number\): Promise<boolean\>
获取指定卡槽SIM卡是否激活,使用Promise方式作为异步方法 获取指定卡槽SIM卡是否激活。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -73,7 +73,7 @@ promise.then(data => { ...@@ -73,7 +73,7 @@ promise.then(data => {
getDefaultVoiceSlotId\(callback: AsyncCallback<number\>\): void getDefaultVoiceSlotId\(callback: AsyncCallback<number\>\): void
获取默认语音业务的卡槽ID,使用callback方式作为异步方法 获取默认语音业务的卡槽ID。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -96,7 +96,7 @@ sim.getDefaultVoiceSlotId((err, data) => { ...@@ -96,7 +96,7 @@ sim.getDefaultVoiceSlotId((err, data) => {
getDefaultVoiceSlotId\(\): Promise<number\> getDefaultVoiceSlotId\(\): Promise<number\>
获取默认语音业务的卡槽ID,使用Promise方式作为异步方法 获取默认语音业务的卡槽ID。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -121,7 +121,7 @@ promise.then(data => { ...@@ -121,7 +121,7 @@ promise.then(data => {
hasOperatorPrivileges(slotId: number, callback: AsyncCallback\<boolean\>): void hasOperatorPrivileges(slotId: number, callback: AsyncCallback\<boolean\>): void
检查应用(调用者)是否已被授予运营商权限,使用callback方式作为异步方法 检查应用(调用者)是否已被授予运营商权限。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -144,7 +144,7 @@ sim.hasOperatorPrivileges(0, (err, data) => { ...@@ -144,7 +144,7 @@ sim.hasOperatorPrivileges(0, (err, data) => {
hasOperatorPrivileges(slotId: number): Promise<boolean\> hasOperatorPrivileges(slotId: number): Promise<boolean\>
检查应用(调用者)是否已被授予运营商权限,使用Promise方式作为异步方法 检查应用(调用者)是否已被授予运营商权限。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -175,7 +175,7 @@ promise.then(data => { ...@@ -175,7 +175,7 @@ promise.then(data => {
getISOCountryCodeForSim\(slotId: number, callback: AsyncCallback<string\>\): void getISOCountryCodeForSim\(slotId: number, callback: AsyncCallback<string\>\): void
获取指定卡槽SIM卡的ISO国家码,使用callback方式作为异步方法 获取指定卡槽SIM卡的ISO国家码。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -199,7 +199,7 @@ sim.getISOCountryCodeForSim(0, (err, data) => { ...@@ -199,7 +199,7 @@ sim.getISOCountryCodeForSim(0, (err, data) => {
getISOCountryCodeForSim\(slotId: number\): Promise<string\> getISOCountryCodeForSim\(slotId: number\): Promise<string\>
获取指定卡槽SIM卡的ISO国家码,使用Promise方式作为异步方法 获取指定卡槽SIM卡的ISO国家码。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -231,7 +231,7 @@ promise.then(data => { ...@@ -231,7 +231,7 @@ promise.then(data => {
getSimOperatorNumeric\(slotId: number, callback: AsyncCallback<string\>\): void getSimOperatorNumeric\(slotId: number, callback: AsyncCallback<string\>\): void
获取指定卡槽SIM卡的归属PLMN(Public Land Mobile Network)号,使用callback方式作为异步方法 获取指定卡槽SIM卡的归属PLMN(Public Land Mobile Network)号。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -255,7 +255,7 @@ sim.getSimOperatorNumeric(0, (err, data) => { ...@@ -255,7 +255,7 @@ sim.getSimOperatorNumeric(0, (err, data) => {
getSimOperatorNumeric\(slotId: number\): Promise<string\> getSimOperatorNumeric\(slotId: number\): Promise<string\>
获取指定卡槽SIM卡的归属PLMN(Public Land Mobile Network)号,使用Promise方式作为异步方法 获取指定卡槽SIM卡的归属PLMN(Public Land Mobile Network)号。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -287,7 +287,7 @@ promise.then(data => { ...@@ -287,7 +287,7 @@ promise.then(data => {
getSimSpn\(slotId: number, callback: AsyncCallback<string\>\): void getSimSpn\(slotId: number, callback: AsyncCallback<string\>\): void
获取指定卡槽SIM卡的服务提供商名称(Service Provider Name,SPN),使用callback方式作为异步方法 获取指定卡槽SIM卡的服务提供商名称(Service Provider Name,SPN)。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -311,7 +311,7 @@ sim.getSimSpn(0, (err, data) => { ...@@ -311,7 +311,7 @@ sim.getSimSpn(0, (err, data) => {
getSimSpn\(slotId: number\): Promise<string\> getSimSpn\(slotId: number\): Promise<string\>
获取指定卡槽SIM卡的服务提供商名称(Service Provider Name,SPN),使用Promise方式作为异步方法 获取指定卡槽SIM卡的服务提供商名称(Service Provider Name,SPN)。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -343,7 +343,7 @@ promise.then(data => { ...@@ -343,7 +343,7 @@ promise.then(data => {
getSimState\(slotId: number, callback: AsyncCallback<SimState\>\): void getSimState\(slotId: number, callback: AsyncCallback<SimState\>\): void
获取指定卡槽的SIM卡状态,使用callback方式作为异步方法 获取指定卡槽的SIM卡状态。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -367,7 +367,7 @@ sim.getSimState(0, (err, data) => { ...@@ -367,7 +367,7 @@ sim.getSimState(0, (err, data) => {
getSimState\(slotId: number\): Promise<SimState\> getSimState\(slotId: number\): Promise<SimState\>
获取指定卡槽的SIM卡状态,使用Promise方式作为异步方法 获取指定卡槽的SIM卡状态。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -398,7 +398,7 @@ promise.then(data => { ...@@ -398,7 +398,7 @@ promise.then(data => {
getCardType\(slotId: number, callback: AsyncCallback<CardType\>\): void getCardType\(slotId: number, callback: AsyncCallback<CardType\>\): void
获取指定卡槽SIM卡的卡类型,使用callback方式作为异步方法 获取指定卡槽SIM卡的卡类型。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -422,7 +422,7 @@ sim.getCardType(0, (err, data) => { ...@@ -422,7 +422,7 @@ sim.getCardType(0, (err, data) => {
getCardType\(slotId: number\): Promise<CardType\> getCardType\(slotId: number\): Promise<CardType\>
获取指定卡槽SIM卡的卡类型,使用Promise方式作为异步方法 获取指定卡槽SIM卡的卡类型。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -454,7 +454,7 @@ promise.then(data => { ...@@ -454,7 +454,7 @@ promise.then(data => {
hasSimCard\(slotId: number, callback: AsyncCallback<boolean\>\): void hasSimCard\(slotId: number, callback: AsyncCallback<boolean\>\): void
获取指定卡槽SIM卡是否插卡,使用callback方式作为异步方法 获取指定卡槽SIM卡是否插卡。使用callback异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -478,7 +478,7 @@ sim.hasSimCard(0, (err, data) => { ...@@ -478,7 +478,7 @@ sim.hasSimCard(0, (err, data) => {
hasSimCard\(slotId: number\): Promise<boolean\> hasSimCard\(slotId: number\): Promise<boolean\>
获取指定卡槽SIM卡是否插卡,使用Promise方式作为异步方法 获取指定卡槽SIM卡是否插卡。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.CoreService **系统能力**:SystemCapability.Telephony.CoreService
...@@ -509,7 +509,7 @@ promise.then(data => { ...@@ -509,7 +509,7 @@ promise.then(data => {
getSimAccountInfo(slotId: number, callback: AsyncCallback<IccAccountInfo\>): void getSimAccountInfo(slotId: number, callback: AsyncCallback<IccAccountInfo\>): void
获取SIM卡账户信息,使用callback方式作为异步方法 获取SIM卡账户信息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -537,7 +537,7 @@ sim.getSimAccountInfo(0, (err, data) => { ...@@ -537,7 +537,7 @@ sim.getSimAccountInfo(0, (err, data) => {
getSimAccountInfo(slotId: number): Promise<IccAccountInfo\> getSimAccountInfo(slotId: number): Promise<IccAccountInfo\>
获取SIM卡账户信息,使用Promise方式作为异步方法 获取SIM卡账户信息。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -572,7 +572,7 @@ promise.then(data => { ...@@ -572,7 +572,7 @@ promise.then(data => {
getActiveSimAccountInfoList(callback: AsyncCallback<Array<IccAccountInfo\>>): void getActiveSimAccountInfoList(callback: AsyncCallback<Array<IccAccountInfo\>>): void
获取活跃SIM卡账户信息列表,使用callback方式作为异步方法 获取活跃SIM卡账户信息列表。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -599,7 +599,7 @@ sim.getActiveSimAccountInfoList(0, (err, data) => { ...@@ -599,7 +599,7 @@ sim.getActiveSimAccountInfoList(0, (err, data) => {
getActiveSimAccountInfoList(): Promise<Array<IccAccountInfo\>>; getActiveSimAccountInfoList(): Promise<Array<IccAccountInfo\>>;
获取活跃SIM卡账户信息列表,使用Promise方式作为异步方法 获取活跃SIM卡账户信息列表。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -628,7 +628,7 @@ promise.then(data => { ...@@ -628,7 +628,7 @@ promise.then(data => {
setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback<void\>): void setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback<void\>): void
设置默认语音业务的卡槽ID,使用callback方式作为异步方法 设置默认语音业务的卡槽ID。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -656,7 +656,7 @@ sim.setDefaultVoiceSlotId(0, (err, data) => { ...@@ -656,7 +656,7 @@ sim.setDefaultVoiceSlotId(0, (err, data) => {
setDefaultVoiceSlotId(slotId: number): Promise\<void\> setDefaultVoiceSlotId(slotId: number): Promise\<void\>
设置默认语音业务的卡槽ID,使用Promise方式作为异步方法 设置默认语音业务的卡槽ID。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -691,7 +691,7 @@ promise.then(data => { ...@@ -691,7 +691,7 @@ promise.then(data => {
setShowName\(slotId: number, name: string,callback: AsyncCallback<void\>\): void setShowName\(slotId: number, name: string,callback: AsyncCallback<void\>\): void
设置指定卡槽SIM卡显示的名称,使用callback方式作为异步方法 设置指定卡槽SIM卡显示的名称。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -720,7 +720,7 @@ sim.setShowName(0, name, (err, data) => { ...@@ -720,7 +720,7 @@ sim.setShowName(0, name, (err, data) => {
setShowName\(slotId: number, name: string\): Promise\<void\> setShowName\(slotId: number, name: string\): Promise\<void\>
设置指定卡槽SIM卡显示的名称,使用Promise方式作为异步方法 设置指定卡槽SIM卡显示的名称。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -757,7 +757,7 @@ promise.then(data => { ...@@ -757,7 +757,7 @@ promise.then(data => {
getShowName(slotId: number, callback: AsyncCallback<string\>): void getShowName(slotId: number, callback: AsyncCallback<string\>): void
获取指定卡槽SIM卡的名称,使用callback方式作为异步方法 获取指定卡槽SIM卡的名称。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -785,7 +785,7 @@ sim.getShowName(0, (err, data) => { ...@@ -785,7 +785,7 @@ sim.getShowName(0, (err, data) => {
getShowName(slotId: number): Promise<string\> getShowName(slotId: number): Promise<string\>
获取指定卡槽SIM卡的名称,使用Promise方式作为异步方法 获取指定卡槽SIM卡的名称。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -820,7 +820,7 @@ promise.then(data => { ...@@ -820,7 +820,7 @@ promise.then(data => {
setShowNumber\(slotId: number, number: string,callback: AsyncCallback<void\>\): void setShowNumber\(slotId: number, number: string,callback: AsyncCallback<void\>\): void
设置指定卡槽SIM卡的号码,使用callback方式作为异步方法 设置指定卡槽SIM卡的号码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -850,7 +850,7 @@ sim.setShowNumber(0, number, (err, data) => { ...@@ -850,7 +850,7 @@ sim.setShowNumber(0, number, (err, data) => {
setShowNumber\(slotId: number,number: string\): Promise\<void\> setShowNumber\(slotId: number,number: string\): Promise\<void\>
设置指定卡槽SIM卡的号码,使用Promise方式作为异步方法 设置指定卡槽SIM卡的号码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -887,7 +887,7 @@ promise.then(data => { ...@@ -887,7 +887,7 @@ promise.then(data => {
getShowNumber(slotId: number,callback: AsyncCallback<string\>): void getShowNumber(slotId: number,callback: AsyncCallback<string\>): void
获取指定卡槽SIM卡的号码,使用callback方式作为异步方法 获取指定卡槽SIM卡的号码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -915,7 +915,7 @@ sim.getShowNumber(0, (err, data) => { ...@@ -915,7 +915,7 @@ sim.getShowNumber(0, (err, data) => {
getShowNumber(slotId: number): Promise<string\> getShowNumber(slotId: number): Promise<string\>
获取指定卡槽SIM卡的号码,使用Promise方式作为异步方法 获取指定卡槽SIM卡的号码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -950,7 +950,7 @@ promise.then(data => { ...@@ -950,7 +950,7 @@ promise.then(data => {
activateSim(slotId: number, callback: AsyncCallback<void\>): void activateSim(slotId: number, callback: AsyncCallback<void\>): void
激活指定卡槽SIM卡,使用callback方式作为异步方法 激活指定卡槽SIM卡。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -978,7 +978,7 @@ sim.activateSim(0, (err, data) => { ...@@ -978,7 +978,7 @@ sim.activateSim(0, (err, data) => {
activateSim(slotId: number): Promise\<void\> activateSim(slotId: number): Promise\<void\>
激活指定卡槽SIM卡,使用Promise方式作为异步方法 激活指定卡槽SIM卡。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1013,7 +1013,7 @@ promise.then(data => { ...@@ -1013,7 +1013,7 @@ promise.then(data => {
deactivateSim(slotId: number, callback: AsyncCallback<void\>): void deactivateSim(slotId: number, callback: AsyncCallback<void\>): void
禁用指定卡槽SIM卡,使用callback方式作为异步方法 禁用指定卡槽SIM卡。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1041,7 +1041,7 @@ sim.deactivateSim(0, (err, data) => { ...@@ -1041,7 +1041,7 @@ sim.deactivateSim(0, (err, data) => {
deactivateSim(slotId: number): Promise\<void\> deactivateSim(slotId: number): Promise\<void\>
禁用指定卡槽SIM卡,使用Promise方式作为异步方法 禁用指定卡槽SIM卡。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1076,7 +1076,7 @@ promise.then(data => { ...@@ -1076,7 +1076,7 @@ promise.then(data => {
setLockState(slotId: number, options: LockInfo, callback: AsyncCallback<LockStatusResponse\>): void setLockState(slotId: number, options: LockInfo, callback: AsyncCallback<LockStatusResponse\>): void
设置指定卡槽SIM卡的锁状态,使用callback方式作为异步方法 设置指定卡槽SIM卡的锁状态。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1110,7 +1110,7 @@ sim.setLockState(0, lockInfo, (err, data) => { ...@@ -1110,7 +1110,7 @@ sim.setLockState(0, lockInfo, (err, data) => {
setLockState(slotId: number, options: LockInfo): Promise<LockStatusResponse\> setLockState(slotId: number, options: LockInfo): Promise<LockStatusResponse\>
设置指定卡槽SIM卡的锁状态,使用Promise方式作为异步方法 设置指定卡槽SIM卡的锁状态。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1151,7 +1151,7 @@ promise.then(data => { ...@@ -1151,7 +1151,7 @@ promise.then(data => {
getLockState(slotId: number, lockType: LockType, callback: AsyncCallback<LockState\>): void getLockState(slotId: number, lockType: LockType, callback: AsyncCallback<LockState\>): void
获取指定卡槽SIM卡的锁状态,使用callback方式作为异步方法 获取指定卡槽SIM卡的锁状态。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1178,7 +1178,7 @@ sim.getLockState(0, 1, (err, data) => { ...@@ -1178,7 +1178,7 @@ sim.getLockState(0, 1, (err, data) => {
getLockState(slotId: number, lockType: LockType): Promise<LockState\> getLockState(slotId: number, lockType: LockType): Promise<LockState\>
获取指定卡槽SIM卡的锁状态,使用Promise方式作为异步方法 获取指定卡槽SIM卡的锁状态。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1212,7 +1212,7 @@ promise.then(data => { ...@@ -1212,7 +1212,7 @@ promise.then(data => {
alterPin(slotId: number, newPin: string, oldPin: string, callback: AsyncCallback<LockStatusResponse\>): void alterPin(slotId: number, newPin: string, oldPin: string, callback: AsyncCallback<LockStatusResponse\>): void
更改Pin密码,使用callback方式作为异步方法 更改Pin密码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1242,7 +1242,7 @@ sim.alterPin(0, "1234", "0000", (err, data) => { ...@@ -1242,7 +1242,7 @@ sim.alterPin(0, "1234", "0000", (err, data) => {
alterPin(slotId: number, newPin: string, oldPin: string): Promise<LockStatusResponse\>; alterPin(slotId: number, newPin: string, oldPin: string): Promise<LockStatusResponse\>;
更改Pin密码,使用Promise方式作为异步方法 更改Pin密码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1279,7 +1279,7 @@ promise.then(data => { ...@@ -1279,7 +1279,7 @@ promise.then(data => {
alterPin2(slotId: number, newPin2: string, oldPin2: string, callback: AsyncCallback<LockStatusResponse\>): void alterPin2(slotId: number, newPin2: string, oldPin2: string, callback: AsyncCallback<LockStatusResponse\>): void
更改Pin2密码,使用callback方式作为异步方法 更改Pin2密码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1309,7 +1309,7 @@ sim.alterPin2(0, "1234", "0000", (err, data) => { ...@@ -1309,7 +1309,7 @@ sim.alterPin2(0, "1234", "0000", (err, data) => {
alterPin2(slotId: number, newPin2: string, oldPin2: string): Promise<LockStatusResponse\> alterPin2(slotId: number, newPin2: string, oldPin2: string): Promise<LockStatusResponse\>
更改Pin2密码,使用Promise方式作为异步方法 更改Pin2密码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1346,7 +1346,7 @@ promise.then(data => { ...@@ -1346,7 +1346,7 @@ promise.then(data => {
unlockPin(slotId: number,pin: string ,callback: AsyncCallback<LockStatusResponse\>): void unlockPin(slotId: number,pin: string ,callback: AsyncCallback<LockStatusResponse\>): void
解锁指定卡槽SIM卡密码,使用callback方式作为异步方法 解锁指定卡槽SIM卡密码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1376,7 +1376,7 @@ sim.unlockPin(0, pin, (err, data) => { ...@@ -1376,7 +1376,7 @@ sim.unlockPin(0, pin, (err, data) => {
unlockPin(slotId: number,pin: string): Promise&lt;LockStatusResponse\> unlockPin(slotId: number,pin: string): Promise&lt;LockStatusResponse\>
解锁指定卡槽SIM卡密码,使用Promise方式作为异步方法 解锁指定卡槽SIM卡密码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1413,7 +1413,7 @@ promise.then(data => { ...@@ -1413,7 +1413,7 @@ promise.then(data => {
unlockPuk(slotId: number,newPin: string,puk: string ,callback: AsyncCallback<LockStatusResponse\>): void unlockPuk(slotId: number,newPin: string,puk: string ,callback: AsyncCallback<LockStatusResponse\>): void
解锁指定卡槽SIM卡密码的解锁密码,使用callback方式作为异步方法 解锁指定卡槽SIM卡密码的解锁密码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1445,7 +1445,7 @@ sim.unlockPuk(0, newPin, puk, (err, data) => { ...@@ -1445,7 +1445,7 @@ sim.unlockPuk(0, newPin, puk, (err, data) => {
unlockPuk(slotId: number,newPin: string,puk: string): Promise&lt;LockStatusResponse\> unlockPuk(slotId: number,newPin: string,puk: string): Promise&lt;LockStatusResponse\>
解锁指定卡槽SIM卡密码的解锁密码,使用Promise方式作为异步方法 解锁指定卡槽SIM卡密码的解锁密码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1484,7 +1484,7 @@ promise.then(data => { ...@@ -1484,7 +1484,7 @@ promise.then(data => {
unlockPin2(slotId: number,pin2: string ,callback: AsyncCallback<LockStatusResponse\>): void unlockPin2(slotId: number,pin2: string ,callback: AsyncCallback<LockStatusResponse\>): void
解锁指定卡槽SIM卡密码,使用callback方式作为异步方法 解锁指定卡槽SIM卡密码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1514,7 +1514,7 @@ sim.unlockPin2(0, pin2, (err, data) => { ...@@ -1514,7 +1514,7 @@ sim.unlockPin2(0, pin2, (err, data) => {
unlockPin2(slotId: number,pin2: string): Promise&lt;LockStatusResponse\> unlockPin2(slotId: number,pin2: string): Promise&lt;LockStatusResponse\>
解锁指定卡槽SIM卡密码,使用Promise方式作为异步方法 解锁指定卡槽SIM卡密码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1551,7 +1551,7 @@ promise.then(data => { ...@@ -1551,7 +1551,7 @@ promise.then(data => {
unlockPuk2(slotId: number, newPin2: string, puk2: string, callback: AsyncCallback<LockStatusResponse\>): void unlockPuk2(slotId: number, newPin2: string, puk2: string, callback: AsyncCallback<LockStatusResponse\>): void
解锁指定卡槽SIM卡密码的解锁密码,使用callback方式作为异步方法 解锁指定卡槽SIM卡密码的解锁密码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1583,7 +1583,7 @@ sim.unlockPuk2(0, newPin2, puk2, (err, data) => { ...@@ -1583,7 +1583,7 @@ sim.unlockPuk2(0, newPin2, puk2, (err, data) => {
unlockPuk2(slotId: number, newPin2: string, puk2: string): Promise&lt;LockStatusResponse\> unlockPuk2(slotId: number, newPin2: string, puk2: string): Promise&lt;LockStatusResponse\>
解锁指定卡槽SIM卡密码的解锁密码,使用Promise方式作为异步方法 解锁指定卡槽SIM卡密码的解锁密码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1642,7 +1642,7 @@ console.log("Result: "+ sim.getMaxSimCount()) ...@@ -1642,7 +1642,7 @@ console.log("Result: "+ sim.getMaxSimCount())
getSimIccId(slotId: number, callback: AsyncCallback<string\>): void getSimIccId(slotId: number, callback: AsyncCallback<string\>): void
获取指定卡槽SIM卡的ICCID,使用callback方式作为异步方法 获取指定卡槽SIM卡的ICCID。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1670,7 +1670,7 @@ sim.getSimIccId(0, (err, data) => { ...@@ -1670,7 +1670,7 @@ sim.getSimIccId(0, (err, data) => {
getSimIccId(slotId: number): Promise<string\> getSimIccId(slotId: number): Promise<string\>
获取指定卡槽SIM卡的ICCID,使用Promise方式作为异步方法 获取指定卡槽SIM卡的ICCID。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1705,7 +1705,7 @@ promise.then(data => { ...@@ -1705,7 +1705,7 @@ promise.then(data => {
getVoiceMailIdentifier(slotId: number, callback: AsyncCallback<string\>): void getVoiceMailIdentifier(slotId: number, callback: AsyncCallback<string\>): void
获取指定卡槽中SIM卡语音信箱的alpha标识符,使用callback方式作为异步方法 获取指定卡槽中SIM卡语音信箱的alpha标识符。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1733,7 +1733,7 @@ sim.getVoiceMailIdentifier(0, (err, data) => { ...@@ -1733,7 +1733,7 @@ sim.getVoiceMailIdentifier(0, (err, data) => {
getVoiceMailIdentifier(slotId: number): Promise<string\> getVoiceMailIdentifier(slotId: number): Promise<string\>
获取指定卡槽中SIM卡语音信箱的alpha标识符,使用Promise方式作为异步方法 获取指定卡槽中SIM卡语音信箱的alpha标识符。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1768,7 +1768,7 @@ promise.then(data => { ...@@ -1768,7 +1768,7 @@ promise.then(data => {
getVoiceMailNumber(slotId: number, callback: AsyncCallback<string\>): void getVoiceMailNumber(slotId: number, callback: AsyncCallback<string\>): void
获取指定卡槽中SIM卡的语音信箱号,使用callback方式作为异步方法 获取指定卡槽中SIM卡的语音信箱号。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1796,7 +1796,7 @@ sim.getVoiceMailNumber(0, (err, data) => { ...@@ -1796,7 +1796,7 @@ sim.getVoiceMailNumber(0, (err, data) => {
getVoiceMailNumber(slotId: number): Promise<string\> getVoiceMailNumber(slotId: number): Promise<string\>
获取指定卡槽中SIM卡的语音信箱号,使用Promise方式作为异步方法 获取指定卡槽中SIM卡的语音信箱号。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1831,7 +1831,7 @@ promise.then(data => { ...@@ -1831,7 +1831,7 @@ promise.then(data => {
setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback: AsyncCallback<void\>): void setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback: AsyncCallback<void\>): void
设置语音邮件信息,使用callback方式作为异步方法 设置语音邮件信息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1861,7 +1861,7 @@ sim.setVoiceMailInfo(0, "mail", "xxx@xxx.com" , (err, data) => { ...@@ -1861,7 +1861,7 @@ sim.setVoiceMailInfo(0, "mail", "xxx@xxx.com" , (err, data) => {
setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string): Promise<void\> setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string): Promise<void\>
设置语音邮件信息,使用Promise方式作为异步方法 设置语音邮件信息。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1898,7 +1898,7 @@ promise.then(data => { ...@@ -1898,7 +1898,7 @@ promise.then(data => {
getSimTelephoneNumber(slotId: number, callback: AsyncCallback<string\>): void getSimTelephoneNumber(slotId: number, callback: AsyncCallback<string\>): void
获取指定卡槽中SIM卡的MSISDN,使用callback方式作为异步方法 获取指定卡槽中SIM卡的MSISDN。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1926,7 +1926,7 @@ sim.getSimTelephoneNumber(0, (err, data) => { ...@@ -1926,7 +1926,7 @@ sim.getSimTelephoneNumber(0, (err, data) => {
getSimTelephoneNumber(slotId: number): Promise<string\> getSimTelephoneNumber(slotId: number): Promise<string\>
获取指定卡槽中SIM卡的MSISDN,使用Promise方式作为异步方法 获取指定卡槽中SIM卡的MSISDN。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1961,7 +1961,7 @@ promise.then(data => { ...@@ -1961,7 +1961,7 @@ promise.then(data => {
getSimGid1(slotId: number, callback: AsyncCallback<string\>): void getSimGid1(slotId: number, callback: AsyncCallback<string\>): void
获取指定卡槽中SIM卡的组标识符级别1(GID1),使用callback方式作为异步方法 获取指定卡槽中SIM卡的组标识符级别1(GID1)。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1989,7 +1989,7 @@ sim.getSimGid1(0, (err, data) => { ...@@ -1989,7 +1989,7 @@ sim.getSimGid1(0, (err, data) => {
getSimGid1(slotId: number): Promise<string\> getSimGid1(slotId: number): Promise<string\>
获取指定卡槽中SIM卡的组标识符级别1(GID1),使用Promise方式作为异步方法 获取指定卡槽中SIM卡的组标识符级别1(GID1)。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2024,7 +2024,7 @@ promise.then(data => { ...@@ -2024,7 +2024,7 @@ promise.then(data => {
getIMSI(slotId: number, callback: AsyncCallback<string\>): void getIMSI(slotId: number, callback: AsyncCallback<string\>): void
获取国际移动用户识别码,使用callback方式作为异步方法 获取国际移动用户识别码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2052,7 +2052,7 @@ sim.getIMSI(0, (err, data) => { ...@@ -2052,7 +2052,7 @@ sim.getIMSI(0, (err, data) => {
getIMSI(slotId: number): Promise<string\> getIMSI(slotId: number): Promise<string\>
获取国际移动用户识别码,使用Promise方式作为异步方法 获取国际移动用户识别码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2087,7 +2087,7 @@ promise.then(data => { ...@@ -2087,7 +2087,7 @@ promise.then(data => {
getOperatorConfigs(slotId: number, callback: AsyncCallback<Array<OperatorConfig\>>): void getOperatorConfigs(slotId: number, callback: AsyncCallback<Array<OperatorConfig\>>): void
获取运营商配置,使用callback方式作为异步方法 获取运营商配置。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2115,7 +2115,7 @@ sim.getOperatorConfigs(0, (err, data) => { ...@@ -2115,7 +2115,7 @@ sim.getOperatorConfigs(0, (err, data) => {
getOperatorConfigs(slotId: number): Promise<Array<OperatorConfig\>> getOperatorConfigs(slotId: number): Promise<Array<OperatorConfig\>>
获取运营商配置,使用Promise方式作为异步方法 获取运营商配置。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2150,7 +2150,7 @@ promise.then(data => { ...@@ -2150,7 +2150,7 @@ promise.then(data => {
queryIccDiallingNumbers(slotId: number, type: ContactType, callback: AsyncCallback<Array<DiallingNumbersInfo\>>): void queryIccDiallingNumbers(slotId: number, type: ContactType, callback: AsyncCallback<Array<DiallingNumbersInfo\>>): void
查询SIM卡联系人号码,使用callback方式作为异步方法 查询SIM卡联系人号码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2179,7 +2179,7 @@ sim.queryIccDiallingNumbers(0, 1, (err, data) => { ...@@ -2179,7 +2179,7 @@ sim.queryIccDiallingNumbers(0, 1, (err, data) => {
queryIccDiallingNumbers(slotId: number, type: ContactType): Promise<Array<DiallingNumbersInfo\>> queryIccDiallingNumbers(slotId: number, type: ContactType): Promise<Array<DiallingNumbersInfo\>>
查询SIM卡联系人号码,使用Promise方式作为异步方法 查询SIM卡联系人号码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2215,7 +2215,7 @@ promise.then(data => { ...@@ -2215,7 +2215,7 @@ promise.then(data => {
addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback<void\>): void addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback<void\>): void
添加SIM卡联系人号码,使用callback方式作为异步方法 添加SIM卡联系人号码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2251,7 +2251,7 @@ sim.addIccDiallingNumbers(0, 1, diallingNumbersInof, (err, data) => { ...@@ -2251,7 +2251,7 @@ sim.addIccDiallingNumbers(0, 1, diallingNumbersInof, (err, data) => {
addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise<void\> addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise<void\>
添加SIM卡联系人号码,使用Promise方式作为异步方法 添加SIM卡联系人号码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2294,7 +2294,7 @@ promise.then(data => { ...@@ -2294,7 +2294,7 @@ promise.then(data => {
delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback<void\>): void delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback<void\>): void
删除SIM卡联系人号码,使用callback方式作为异步方法 删除SIM卡联系人号码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2330,7 +2330,7 @@ sim.delIccDiallingNumbers(0, 1, diallingNumbersInof, (err, data) => { ...@@ -2330,7 +2330,7 @@ sim.delIccDiallingNumbers(0, 1, diallingNumbersInof, (err, data) => {
delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise<void\> delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise<void\>
删除SIM卡联系人号码,使用Promise方式作为异步方法 删除SIM卡联系人号码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2373,7 +2373,7 @@ promise.then(data => { ...@@ -2373,7 +2373,7 @@ promise.then(data => {
updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback<void\>): void updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback<void\>): void
更新SIM卡联系人号码,使用callback方式作为异步方法 更新SIM卡联系人号码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2409,7 +2409,7 @@ sim.updateIccDiallingNumbers(0, 1, diallingNumbersInof, (err, data) => { ...@@ -2409,7 +2409,7 @@ sim.updateIccDiallingNumbers(0, 1, diallingNumbersInof, (err, data) => {
updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise<void\> updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise<void\>
更新SIM卡联系人号码,使用Promise方式作为异步方法 更新SIM卡联系人号码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2452,7 +2452,7 @@ promise.then(data => { ...@@ -2452,7 +2452,7 @@ promise.then(data => {
sendEnvelopeCmd(slotId: number, cmd: string, callback: AsyncCallback<void\>): void sendEnvelopeCmd(slotId: number, cmd: string, callback: AsyncCallback<void\>): void
发送信封命令,使用callback方式作为异步方法 发送信封命令。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2481,7 +2481,7 @@ sim.sendEnvelopeCmd(0, "ls", (err, data) => { ...@@ -2481,7 +2481,7 @@ sim.sendEnvelopeCmd(0, "ls", (err, data) => {
sendEnvelopeCmd(slotId: number, cmd: string): Promise<void\> sendEnvelopeCmd(slotId: number, cmd: string): Promise<void\>
发送信封命令,使用Promise方式作为异步方法 发送信封命令。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2517,7 +2517,7 @@ promise.then(data => { ...@@ -2517,7 +2517,7 @@ promise.then(data => {
sendTerminalResponseCmd(slotId: number, cmd: string, callback: AsyncCallback<void\>): void sendTerminalResponseCmd(slotId: number, cmd: string, callback: AsyncCallback<void\>): void
发送终端响应命令,使用callback方式作为异步方法 发送终端响应命令。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2546,7 +2546,7 @@ sim.sendTerminalResponseCmd(0, "ls", (err, data) => { ...@@ -2546,7 +2546,7 @@ sim.sendTerminalResponseCmd(0, "ls", (err, data) => {
sendTerminalResponseCmd(slotId: number, cmd: string): Promise<void\> sendTerminalResponseCmd(slotId: number, cmd: string): Promise<void\>
发送终端响应命令,使用Promise方式作为异步方法 发送终端响应命令。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2582,7 +2582,7 @@ promise.then(data => { ...@@ -2582,7 +2582,7 @@ promise.then(data => {
unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<LockStatusResponse\>): void unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<LockStatusResponse\>): void
解锁SIM卡锁,使用callback方式作为异步方法 解锁SIM卡锁。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2615,7 +2615,7 @@ sim.unlockSimLock(0, persoLockInfo, (err, data) => { ...@@ -2615,7 +2615,7 @@ sim.unlockSimLock(0, persoLockInfo, (err, data) => {
unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise<LockStatusResponse\> unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise<LockStatusResponse\>
解锁SIM卡锁,使用Promise方式作为异步方法 解锁SIM卡锁。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2655,7 +2655,7 @@ promise.then(data => { ...@@ -2655,7 +2655,7 @@ promise.then(data => {
getOpKey(slotId: number, callback: AsyncCallback<string\>): void getOpKey(slotId: number, callback: AsyncCallback<string\>): void
获取指定卡槽中SIM卡的opkey,使用callback方式作为异步方法 获取指定卡槽中SIM卡的opkey。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2681,7 +2681,7 @@ sim.getOpKey(0, (err, data) => { ...@@ -2681,7 +2681,7 @@ sim.getOpKey(0, (err, data) => {
getOpKey(slotId: number): Promise<string\> getOpKey(slotId: number): Promise<string\>
获取指定卡槽中SIM卡的opkey,使用Promise方式作为异步方法 获取指定卡槽中SIM卡的opkey。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2714,7 +2714,7 @@ promise.then(data => { ...@@ -2714,7 +2714,7 @@ promise.then(data => {
getOpName(slotId: number, callback: AsyncCallback<string\>): void getOpName(slotId: number, callback: AsyncCallback<string\>): void
获取指定卡槽中SIM卡的OpName,使用callback方式作为异步方法 获取指定卡槽中SIM卡的OpName。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -2740,7 +2740,7 @@ sim.getOpName(0, (err, data) => { ...@@ -2740,7 +2740,7 @@ sim.getOpName(0, (err, data) => {
getOpName(slotId: number): Promise<string\> getOpName(slotId: number): Promise<string\>
获取指定卡槽中SIM卡的OpName,使用Promise方式作为异步方法 获取指定卡槽中SIM卡的OpName。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
......
...@@ -16,7 +16,7 @@ import sms from '@ohos.telephony.sms'; ...@@ -16,7 +16,7 @@ import sms from '@ohos.telephony.sms';
createMessage\(pdu: Array&lt;number&gt;, specification: string, callback: AsyncCallback<ShortMessage\>\): void createMessage\(pdu: Array&lt;number&gt;, specification: string, callback: AsyncCallback<ShortMessage\>\): void
根据协议数据单元(PDU)和指定的短信协议创建短信实例,使用callback方式作为异步方法 根据协议数据单元(PDU)和指定的短信协议创建短信实例。使用callback异步回调
**系统能力**:SystemCapability.Telephony.SmsMms **系统能力**:SystemCapability.Telephony.SmsMms
...@@ -25,7 +25,7 @@ createMessage\(pdu: Array&lt;number&gt;, specification: string, callback: AsyncC ...@@ -25,7 +25,7 @@ createMessage\(pdu: Array&lt;number&gt;, specification: string, callback: AsyncC
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ | | ------------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ |
| pdu | Array&lt;number&gt; | 是 | 协议数据单元,从收到的信息中获取。 | | pdu | Array&lt;number&gt; | 是 | 协议数据单元,从收到的信息中获取。 |
| specification | string | 是 | 短信协议类型。<br/>- 3gpp表示GSM/UMTS/LTE SMS<br/>- 3gpp2表示CDMA SMS | | specification | string | 是 | 短信协议类型。<br/>- 3gpp:表示GSM/UMTS/LTE SMS<br/>- 3gpp2:表示CDMA SMS |
| callback | AsyncCallback&lt;[ShortMessage](#shortmessage)&gt; | 是 | 回调函数。 | | callback | AsyncCallback&lt;[ShortMessage](#shortmessage)&gt; | 是 | 回调函数。 |
**示例:** **示例:**
...@@ -44,7 +44,7 @@ sms.createMessage(pdu, specification, (err, data) => { ...@@ -44,7 +44,7 @@ sms.createMessage(pdu, specification, (err, data) => {
createMessage\(pdu: Array&lt;number&gt;, specification: string\): Promise<ShortMessage\> createMessage\(pdu: Array&lt;number&gt;, specification: string\): Promise<ShortMessage\>
根据协议数据单元(PDU)和指定的短信协议创建短信实例,使用Promise方式作为异步方法 根据协议数据单元(PDU)和指定的短信协议创建短信实例。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.SmsMms **系统能力**:SystemCapability.Telephony.SmsMms
...@@ -53,7 +53,7 @@ createMessage\(pdu: Array&lt;number&gt;, specification: string\): Promise<ShortM ...@@ -53,7 +53,7 @@ createMessage\(pdu: Array&lt;number&gt;, specification: string\): Promise<ShortM
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------------- | ------------------- | ---- | ------------------------------------------------------------ | | ------------- | ------------------- | ---- | ------------------------------------------------------------ |
| pdu | Array&lt;number&gt; | 是 | 协议数据单元,从收到的信息中获取。 | | pdu | Array&lt;number&gt; | 是 | 协议数据单元,从收到的信息中获取。 |
| specification | string | 是 | 短信协议类型。<br/>- 3gpp表示GSM/UMTS/LTE SMS<br/>- 3gpp2表示CDMA SMS | | specification | string | 是 | 短信协议类型。<br/>- 3gpp:表示GSM/UMTS/LTE SMS<br/>- 3gpp2:表示CDMA SMS |
**返回值:** **返回值:**
...@@ -71,7 +71,7 @@ let promise = sms.createMessage(pdu, specification); ...@@ -71,7 +71,7 @@ let promise = sms.createMessage(pdu, specification);
promise.then(data => { promise.then(data => {
console.log(`createMessage success, promise: data->${JSON.stringify(data)}`); console.log(`createMessage success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`createMessage fail, promise: err->${JSON.stringify(err)}`); console.error(`createMessage failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -114,7 +114,7 @@ sms.sendMessage(options); ...@@ -114,7 +114,7 @@ sms.sendMessage(options);
getDefaultSmsSlotId\(callback: AsyncCallback&lt;number&gt;\): void getDefaultSmsSlotId\(callback: AsyncCallback&lt;number&gt;\): void
获取发送短信的默认SIM卡槽ID,使用callback方式作为异步方法 获取发送短信的默认SIM卡槽ID。使用callback异步回调
**系统能力**:SystemCapability.Telephony.SmsMms **系统能力**:SystemCapability.Telephony.SmsMms
...@@ -137,7 +137,7 @@ sms.getDefaultSmsSlotId((err, data) => { ...@@ -137,7 +137,7 @@ sms.getDefaultSmsSlotId((err, data) => {
getDefaultSmsSlotId\(\): Promise&lt;number&gt; getDefaultSmsSlotId\(\): Promise&lt;number&gt;
获取发送短信的默认SIM卡槽ID,使用Promise方式作为异步方法 获取发送短信的默认SIM卡槽ID。使用Promise异步回调
**系统能力**:SystemCapability.Telephony.SmsMms **系统能力**:SystemCapability.Telephony.SmsMms
...@@ -154,7 +154,7 @@ let promise = sms.getDefaultSmsSlotId(); ...@@ -154,7 +154,7 @@ let promise = sms.getDefaultSmsSlotId();
promise.then(data => { promise.then(data => {
console.log(`getDefaultSmsSlotId success, promise: data->${JSON.stringify(data)}`); console.log(`getDefaultSmsSlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getDefaultSmsSlotId fail, promise: err->${JSON.stringify(err)}`); console.error(`getDefaultSmsSlotId failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -162,7 +162,7 @@ promise.then(data => { ...@@ -162,7 +162,7 @@ promise.then(data => {
setDefaultSmsSlotId\(slotId: number,callback: AsyncCallback&lt;void&gt;\): void setDefaultSmsSlotId\(slotId: number,callback: AsyncCallback&lt;void&gt;\): void
设置发送短信的默认SIM卡槽ID,使用callback方式作为异步方法 设置发送短信的默认SIM卡槽ID。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -190,7 +190,7 @@ sms.setDefaultSmsSlotId(0,(err, data) => { ...@@ -190,7 +190,7 @@ sms.setDefaultSmsSlotId(0,(err, data) => {
setDefaultSmsSlotId\(slotId: number\): Promise&lt;void&gt; setDefaultSmsSlotId\(slotId: number\): Promise&lt;void&gt;
设置发送短信的默认SIM卡槽ID,使用Promise方式作为异步方法 设置发送短信的默认SIM卡槽ID。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -217,7 +217,7 @@ let promise = sms.setDefaultSmsSlotId(0); ...@@ -217,7 +217,7 @@ let promise = sms.setDefaultSmsSlotId(0);
promise.then(data => { promise.then(data => {
console.log(`setDefaultSmsSlotId success, promise: data->${JSON.stringify(data)}`); console.log(`setDefaultSmsSlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`setDefaultSmsSlotId fail, promise: err->${JSON.stringify(err)}`); console.error(`setDefaultSmsSlotId failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -225,7 +225,7 @@ promise.then(data => { ...@@ -225,7 +225,7 @@ promise.then(data => {
setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\): void setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\): void
设置短信服务中心(SMSC)地址,使用callback方式作为异步方法 设置短信服务中心(SMSC)地址。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -256,7 +256,7 @@ sms.setSmscAddr(slotId, smscAddr, (err,data) => { ...@@ -256,7 +256,7 @@ sms.setSmscAddr(slotId, smscAddr, (err,data) => {
setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\> setSmscAddr\(slotId: number, smscAddr: string\): Promise\<void\>
设置短信服务中心(SMSC)地址,使用Promise方式作为异步方法 设置短信服务中心(SMSC)地址。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -286,7 +286,7 @@ let promise = sms.setSmscAddr(slotId, smscAddr); ...@@ -286,7 +286,7 @@ let promise = sms.setSmscAddr(slotId, smscAddr);
promise.then(data => { promise.then(data => {
console.log(`setSmscAddr success, promise: data->${JSON.stringify(data)}`); console.log(`setSmscAddr success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`setSmscAddr fail, promise: err->${JSON.stringify(err)}`); console.error(`setSmscAddr failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -295,7 +295,7 @@ promise.then(data => { ...@@ -295,7 +295,7 @@ promise.then(data => {
getSmscAddr\(slotId: number, callback: AsyncCallback<string\>\): void getSmscAddr\(slotId: number, callback: AsyncCallback<string\>\): void
获取短信服务中心(SMSC)地址,使用callback方式作为异步方法 获取短信服务中心(SMSC)地址。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -324,7 +324,7 @@ sms.getSmscAddr(slotId, (err, data) => { ...@@ -324,7 +324,7 @@ sms.getSmscAddr(slotId, (err, data) => {
getSmscAddr\(slotId: number\): Promise<string\> getSmscAddr\(slotId: number\): Promise<string\>
获取短信服务中心(SMSC)地址,使用Promise方式作为异步方法 获取短信服务中心(SMSC)地址。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -352,7 +352,7 @@ let promise = sms.getSmscAddr(slotId); ...@@ -352,7 +352,7 @@ let promise = sms.getSmscAddr(slotId);
promise.then(data => { promise.then(data => {
console.log(`getSmscAddr success, promise: data->${JSON.stringify(data)}`); console.log(`getSmscAddr success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getSmscAddr fail, promise: err->${JSON.stringify(err)}`); console.error(`getSmscAddr failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -368,7 +368,7 @@ hasSmsCapability(): boolean ...@@ -368,7 +368,7 @@ hasSmsCapability(): boolean
| 类型 | 说明 | | 类型 | 说明 |
| ------- | ------------------------------------------------------------ | | ------- | ------------------------------------------------------------ |
| boolean | - true:设备具备短信发送和接收能力<br/>- false:设备不具备短信发送和接收能力 | | boolean | - true:设备具备短信发送和接收能力<br/>- false:设备不具备短信发送和接收能力。 |
```js ```js
let result = sms.hasSmsCapability(); let result = sms.hasSmsCapability();
...@@ -379,7 +379,7 @@ console.log(`hasSmsCapability: ${JSON.stringify(result)}`); ...@@ -379,7 +379,7 @@ console.log(`hasSmsCapability: ${JSON.stringify(result)}`);
splitMessage(content: string, callback: AsyncCallback<Array<string\>>): void splitMessage(content: string, callback: AsyncCallback<Array<string\>>): void
将长短信拆分为多个片段,使用callback方式作为异步方法 将长短信拆分为多个片段。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -408,7 +408,7 @@ sms.splitMessage(content, (err, data) => { ...@@ -408,7 +408,7 @@ sms.splitMessage(content, (err, data) => {
splitMessage(content: string): Promise<Array<string\>> splitMessage(content: string): Promise<Array<string\>>
将长短信拆分为多个片段,使用Promise方式作为异步方法 将长短信拆分为多个片段。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -436,7 +436,7 @@ let promise = sms.splitMessage(content); ...@@ -436,7 +436,7 @@ let promise = sms.splitMessage(content);
promise.then(data => { promise.then(data => {
console.log(`splitMessage success, promise: data->${JSON.stringify(data)}`); console.log(`splitMessage success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`splitMessage fail, promise: err->${JSON.stringify(err)}`); console.error(`splitMessage failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -444,7 +444,7 @@ promise.then(data => { ...@@ -444,7 +444,7 @@ promise.then(data => {
addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void\>): void addSimMessage(options: SimMessageOptions, callback: AsyncCallback<void\>): void
添加SIM卡消息,使用callback方式作为异步方法 添加SIM卡消息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -478,7 +478,7 @@ sms.addSimMessage(simMessageOptions, (err, data) => { ...@@ -478,7 +478,7 @@ sms.addSimMessage(simMessageOptions, (err, data) => {
addSimMessage(options: SimMessageOptions): Promise<void\> addSimMessage(options: SimMessageOptions): Promise<void\>
添加SIM卡消息,使用Promise方式作为异步方法 添加SIM卡消息。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -511,7 +511,7 @@ let promise = sms.addSimMessage(simMessageOptions); ...@@ -511,7 +511,7 @@ let promise = sms.addSimMessage(simMessageOptions);
promise.then(data => { promise.then(data => {
console.log(`addSimMessage success, promise: data->${JSON.stringify(data)}`); console.log(`addSimMessage success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`addSimMessage fail, promise: err->${JSON.stringify(err)}`); console.error(`addSimMessage failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -519,7 +519,7 @@ promise.then(data => { ...@@ -519,7 +519,7 @@ promise.then(data => {
delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>): void delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>): void
删除SIM卡消息,使用callback方式作为异步方法 删除SIM卡消息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -532,7 +532,7 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>): ...@@ -532,7 +532,7 @@ delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback<void\>):
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ----------------------------------------- | | -------- | ------------------------- | ---- | ----------------------------------------- |
| slotId | number | 是 | SIM卡槽ID:<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | SIM卡槽ID:<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| msgIndex | number | 是 | 消息索引 | | msgIndex | number | 是 | 消息索引 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 | | callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**示例:** **示例:**
...@@ -550,7 +550,7 @@ sms.delSimMessage(slotId, msgIndex, (err, data) => { ...@@ -550,7 +550,7 @@ sms.delSimMessage(slotId, msgIndex, (err, data) => {
delSimMessage(slotId: number, msgIndex: number): Promise<void\> delSimMessage(slotId: number, msgIndex: number): Promise<void\>
删除SIM卡信息,使用Promise方式作为异步方法 删除SIM卡信息。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -563,7 +563,7 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\> ...@@ -563,7 +563,7 @@ delSimMessage(slotId: number, msgIndex: number): Promise<void\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------ | ---- | ----------------------------------------- | | -------- | ------ | ---- | ----------------------------------------- |
| slotId | number | 是 | SIM卡槽ID:<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | SIM卡槽ID:<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| msgIndex | number | 是 | 消息索引 | | msgIndex | number | 是 | 消息索引 |
**返回值:** **返回值:**
...@@ -580,7 +580,7 @@ let promise = sms.delSimMessage(slotId, msgIndex); ...@@ -580,7 +580,7 @@ let promise = sms.delSimMessage(slotId, msgIndex);
promise.then(data => { promise.then(data => {
console.log(`delSimMessage success, promise: data->${JSON.stringify(data)}`); console.log(`delSimMessage success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`delSimMessage fail, promise: err->${JSON.stringify(err)}`); console.error(`delSimMessage failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -588,7 +588,7 @@ promise.then(data => { ...@@ -588,7 +588,7 @@ promise.then(data => {
updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void\>): void updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback<void\>): void
更新SIM卡消息,使用callback方式作为异步方法 更新SIM卡消息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -623,7 +623,7 @@ sms.updateSimMessage(updateSimMessageOptions, (err, data) => { ...@@ -623,7 +623,7 @@ sms.updateSimMessage(updateSimMessageOptions, (err, data) => {
updateSimMessage(options: UpdateSimMessageOptions): Promise<void\> updateSimMessage(options: UpdateSimMessageOptions): Promise<void\>
更新SIM卡消息,使用Promise方式作为异步方法 更新SIM卡消息。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -657,7 +657,7 @@ let promise = sms.updateSimMessage(updateSimMessageOptions); ...@@ -657,7 +657,7 @@ let promise = sms.updateSimMessage(updateSimMessageOptions);
promise.then(data => { promise.then(data => {
console.log(`updateSimMessage success, promise: data->${JSON.stringify(data)}`); console.log(`updateSimMessage success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`updateSimMessage fail, promise: err->${JSON.stringify(err)}`); console.error(`updateSimMessage failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -665,7 +665,7 @@ promise.then(data => { ...@@ -665,7 +665,7 @@ promise.then(data => {
getAllSimMessages(slotId: number, callback: AsyncCallback<Array<SimShortMessage\>>): void getAllSimMessages(slotId: number, callback: AsyncCallback<Array<SimShortMessage\>>): void
获取所有SIM卡消息,使用callback方式作为异步方法 获取所有SIM卡消息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -694,7 +694,7 @@ sms.getAllSimMessages(slotId, (err, data) => { ...@@ -694,7 +694,7 @@ sms.getAllSimMessages(slotId, (err, data) => {
getAllSimMessages(slotId: number): Promise<Array<SimShortMessage\>> getAllSimMessages(slotId: number): Promise<Array<SimShortMessage\>>
获取所有SIM卡消息,使用Promise方式作为异步方法 获取所有SIM卡消息。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -722,7 +722,7 @@ let promise = sms.getAllSimMessages(slotId); ...@@ -722,7 +722,7 @@ let promise = sms.getAllSimMessages(slotId);
promise.then(data => { promise.then(data => {
console.log(`getAllSimMessages success, promise: data->${JSON.stringify(data)}`); console.log(`getAllSimMessages success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getAllSimMessages fail, promise: err->${JSON.stringify(err)}`); console.error(`getAllSimMessages failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -730,7 +730,7 @@ promise.then(data => { ...@@ -730,7 +730,7 @@ promise.then(data => {
setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void\>): void setCBConfig(options: CBConfigOptions, callback: AsyncCallback<void\>): void
设置小区广播配置,使用callback方式作为异步方法 设置小区广播配置。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -764,7 +764,7 @@ sms.setCBConfig(cbConfigOptions, (err, data) => { ...@@ -764,7 +764,7 @@ sms.setCBConfig(cbConfigOptions, (err, data) => {
setCBConfig(options: CBConfigOptions): Promise<void\> setCBConfig(options: CBConfigOptions): Promise<void\>
设置小区广播配置,使用Promise方式作为异步方法 设置小区广播配置。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -797,7 +797,7 @@ let promise = sms.setCBConfig(cbConfigOptions); ...@@ -797,7 +797,7 @@ let promise = sms.setCBConfig(cbConfigOptions);
promise.then(data => promise.then(data =>
console.log(`setCBConfig success, promise: data->${JSON.stringify(data)}`); console.log(`setCBConfig success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`setCBConfig fail, promise: err->${JSON.stringify(err)}`); console.error(`setCBConfig failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -805,7 +805,7 @@ promise.then(data => ...@@ -805,7 +805,7 @@ promise.then(data =>
getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback: AsyncCallback<SmsSegmentsInfo\>): void getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback: AsyncCallback<SmsSegmentsInfo\>): void
获取短信段信息,使用callback方式作为异步方法 获取短信段信息。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -816,9 +816,9 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback ...@@ -816,9 +816,9 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean, callback
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| --------- | ------------------------------------------------------------ | ---- | ----------------------------------------- | | --------- | ------------------------------------------------------------ | ---- | ----------------------------------------- |
| slotId | number | 是 | SIM卡槽ID:<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | SIM卡槽ID:<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| message | string | 是 | 消息 | | message | string | 是 | 消息 |
| force7bit | boolean | 是 | 是否使用7bit编码 | | force7bit | boolean | 是 | 是否使用7 bit编码。 |
| callback | AsyncCallback&lt;[SmsSegmentsInfo](#smssegmentsinfo8)&gt; | 是 | 回调函数 | | callback | AsyncCallback&lt;[SmsSegmentsInfo](#smssegmentsinfo8)&gt; | 是 | 回调函数 |
**示例:** **示例:**
...@@ -834,7 +834,7 @@ sms.getSmsSegmentsInfo(slotId, "message", false, (err, data) => { ...@@ -834,7 +834,7 @@ sms.getSmsSegmentsInfo(slotId, "message", false, (err, data) => {
getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise<SmsSegmentsInfo\> getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise<SmsSegmentsInfo\>
获取短信段信息,使用Promise方式作为异步方法 获取短信段信息。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -845,8 +845,8 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise ...@@ -845,8 +845,8 @@ getSmsSegmentsInfo(slotId: number, message: string, force7bit: boolean): Promise
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| --------- | ------- | ---- | ----------------------------------------- | | --------- | ------- | ---- | ----------------------------------------- |
| slotId | number | 是 | SIM卡槽ID:<br/>- 0:卡槽1<br/>- 1:卡槽2 | | slotId | number | 是 | SIM卡槽ID:<br/>- 0:卡槽1<br/>- 1:卡槽2 |
| message | string | 是 | 消息 | | message | string | 是 | 消息 |
| force7bit | boolean | 是 | 是否使用7bit编码 | | force7bit | boolean | 是 | 是否使用7 bit编码。 |
**返回值:** **返回值:**
...@@ -862,7 +862,7 @@ let promise = sms.getSmsSegmentsInfo(slotId, "message", false); ...@@ -862,7 +862,7 @@ let promise = sms.getSmsSegmentsInfo(slotId, "message", false);
promise.then(data => promise.then(data =>
console.log(`getSmsSegmentsInfo success, promise: data->${JSON.stringify(data)}`); console.log(`getSmsSegmentsInfo success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getSmsSegmentsInfo fail, promise: err->${JSON.stringify(err)}`); console.error(`getSmsSegmentsInfo failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -870,7 +870,7 @@ promise.then(data => ...@@ -870,7 +870,7 @@ promise.then(data =>
isImsSmsSupported(callback: AsyncCallback<boolean\>): void isImsSmsSupported(callback: AsyncCallback<boolean\>): void
如果IMS已注册并且在IMS上支持SMS,则支持通过IMS发送SMS,使用callback方式作为异步方法 如果IMS已注册并且在IMS上支持SMS,则支持通过IMS发送SMS。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -895,7 +895,7 @@ sms.isImsSmsSupported((err, data) => { ...@@ -895,7 +895,7 @@ sms.isImsSmsSupported((err, data) => {
isImsSmsSupported(): Promise<boolean\> isImsSmsSupported(): Promise<boolean\>
如果IMS已注册并且在IMS上支持SMS,则支持通过IMS发送SMS,使用Promise方式作为异步方法 如果IMS已注册并且在IMS上支持SMS,则支持通过IMS发送SMS。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -914,7 +914,7 @@ let promise = sms.isImsSmsSupported(); ...@@ -914,7 +914,7 @@ let promise = sms.isImsSmsSupported();
promise.then(data => { promise.then(data => {
console.log(`isImsSmsSupported success, promise: data->${JSON.stringify(data)}`); console.log(`isImsSmsSupported success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`isImsSmsSupported fail, promise: err->${JSON.stringify(err)}`); console.error(`isImsSmsSupported failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -922,7 +922,7 @@ promise.then(data => { ...@@ -922,7 +922,7 @@ promise.then(data => {
getImsShortMessageFormat(callback: AsyncCallback<string\>): void getImsShortMessageFormat(callback: AsyncCallback<string\>): void
获取IMS上支持的SMS格式,使用callback方式作为异步方法 获取IMS上支持的SMS格式。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -947,7 +947,7 @@ sms.getImsShortMessageFormat((err, data) => { ...@@ -947,7 +947,7 @@ sms.getImsShortMessageFormat((err, data) => {
getImsShortMessageFormat(): Promise<string\> getImsShortMessageFormat(): Promise<string\>
获取IMS上支持的SMS格式,使用Promise方式作为异步方法 获取IMS上支持的SMS格式。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -966,7 +966,7 @@ let promise = sms.getImsShortMessageFormat(); ...@@ -966,7 +966,7 @@ let promise = sms.getImsShortMessageFormat();
promise.then(data => { promise.then(data => {
console.log(`getImsShortMessageFormat success, promise: data->${JSON.stringify(data)}`); console.log(`getImsShortMessageFormat success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`getImsShortMessageFormat fail, promise: err->${JSON.stringify(err)}`); console.error(`getImsShortMessageFormat failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -974,7 +974,7 @@ promise.then(data => { ...@@ -974,7 +974,7 @@ promise.then(data => {
decodeMms(mmsFilePathName: string | Array<number\>, callback: AsyncCallback<MmsInformation\>): void decodeMms(mmsFilePathName: string | Array<number\>, callback: AsyncCallback<MmsInformation\>): void
彩信解码,使用callback方式作为异步方法 彩信解码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -984,7 +984,7 @@ decodeMms(mmsFilePathName: string | Array<number\>, callback: AsyncCallback<MmsI ...@@ -984,7 +984,7 @@ decodeMms(mmsFilePathName: string | Array<number\>, callback: AsyncCallback<MmsI
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| --------------- | ------------------------------------------------------- | ---- | -------------- | | --------------- | ------------------------------------------------------- | ---- | -------------- |
| mmsFilePathName | string \|Array<number\> | 是 | 彩信文件路径名 | | mmsFilePathName | string \|Array<number\> | 是 | 彩信文件路径名 |
| callback | AsyncCallback&lt;[MmsInformation](#mmsinformation8)&gt; | 是 | 回调函数。 | | callback | AsyncCallback&lt;[MmsInformation](#mmsinformation8)&gt; | 是 | 回调函数。 |
**示例:** **示例:**
...@@ -1001,7 +1001,7 @@ sms.decodeMms(mmsFilePathName, (err, data) => { ...@@ -1001,7 +1001,7 @@ sms.decodeMms(mmsFilePathName, (err, data) => {
decodeMms(mmsFilePathName: string | Array<number\>): Promise<MmsInformation\> decodeMms(mmsFilePathName: string | Array<number\>): Promise<MmsInformation\>
彩信解码,使用Promise方式作为异步方法 彩信解码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1027,7 +1027,7 @@ let promise = sms.getSmscAddr(mmsFilePathName); ...@@ -1027,7 +1027,7 @@ let promise = sms.getSmscAddr(mmsFilePathName);
promise.then(data => { promise.then(data => {
console.log(`decodeMms success, promise: data->${JSON.stringify(data)}`); console.log(`decodeMms success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`decodeMms fail, promise: err->${JSON.stringify(err)}`); console.error(`decodeMms failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1035,7 +1035,7 @@ promise.then(data => { ...@@ -1035,7 +1035,7 @@ promise.then(data => {
encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number\>>): void encodeMms(mms: MmsInformation, callback: AsyncCallback<Array<number\>>): void
彩信编码,使用callback方式作为异步方法 彩信编码。使用callback异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1070,7 +1070,7 @@ sms.encodeMms(mmsInformation, (err, data) => { ...@@ -1070,7 +1070,7 @@ sms.encodeMms(mmsInformation, (err, data) => {
encodeMms(mms: MmsInformation): Promise<Array<number\>> encodeMms(mms: MmsInformation): Promise<Array<number\>>
彩信编码,使用Promise方式作为异步方法 彩信编码。使用Promise异步回调
此接口为系统接口。 此接口为系统接口。
...@@ -1104,7 +1104,7 @@ let promise = sms.encodeMms(mmsInformation); ...@@ -1104,7 +1104,7 @@ let promise = sms.encodeMms(mmsInformation);
promise.then(data => { promise.then(data => {
console.log(`encodeMms success, promise: data->${JSON.stringify(data)}`); console.log(`encodeMms success, promise: data->${JSON.stringify(data)}`);
}).catch(err => { }).catch(err => {
console.error(`encodeMms fail, promise: err->${JSON.stringify(err)}`); console.error(`encodeMms failed, promise: err->${JSON.stringify(err)}`);
}); });
``` ```
...@@ -1176,7 +1176,7 @@ promise.then(data => { ...@@ -1176,7 +1176,7 @@ promise.then(data => {
## IDeliveryShortMessageCallback ## IDeliveryShortMessageCallback
回调实例返回短信送达报告。 回调实例返回短信送达报告。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Telephony.SmsMms。 **系统能力**:以下各项对应的系统能力均为SystemCapability.Telephony.SmsMms。
...@@ -1208,8 +1208,8 @@ promise.then(data => { ...@@ -1208,8 +1208,8 @@ promise.then(data => {
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ----------- | ------------------------------------------------------------ | ---- | --------- | | ----------- | ------------------------------------------------------------ | ---- | --------- |
| messageType | [MessageType](#messagetype8) | 是 | 消息类型 | | messageType | [MessageType](#messagetype8) | 是 | 消息类型 |
| mmsType | [MmsSendReq](#mmssendreq8) \|[MmsSendConf](#mmssendconf8) \|[MmsNotificationInd](#mmsnotificationind8) \|[MmsRespInd](#mmsrespind8) \|[MmsRetrieveConf](#mmsretrieveconf8)\|[MmsAcknowledgeInd](#mmsacknowledgeind8)\|[MmsDeliveryInd](#mmsdeliveryind8)\|[MmsReadOrigInd](#mmsreadorigind8)\|[MmsReadRecInd](#mmsreadrecind8) | 是 | pdu头类型 | | mmsType | [MmsSendReq](#mmssendreq8) \|[MmsSendConf](#mmssendconf8) \|[MmsNotificationInd](#mmsnotificationind8) \|[MmsRespInd](#mmsrespind8) \|[MmsRetrieveConf](#mmsretrieveconf8)\|[MmsAcknowledgeInd](#mmsacknowledgeind8)\|[MmsDeliveryInd](#mmsdeliveryind8)\|[MmsReadOrigInd](#mmsreadorigind8)\|[MmsReadRecInd](#mmsreadrecind8) | 是 | PDU头类型 |
| attachment | Array<[MmsAttachment](#mmsattachment8)\> | 否 | 附件 | | attachment | Array<[MmsAttachment](#mmsattachment8)\> | 否 | 附件 |
## MmsSendReq<sup>8+</sup> ## MmsSendReq<sup>8+</sup>
......
...@@ -323,6 +323,47 @@ decode(input: Uint8Array, options?: { stream?: false }): string ...@@ -323,6 +323,47 @@ decode(input: Uint8Array, options?: { stream?: false }): string
``` ```
### decodeWithStream<sup>9+</sup>
decodeWithStream(input: Uint8Array, options?: { stream?: boolean }): string
通过输入参数解码后输出对应文本。
**系统能力:** SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| input | Uint8Array | 是 | 符合格式需要解码的数组。 |
| options | Object | 否 | 解码相关选项参数。 |
**表2** options
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| stream | boolean | 否 | 在随后的decodeWithStream()调用中是否跟随附加数据块。如果以块的形式处理数据,则设置为true;如果处理最后的数据块或数据未分块,则设置为false。默认为false。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 解码后的数据。 |
**示例:**
```js
var textDecoder = new util.TextDecoder("utf-8",{ignoreBOM: true});
var result = new Uint8Array(6);
result[0] = 0xEF;
result[1] = 0xBB;
result[2] = 0xBF;
result[3] = 0x61;
result[4] = 0x62;
result[5] = 0x63;
console.log("input num:");
var retStr = textDecoder.decodeWithStream( result , {stream: false});
console.log("retStr = " + retStr);
```
## TextEncoder ## TextEncoder
### 属性 ### 属性
...@@ -2624,3 +2665,104 @@ isWeakSet(value: Object): boolean ...@@ -2624,3 +2665,104 @@ isWeakSet(value: Object): boolean
var that = new util.types(); var that = new util.types();
var result = that.isWeakSet(new WeakSet()); var result = that.isWeakSet(new WeakSet());
``` ```
### isBigInt64Array<sup>8+</sup>
isBigInt64Array(value: Object): boolean
检查输入的value是否是BigInt64Array类型。
**系统能力:** SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的BigInt64Array类型为true,反之为false。 |
**示例:**
```js
var that = new util.types();
var result = that.isBigInt64Array(new BigInt64Array([]));
```
### isBigUint64Array<sup>8+</sup>
isBigUint64Array(value: Object): boolean
检查输入的value是否是BigUint64Array类型。
**系统能力:** SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的BigUint64Array类型为true,反之为false。 |
**示例:**
```js
var that = new util.types();
var result = that.isBigUint64Array(new BigUint64Array([]));
```
### isModuleNamespaceObject<sup>8+</sup>
isModuleNamespaceObject(value: Object): boolean
检查输入的value是否是Module Namespace Object类型。
**系统能力:** SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Module Namespace Object类型为true,反之为false。 |
**示例:**
```js
import url from '@ohos.url'
var that = new util.types();
var result = that.isModuleNamespaceObject(url);
```
### isSharedArrayBuffer<sup>8+</sup>
isSharedArrayBuffer(value: Object): boolean
检查输入的value是否是SharedArrayBuffer类型。
**系统能力:** SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的SharedArrayBuffer类型为true,反之为false。 |
**示例:**
```js
var that = new util.types();
var result = that.isSharedArrayBuffer(new SharedArrayBuffer([]));
```
\ No newline at end of file
...@@ -224,6 +224,7 @@ import window from '@ohos.window'; ...@@ -224,6 +224,7 @@ import window from '@ohos.window';
| isPrivacyMode<sup>7+</sup> | boolean | 是 | 是 | 隐私模式,默认为false。 | | isPrivacyMode<sup>7+</sup> | boolean | 是 | 是 | 隐私模式,默认为false。 |
| isRoundCorner<sup>(deprecated)</sup> | boolean | 是 | 是 | 窗口是否为圆角。默认为false。<br>- **说明:** 从API version 9开始废弃。<br/>- 从 API version 7开始支持 | | isRoundCorner<sup>(deprecated)</sup> | boolean | 是 | 是 | 窗口是否为圆角。默认为false。<br>- **说明:** 从API version 9开始废弃。<br/>- 从 API version 7开始支持 |
| isTransparent<sup>7+</sup> | boolean | 是 | 是 | 窗口是否透明。默认为false。 | | isTransparent<sup>7+</sup> | boolean | 是 | 是 | 窗口是否透明。默认为false。 |
| id<sup>9+</sup> | number | 是 | 否 | 窗口ID,默认值为0.0。 |
## ColorSpace<sup>8+</sup> ## ColorSpace<sup>8+</sup>
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
- [GridItem](ts-container-griditem.md) - [GridItem](ts-container-griditem.md)
- [List](ts-container-list.md) - [List](ts-container-list.md)
- [ListItem](ts-container-listitem.md) - [ListItem](ts-container-listitem.md)
- [ListItemGroup](ts-container-listitemgroup.md)
- [Navigator](ts-container-navigator.md) - [Navigator](ts-container-navigator.md)
- [Panel](ts-container-panel.md) - [Panel](ts-container-panel.md)
- [Refresh](ts-container-refresh.md) - [Refresh](ts-container-refresh.md)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
## 子组件 ## 子组件
包含[ListItem](ts-container-listitem.md)子组件。 包含[ListItem](ts-container-listitem.md)[ListItemGroup](ts-container-listitemgroup.md)子组件。
## 接口 ## 接口
...@@ -44,8 +44,9 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller} ...@@ -44,8 +44,9 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller}
| restoreId<sup>8+</sup> | number | - | 组件迁移标识符,标识后的组件在应用迁移时,组件状态会被迁移到被拉起方的同标识组件。<br/>列表组件状态,包括起始位置显示的item序号。 | | restoreId<sup>8+</sup> | number | - | 组件迁移标识符,标识后的组件在应用迁移时,组件状态会被迁移到被拉起方的同标识组件。<br/>列表组件状态,包括起始位置显示的item序号。 |
| lanes<sup>9+</sup> | number \|<br>{<br/>minLength: Length,<br/>maxLength: Length<br/>} | 1 | 以列模式为例(listDirection为Axis.Vertical):<br/>lanes用于决定List组件在交叉轴方向按几列布局,规则如下:<br/>- lanes为指定的数量时,根据指定的数量与List组件的交叉轴宽度来决定每列的宽度;<br/>- lane设置了{minLength,maxLength}时,根据List组件的宽度自适应决定lanes数量(即列数),保证缩放过程中lane的宽度符合{minLength,maxLength}的限制。其中,minLength条件会被优先满足,即优先保证符合ListItem的宽度符合最小宽度限制。例如在列模式下,设置了{minLength: 40vp,maxLength: 60vp},则当List组件宽度为70vp时,ListItem为一列,并且根据alignListItem属性做靠左、居中或者靠右布局;当List组件宽度变化至80vp时,符合两倍的minLength,则ListItem自适应为两列。 | | lanes<sup>9+</sup> | number \|<br>{<br/>minLength: Length,<br/>maxLength: Length<br/>} | 1 | 以列模式为例(listDirection为Axis.Vertical):<br/>lanes用于决定List组件在交叉轴方向按几列布局,规则如下:<br/>- lanes为指定的数量时,根据指定的数量与List组件的交叉轴宽度来决定每列的宽度;<br/>- lane设置了{minLength,maxLength}时,根据List组件的宽度自适应决定lanes数量(即列数),保证缩放过程中lane的宽度符合{minLength,maxLength}的限制。其中,minLength条件会被优先满足,即优先保证符合ListItem的宽度符合最小宽度限制。例如在列模式下,设置了{minLength: 40vp,maxLength: 60vp},则当List组件宽度为70vp时,ListItem为一列,并且根据alignListItem属性做靠左、居中或者靠右布局;当List组件宽度变化至80vp时,符合两倍的minLength,则ListItem自适应为两列。 |
| alignListItem<sup>9+</sup> | ListItemAlign | ListItemAlign.Center | List交叉轴方向宽度大于ListItem交叉轴宽度 * lanes时,ListItem在List交叉轴方向的布局方式,默认为居中。 | | alignListItem<sup>9+</sup> | ListItemAlign | ListItemAlign.Center | List交叉轴方向宽度大于ListItem交叉轴宽度 * lanes时,ListItem在List交叉轴方向的布局方式,默认为居中。 |
| sticky<sup>9+</sup> | StickyStyle | StickyStyle.None | 配合[ListItemGroup](ts-container-listitemgroup.md)组件使用,设置ListItemGroup中header和footer是否要吸顶或吸底,参见StickyStyle的枚举说明。|
- ListItemAlign枚举说明 - ListItemAlign<sup>9+</sup>枚举说明
| 名称 | 描述 | | 名称 | 描述 |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
...@@ -53,6 +54,15 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller} ...@@ -53,6 +54,15 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller}
| Center | ListItem在List中,交叉轴方向居中对齐。 | | Center | ListItem在List中,交叉轴方向居中对齐。 |
| End | ListItem在List中,交叉轴方向尾部对齐。 | | End | ListItem在List中,交叉轴方向尾部对齐。 |
- StickyStyle<sup>9+</sup>枚举说明
| 名称 | 描述 |
| ------ | -------------------------------------- |
| None | ListItemGroup的header不吸顶,footer不吸底。 |
| Header | ListItemGroup的header吸顶。 |
| Footer | ListItemGroup的footer吸底。 |
sticky属性可以设置为 StickyStyle.Header | StickyStyle.Footer 以同时支持header吸顶和footer吸底。
## 事件 ## 事件
......
# ListItemGroup
该组件用来展示列表item分组,宽度默认充满[List](ts-container-list.md)组件,必须配合List组件来使用。
> **说明:**
>
> 该组件从API Version 9开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 权限列表
## 子组件
包含[ListItem](ts-container-listitem.md)子组件。
## 接口
ListItemGroup(options?: {header?: CustomBuilder, footer?: CustomBuilder, space?: number | string}})
**参数:**
| 参数名 | 参数类型 | 必填 | 参数描述 |
| -------- | -------- | -------- | -------- |
| header | [CustomBuilder](../../ui/ts-types.md#custombuilder8) | 否 | 设置ListItemGroup头部组件。 |
| footer | [CustomBuilder](../../ui/ts-types.md#custombuilder8) | 否 | 设置ListItemGroup尾部组件。 |
| space | number&nbsp;\|&nbsp;string | 否 | 列表项间距。 |
## 属性
| 名称 | 参数类型 | 描述 |
| -------- | -------- | -------- |
| divider | {<br/>strokeWidth:&nbsp;[Length](../../ui/ts-types.md#length),<br/>color?:&nbsp;[ResourceColor](../../ui/ts-types.md#resourcecolor8),<br/>startMargin?:&nbsp;[Length](../../ui/ts-types.md#length),<br/>endMargin?:&nbsp;[Length](../../ui/ts-types.md#length)<br/>}&nbsp;\|&nbsp;null | 用于设置ListItem分割线样式,默认无分割线。<br/>strokeWidth:&nbsp;分割线的线宽。<br/>color:&nbsp;分割线的颜色。<br/>startMargin:&nbsp;分割线距离列表侧边起始端的距离。<br/>endMargin:&nbsp;分割线距离列表侧边结束端的距离。 |
## 示例
```ts
// xxx.ets
function itemHeadBuilder(text: string) {
@Builder function itemHead() {
Text(text)
.fontSize(20)
.backgroundColor(0xAABBCC)
.width("100%")
.padding(10)
}
return itemHead
}
function itemFootBuilder(num: number) {
@Builder function itemFoot() {
Text('' + num + "节课")
.fontSize(16)
.backgroundColor(0xAABBCC)
.width("100%")
.padding(5)
}
return itemFoot
}
@Entry
@Component
struct ListItemGroupExample {
private timetable: any = [
{
title:'星期一',
projects:['语文', '数学', '英语']
},
{
title:'星期二',
projects:['物理', '化学', '生物']
},
{
title:'星期三',
projects:['历史', '地理', '政治']
},
{
title:'星期四',
projects:['美术', '音乐', '体育']
}
]
build() {
Column() {
List({ space: 20 }) {
ForEach(this.timetable, (item) => {
ListItemGroup({ header:itemHeadBuilder(item.title), footer:itemFootBuilder(item.projects.length) }) {
ForEach(item.projects, (project) => {
ListItem() {
Text(project)
.width("100%").height(100).fontSize(20)
.textAlign(TextAlign.Center).backgroundColor(0xFFFFFF)
}
}, item => item)
}
.borderRadius(20)
.divider({ strokeWidth: 1, color: 0xDCDCDC }) // 每行之间的分界线
})
}
.width('90%')
.sticky(StickyStyle.Header|StickyStyle.Footer)
}.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 })
}
}
```
![zh-cn_image_0000001219864159](figures/zh-cn_image_listitemgroup.gif)
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
| 名称 | 支持冒泡 | 功能描述 | | 名称 | 支持冒泡 | 功能描述 |
| ---------------------------------------- | ---- | ---------------------------------------- | | ---------------------------------------- | ---- | ---------------------------------------- |
| onDragStart(callback:&nbsp;(event:&nbsp;DragEvent,&nbsp;extraParams?:&nbsp;string)&nbsp;=&gt;&nbsp;&nbsp;[CustomBuilder](../../ui/ts-types.md)) | 否 | 第一次拖拽此事件绑定的组件时,触发回调。<br/>- event:拖拽事件信息,包括拖拽点坐标。<br/>- extraParams:拖拽事件额外信息,详见extraParam类型描述。<br/>返回值:当前跟手效果所拖拽的对象,用于显示拖拽时的提示组件。<br/>长按150毫秒(ms)可触发拖拽事件。优先级:长按手势配置时间小于等于150毫秒(ms)时,长按手势优先触发,否则拖拽事件优先触发。 | | onDragStart(event:&nbsp;(event?:&nbsp;DragEvent,&nbsp;extraParams?:&nbsp;string)&nbsp;=&gt;&nbsp;&nbsp;[CustomBuilder](../../ui/ts-types.md)) | 否 | 第一次拖拽此事件绑定的组件时,触发回调。<br/>- event:拖拽事件信息,包括拖拽点坐标。<br/>- extraParams:拖拽事件额外信息,详见extraParam类型描述。<br/>返回值:当前跟手效果所拖拽的对象,用于显示拖拽时的提示组件。<br/>长按150毫秒(ms)可触发拖拽事件。优先级:长按手势配置时间小于等于150毫秒(ms)时,长按手势优先触发,否则拖拽事件优先触发。 |
| onDragEnter(callback:&nbsp;(event:&nbsp;DragEvent,&nbsp;extraParams?:&nbsp;string)&nbsp;=&gt;&nbsp;void) | 否 | 拖拽进入组件范围内时,触发回调。<br/>- event:拖拽事件信息,包括拖拽点坐标。<br/>- extraParams:拖拽事件额外信息,详见extraParam类型描述。<br/>当监听了onDrop事件时,此事件才有效。 | | onDragEnter(event:&nbsp;(event?:&nbsp;DragEvent,&nbsp;extraParams?:&nbsp;string)&nbsp;=&gt;&nbsp;void) | 否 | 拖拽进入组件范围内时,触发回调。<br/>- event:拖拽事件信息,包括拖拽点坐标。<br/>- extraParams:拖拽事件额外信息,详见extraParam类型描述。<br/>当监听了onDrop事件时,此事件才有效。 |
| onDragMove(callback:&nbsp;(event:&nbsp;DragEvent,&nbsp;extraParams?:&nbsp;string)&nbsp;=&gt;&nbsp;void) | 否 | 拖拽在组件范围内移动时,触发回调。<br/>- event:拖拽事件信息,包括拖拽点坐标。<br/>- extraParams:拖拽事件额外信息,详见extraParam类型描述。<br/>当监听了onDrop事件时,此事件才有效。 | | onDragMove(event:&nbsp;(event?:&nbsp;DragEvent,&nbsp;extraParams?:&nbsp;string)&nbsp;=&gt;&nbsp;void) | 否 | 拖拽在组件范围内移动时,触发回调。<br/>- event:拖拽事件信息,包括拖拽点坐标。<br/>- extraParams:拖拽事件额外信息,详见extraParam类型描述。<br/>当监听了onDrop事件时,此事件才有效。 |
| onDragLeave(callback:&nbsp;(event:&nbsp;DragEvent,&nbsp;extraParams?:&nbsp;string)&nbsp;=&gt;&nbsp;void) | 否 | 拖拽离开组件范围内时,触发回调。<br/>- event:拖拽事件信息,包括拖拽点坐标。<br/>- extraParams:拖拽事件额外信息,详见extraParam类型描述。<br/>当监听了onDrop事件时,此事件才有效。 | | onDragLeave(event:&nbsp;(event?:&nbsp;DragEvent,&nbsp;extraParams?:&nbsp;string)&nbsp;=&gt;&nbsp;void) | 否 | 拖拽离开组件范围内时,触发回调。<br/>- event:拖拽事件信息,包括拖拽点坐标。<br/>- extraParams:拖拽事件额外信息,详见extraParam类型描述。<br/>当监听了onDrop事件时,此事件才有效。 |
| onDrop(callback:&nbsp;(event:&nbsp;DragEvent,&nbsp;extraParams?:&nbsp;string)&nbsp;=&gt;&nbsp;void) | 否 | 绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。<br/>- event:拖拽事件信息,包括拖拽点坐标。<br/>- extraParams:拖拽事件额外信息,详见extraParam类型描述。 | | onDrop(event:&nbsp;(event?:&nbsp;DragEvent,&nbsp;extraParams?:&nbsp;string)&nbsp;=&gt;&nbsp;void) | 否 | 绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。<br/>- event:拖拽事件信息,包括拖拽点坐标。<br/>- extraParams:拖拽事件额外信息,详见extraParam类型描述。 |
- extraParam说明<br> - extraParam说明<br>
用于返回组件在拖拽中需要用到的额外信息。 用于返回组件在拖拽中需要用到的额外信息。
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
| 名称 | 支持冒泡 | 描述 | | 名称 | 支持冒泡 | 描述 |
| ---------------------------------------- | ---- | ---------------------------------------- | | ---------------------------------------- | ---- | ---------------------------------------- |
| onHover(callback:&nbsp;(isHover:&nbsp;boolean)&nbsp;=&gt;&nbsp;void) | 否 | 鼠标进入或退出组件时触发该回调。<br/>isHover:表示鼠标是否悬浮在组件上,鼠标进入时为true,&nbsp;退出时为false。 | | onHover(callback:&nbsp;(isHover?:&nbsp;boolean)&nbsp;=&gt;&nbsp;void) | 否 | 鼠标进入或退出组件时触发该回调。<br/>isHover:表示鼠标是否悬浮在组件上,鼠标进入时为true,&nbsp;退出时为false。 |
| onMouse(callback:&nbsp;(event?:&nbsp;MouseEvent)&nbsp;=&gt;&nbsp;void) | 是 | 当前组件被鼠标按键点击时或者鼠标在组件上移动时,触发该回调,event参数包含触发事件时的时间戳、鼠标按键、动作、点击触点在整个屏幕上的坐标和点击触点相对于当前组件的坐标。 | | onMouse(callback:&nbsp;(event?:&nbsp;MouseEvent)&nbsp;=&gt;&nbsp;void) | 是 | 当前组件被鼠标按键点击时或者鼠标在组件上移动时,触发该回调,event参数包含触发事件时的时间戳、鼠标按键、动作、点击触点在整个屏幕上的坐标和点击触点相对于当前组件的坐标。 |
......
...@@ -108,7 +108,7 @@ ATM(AccessTokenManager)是OpenHarmony上基于AccessToken构建的统一的 ...@@ -108,7 +108,7 @@ ATM(AccessTokenManager)是OpenHarmony上基于AccessToken构建的统一的
system_core权限涉及到开放操作系统核心资源的访问操作。这部分系统资源是系统最核心的底层服务,如果遭受破坏,操作系统将无法正常运行。 system_core权限涉及到开放操作系统核心资源的访问操作。这部分系统资源是系统最核心的底层服务,如果遭受破坏,操作系统将无法正常运行。
鉴于该类型权限对系统的影响程度非常大,目前暂不向任何应用开放。 鉴于该类型权限对系统的影响程度非常大,目前暂不向任何三方应用开放。
## 权限类型说明 ## 权限类型说明
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
权限的使用示例请参考[访问控制开发指导](accesstoken-guidelines.md) 权限的使用示例请参考[访问控制开发指导](accesstoken-guidelines.md)
| 权限名 | 权限级别 | 授权方式 | ACL使能 | 权限说明 | | 权限名 | 权限级别 | 授权方式 | ACL使能 | 权限说明 |
| -------------------------------------------------------- | ------------ | ------------ | ------- | ------------------------------------------------------------ | | -------------------------------------------------------- | ------------ | ------------ | ------- | ------------------------------------------- |
| ohos.permission.USE_BLUETOOTH | normal | system_grant | TRUE | 允许应用查看蓝牙的配置。 | | ohos.permission.USE_BLUETOOTH | normal | system_grant | TRUE | 允许应用查看蓝牙的配置。 |
| ohos.permission.DISCOVER_BLUETOOTH | normal | system_grant | TRUE | 允许应用配置本地蓝牙,查找远端设备且与之配对连接。 | | ohos.permission.DISCOVER_BLUETOOTH | normal | system_grant | TRUE | 允许应用配置本地蓝牙,查找远端设备且与之配对连接。 |
| ohos.permission.MANAGE_BLUETOOTH | system_basic | system_grant | TRUE | 允许应用配对蓝牙设备,并对设备的电话簿或消息进行访问。 | | ohos.permission.MANAGE_BLUETOOTH | system_basic | system_grant | TRUE | 允许应用配对蓝牙设备,并对设备的电话簿或消息进行访问。 |
| ohos.permission.INTERNET | normal | system_grant | TRUE | 允许使用Internet网络。 | | ohos.permission.INTERNET | normal | system_grant | TRUE | 允许使用Internet网络。 |
| ohos.permission.MODIFY_AUDIO_SETTINGS | normal | system_grant | TRUE | 允许应用修改音频设置。 | | ohos.permission.<br>MODIFY_AUDIO_SETTINGS | normal | system_grant | TRUE | 允许应用修改音频设置。 |
| ohos.permission.ACCESS_NOTIFICATION_POLICY | normal | system_grant | FALSE | 在本设备上允许应用访问通知策略。 | | ohos.permission.<br>ACCESS_NOTIFICATION_POLICY | normal | system_grant | FALSE | 在本设备上允许应用访问通知策略。 |
| ohos.permission.GET_TELEPHONY_STATE | system_basic | system_grant | TRUE | 允许应用读取电话信息。 | | ohos.permission.GET_TELEPHONY_STATE | system_basic | system_grant | TRUE | 允许应用读取电话信息。 |
| ohos.permission.REQUIRE_FORM | system_basic | system_grant | TRUE | 允许应用获取Ability Form。 | | ohos.permission.REQUIRE_FORM | system_basic | system_grant | TRUE | 允许应用获取Ability Form。 |
| ohos.permission.GET_NETWORK_INFO | normal | system_grant | TRUE | 允许应用获取数据网络信息。 | | ohos.permission.GET_NETWORK_INFO | normal | system_grant | TRUE | 允许应用获取数据网络信息。 |
...@@ -22,59 +22,59 @@ ...@@ -22,59 +22,59 @@
| ohos.permission.RUNNING_LOCK | normal | system_grant | TRUE | 允许应用获取运行锁,保证应用在后台的持续运行。 | | ohos.permission.RUNNING_LOCK | normal | system_grant | TRUE | 允许应用获取运行锁,保证应用在后台的持续运行。 |
| ohos.permission.SET_TIME | system_basic | system_grant | TRUE | 允许应用修改系统时间。 | | ohos.permission.SET_TIME | system_basic | system_grant | TRUE | 允许应用修改系统时间。 |
| ohos.permission.SET_TIME_ZONE | system_basic | system_grant | TRUE | 允许应用修改系统时区。 | | ohos.permission.SET_TIME_ZONE | system_basic | system_grant | TRUE | 允许应用修改系统时区。 |
| ohos.permission.DOWNLOAD_SESSION_MANAGER | system_core | system_grant | TRUE | 允许应用管理下载任务会话。 | | ohos.permission.<br>DOWNLOAD_SESSION_MANAGER | system_core | system_grant | TRUE | 允许应用管理下载任务会话。 |
| ohos.permission.COMMONEVENT_STICKY | normal | system_grant | TRUE | 允许应用发布粘性公共事件。 | | ohos.permission.COMMONEVENT_STICKY | normal | system_grant | TRUE | 允许应用发布粘性公共事件。 |
| ohos.permission.SYSTEM_FLOAT_WINDOW | normal | system_grant | TRUE | 允许应用使用悬浮窗的能力。 | | ohos.permission.SYSTEM_FLOAT_WINDOW | normal | system_grant | TRUE | 允许应用使用悬浮窗的能力。 |
| ohos.permission.POWER_MANAGER | system_core | system_grant | TRUE | 允许应用调用电源管理子系统的接口,休眠或者唤醒设备。 | | ohos.permission.POWER_MANAGER | system_core | system_grant | TRUE | 允许应用调用电源管理子系统的接口,休眠或者唤醒设备。 |
| ohos.permission.REFRESH_USER_ACTION | system_basic | system_grant | TRUE | 允许应用在收到用户事件时,重新计算超时时间。 | | ohos.permission.REFRESH_USER_ACTION | system_basic | system_grant | TRUE | 允许应用在收到用户事件时,重新计算超时时间。 |
| ohos.permission.POWER_OPTIMIZATION | system_basic | system_grant | TRUE | 允许系统应用设置省电模式、获取省电模式的配置信息并接收配置变化的通知。 | | ohos.permission.POWER_OPTIMIZATION | system_basic | system_grant | TRUE | 允许系统应用设置省电模式、获取省电模式的配置信息并接收配置变化的通知。 |
| ohos.permission.REBOOT_RECOVERY | system_basic | system_grant | TRUE | 允许系统应用重启设备并进入恢复模式。 | | ohos.permission.REBOOT_RECOVERY | system_basic | system_grant | TRUE | 允许系统应用重启设备并进入恢复模式。 |
| ohos.permission.MANAGE_LOCAL_ACCOUNTS | system_basic | system_grant | TRUE | 允许应用管理本地用户账号。 | | ohos.permission.<br>MANAGE_LOCAL_ACCOUNTS | system_basic | system_grant | TRUE | 允许应用管理本地用户账号。 |
| ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | system_basic | system_grant | TRUE | 允许多个系统账号之间相互访问。 | | ohos.permission.<br>INTERACT_ACROSS_LOCAL_ACCOUNTS | system_basic | system_grant | TRUE | 允许多个系统账号之间相互访问。 |
| ohos.permission.VIBRATE | normal | system_grant | TRUE | 允许应用控制马达振动。 | | ohos.permission.VIBRATE | normal | system_grant | TRUE | 允许应用控制马达振动。 |
| ohos.permission.CONNECT_IME_ABILITY | system_core | system_grant | TRUE | 允许绑定输入法Ability(InputMethodAbility)。 | | ohos.permission.CONNECT_IME_ABILITY | system_core | system_grant | TRUE | 允许绑定输入法Ability(InputMethodAbility)。 |
| ohos.permission.CONNECT_SCREEN_SAVER_ABILITY | system_core | system_grant | TRUE | 允许绑定屏保Ability(ScreenSaverAbility)。 | | ohos.permission.<br>CONNECT_SCREEN_SAVER_ABILITY | system_core | system_grant | TRUE | 允许绑定屏保Ability(ScreenSaverAbility)。 |
| ohos.permission.READ_SCREEN_SAVER | system_basic | system_grant | TRUE | 允许应用查询屏保状态信息。 | | ohos.permission.<br>READ_SCREEN_SAVER | system_basic | system_grant | TRUE | 允许应用查询屏保状态信息。 |
| ohos.permission.WRITE_SCREEN_SAVER | system_basic | system_grant | TRUE | 允许应用修改屏保状态信息。 | | ohos.permission.<br>WRITE_SCREEN_SAVER | system_basic | system_grant | TRUE | 允许应用修改屏保状态信息。 |
| ohos.permission.SET_WALLPAPER | normal | system_grant | TRUE | 允许应用设置静态壁纸。 | | ohos.permission.SET_WALLPAPER | normal | system_grant | TRUE | 允许应用设置静态壁纸。 |
| ohos.permission.GET_WALLPAPER | system_basic | system_grant | TRUE | 允许应用读取壁纸文件。 | | ohos.permission.GET_WALLPAPER | system_basic | system_grant | TRUE | 允许应用读取壁纸文件。 |
| ohos.permission.CHANGE_ABILITY_ENABLED_STATE | system_basic | system_grant | TRUE | 允许改变应用或者组件的使能状态。 | | ohos.permission.<br>CHANGE_ABILITY_ENABLED_STATE | system_basic | system_grant | TRUE | 允许改变应用或者组件的使能状态。 |
| ohos.permission.ACCESS_MISSIONS | system_basic | system_grant | TRUE | 允许应用访问任务栈信息。 | | ohos.permission.ACCESS_MISSIONS | system_basic | system_grant | TRUE | 允许应用访问任务栈信息。 |
| ohos.permission.CLEAN_BACKGROUND_PROCESSES | normal | system_grant | TRUE | 允许应用根据包名清理相关后台进程。 | | ohos.permission.<br>CLEAN_BACKGROUND_PROCESSES | normal | system_grant | TRUE | 允许应用根据包名清理相关后台进程。 |
| ohos.permission.KEEP_BACKGROUND_RUNNING | normal | system_grant | TRUE | 允许Service Ability在后台持续运行。 | | ohos.permission.<br>KEEP_BACKGROUND_RUNNING | normal | system_grant | TRUE | 允许Service Ability在后台持续运行。 |
| ohos.permission.UPDATE_CONFIGURATION | system_basic | system_grant | TRUE | 允许更新系统配置。 | | ohos.permission.<br>UPDATE_CONFIGURATION | system_basic | system_grant | TRUE | 允许更新系统配置。 |
| ohos.permission.UPDATE_SYSTEM | system_basic | system_grant | TRUE | 允许调用升级接口。 | | ohos.permission.UPDATE_SYSTEM | system_basic | system_grant | TRUE | 允许调用升级接口。 |
| ohos.permission.FACTORY_RESET | system_basic | system_grant | TRUE | 允许调用回复出厂接口。 | | ohos.permission.FACTORY_RESET | system_basic | system_grant | TRUE | 允许调用回复出厂接口。 |
| ohos.permission.GRANT_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用为其他应用授予敏感权限。 | | ohos.permission.<br>GRANT_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用为其他应用授予敏感权限。 |
| ohos.permission.REVOKE_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用撤销给其他应用授予的敏感信息。 | | ohos.permission.<br>REVOKE_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用撤销给其他应用授予的敏感信息。 |
| ohos.permission.GET_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用读取其他应用的敏感权限的状态。 | | ohos.permission.<br>GET_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用读取其他应用的敏感权限的状态。 |
| ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION | system_core | system_grant | TRUE | 允许应用跨用户对其他应用的属性进行设置。 | | ohos.permission.INTERACT_<br>ACROSS_LOCAL_ACCOUNTS_EXTENSION | system_core | system_grant | TRUE | 允许应用跨用户对其他应用的属性进行设置。 |
| ohos.permission.LISTEN_BUNDLE_CHANGE | system_basic | system_grant | TRUE | 允许应用监听其他应用安装、更新、卸载状态的变化。 | | ohos.permission.LISTEN_BUNDLE_CHANGE | system_basic | system_grant | TRUE | 允许应用监听其他应用安装、更新、卸载状态的变化。 |
| ohos.permission.GET_BUNDLE_INFO | normal | system_grant | TRUE | 允许应用查询其他应用的信息。 | | ohos.permission.GET_BUNDLE_INFO | normal | system_grant | TRUE | 允许应用查询其他应用的信息。 |
| ohos.permission.ACCELEROMETER | normal | system_grant | TRUE | 允许应用读取加速度传感器的数据。 | | ohos.permission.ACCELEROMETER | normal | system_grant | TRUE | 允许应用读取加速度传感器的数据。 |
| ohos.permission.GYROSCOPE | normal | system_grant | TRUE | 允许应用读取陀螺仪传感器的数据。 | | ohos.permission.GYROSCOPE | normal | system_grant | TRUE | 允许应用读取陀螺仪传感器的数据。 |
| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | system_grant | TRUE | 允许应用查询其他应用的信息。 | | ohos.permission.<br>GET_BUNDLE_INFO_PRIVILEGED | system_basic | system_grant | TRUE | 允许应用查询其他应用的信息。 |
| ohos.permission.INSTALL_BUNDLE | system_core | system_grant | TRUE | 允许应用安装、卸载其他应用。 | | ohos.permission.INSTALL_BUNDLE | system_core | system_grant | TRUE | 允许应用安装、卸载其他应用。 |
| ohos.permission.MANAGE_SHORTCUTS | system_core | system_grant | TRUE | 允许应用查询其他应用的快捷方式信息、启动其他应用的快捷方式。 | | ohos.permission.MANAGE_SHORTCUTS | system_core | system_grant | TRUE | 允许应用查询其他应用的快捷方式信息、启动其他应用的快捷方式。 |
| ohos.permission.radio.ACCESS_FM_AM | system_core | system_grant | TRUE | 允许应用获取收音机相关服务。 | | ohos.permission.radio.ACCESS_FM_AM | system_core | system_grant | TRUE | 允许应用获取收音机相关服务。 |
| ohos.permission.SET_TELEPHONY_STATE | system_basic | system_grant | TRUE | 允许应用修改telephone的状态。 | | ohos.permission.SET_TELEPHONY_STATE | system_basic | system_grant | TRUE | 允许应用修改telephone的状态。 |
| ohos.permission.START_ABILITIES_FROM_BACKGROUND | system_basic | system_grant | TRUE | 允许应用在后台启动FA。 | | ohos.permission.<br>START_ABILIIES_FROM_BACKGROUND | system_basic | system_grant | TRUE | 允许应用在后台启动FA。 |
| ohos.permission.BUNDLE_ACTIVE_INFO | system_basic | system_grant | TRUE | 允许系统应用查询其他应用在前台或后台的运行时间。 | | ohos.permission.BUNDLE_ACTIVE_INFO | system_basic | system_grant | TRUE | 允许系统应用查询其他应用在前台或后台的运行时间。 |
| ohos.permission.START_INVISIBLE_ABILITY | system_core | system_grant | TRUE | 无论Ability是否可见,都允许应用进行调用。 | | ohos.permission.<br>START_INVISIBLE_ABILITY | system_core | system_grant | TRUE | 无论Ability是否可见,都允许应用进行调用。 |
| ohos.permission.sec.ACCESS_UDID | system_basic | system_grant | TRUE | 允许系统应用获取UDID。 | | ohos.permission.sec.ACCESS_UDID | system_basic | system_grant | TRUE | 允许系统应用获取UDID。 |
| ohos.permission.LAUNCH_DATA_PRIVACY_CENTER | system_basic | system_grant | TRUE | 允许应用从其隐私声明页面跳转至"数据与隐私"页面。 | | ohos.permission.<br>LAUNCH_DATA_PRIVACY_CENTER | system_basic | system_grant | TRUE | 允许应用从其隐私声明页面跳转至"数据与隐私"页面。 |
| ohos.permission.MANAGE_MEDIA_RESOURCES | system_basic | system_grant | TRUE | 允许应用程序获取当前设备正在播放的媒体资源,并对其进行管理。 | | ohos.permission.MANAGE_MEDIA_RESOURCES | system_basic | system_grant | TRUE | 允许应用程序获取当前设备正在播放的媒体资源,并对其进行管理。 |
| ohos.permission.PUBLISH_AGENT_REMINDER | normal | system_grant | TRUE | 允许该应用使用后台代理提醒。 | | ohos.permission.PUBLISH_AGENT_REMINDER | normal | system_grant | TRUE | 允许该应用使用后台代理提醒。 |
| ohos.permission.CONTROL_TASK_SYNC_ANIMATOR | system_core | system_grant | TRUE | 允许应用使用同步任务动画。 | | ohos.permission.<br>CONTROL_TASK_SYNC_ANIMATOR | system_core | system_grant | TRUE | 允许应用使用同步任务动画。 |
| ohos.permission.INPUT_MONITORING | system_core | system_grant | TRUE | 允许应用监听输入事件,仅系统签名应用可申请此权限。 | | ohos.permission.INPUT_MONITORING | system_core | system_grant | TRUE | 允许应用监听输入事件,仅系统签名应用可申请此权限。 |
| ohos.permission.MANAGE_MISSIONS | system_core | system_grant | TRUE | 允许用户管理元能力任务栈。 | | ohos.permission.MANAGE_MISSIONS | system_core | system_grant | TRUE | 允许用户管理元能力任务栈。 |
| ohos.permission.NOTIFICATION_CONTROLLER | system_core | system_grant | TRUE | 允许应用管理通知和订阅通知。 | | ohos.permission.<br>NOTIFICATION_CONTROLLER | system_core | system_grant | TRUE | 允许应用管理通知和订阅通知。 |
| ohos.permission.CONNECTIVITY_INTERNAL | system_basic | system_grant | TRUE | 允许应用程序获取网络相关的信息或修改网络相关设置。 | | ohos.permission.CONNECTIVITY_INTERNAL | system_basic | system_grant | TRUE | 允许应用程序获取网络相关的信息或修改网络相关设置。 |
| ohos.permission.SET_ABILITY_CONTROLLER | system_basic | system_grant | TRUE | 允许设置ability组件启动和停止控制权。 | | ohos.permission.SET_ABILITY_CONTROLLER | system_basic | system_grant | TRUE | 允许设置ability组件启动和停止控制权。 |
| ohos.permission.USE_USER_IDM | system_basic | system_grant | FALSE | 允许应用访问系统身份凭据信息。 | | ohos.permission.USE_USER_IDM | system_basic | system_grant | FALSE | 允许应用访问系统身份凭据信息。 |
| ohos.permission.MANAGE_USER_IDM | system_basic | system_grant | FALSE | 允许应用使用系统身份凭据管理能力进行口令、人脸、指纹等录入、修改、删除等操作。 | | ohos.permission.MANAGE_USER_IDM | system_basic | system_grant | FALSE | 允许应用使用系统身份凭据管理能力进行口令、人脸、指纹等录入、修改、删除等操作。 |
| ohos.permission.ACCESS_BIOMETRIC | normal | system_grant | TRUE | 允许应用使用生物特征识别能力进行身份认证。 | | ohos.permission.ACCESS_BIOMETRIC | normal | system_grant | TRUE | 允许应用使用生物特征识别能力进行身份认证。 |
| ohos.permission.ACCESS_USER_AUTH_INTERNAL | system_basic | system_grant | FALSE | 允许应用使用系统身份认证能力进行用户身份认证或身份识别。 | | ohos.permission.<br>ACCESS_USER_AUTH_INTERNAL | system_basic | system_grant | FALSE | 允许应用使用系统身份认证能力进行用户身份认证或身份识别。 |
| ohos.permission.ACCESS_PIN_AUTH | system_basic | system_grant | FALSE | 允许应用使用口令输入接口,用于系统应用完成口令输入框绘制场景。 | | ohos.permission.ACCESS_PIN_AUTH | system_basic | system_grant | FALSE | 允许应用使用口令输入接口,用于系统应用完成口令输入框绘制场景。 |
| ohos.permission.GET_RUNNING_INFO | system_basic | system_grant | TRUE | 允许应用获取运行态信息。 | | ohos.permission.GET_RUNNING_INFO | system_basic | system_grant | TRUE | 允许应用获取运行态信息。 |
| ohos.permission.CLEAN_APPLICATION_DATA | system_basic | system_grant | TRUE | 允许应用清理应用数据。 | | ohos.permission.CLEAN_APPLICATION_DATA | system_basic | system_grant | TRUE | 允许应用清理应用数据。 |
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
| ohos.permission.GET_WIFI_LOCAL_MAC | system_basic | system_grant | TRUE | 允许应用获取本机WLAN或者蓝牙设备的MAC地址。 | | ohos.permission.GET_WIFI_LOCAL_MAC | system_basic | system_grant | TRUE | 允许应用获取本机WLAN或者蓝牙设备的MAC地址。 |
| ohos.permission.GET_WIFI_CONFIG | system_basic | system_grant | TRUE | 允许应用获取WLAN配置信息。 | | ohos.permission.GET_WIFI_CONFIG | system_basic | system_grant | TRUE | 允许应用获取WLAN配置信息。 |
| ohos.permission.SET_WIFI_CONFIG | system_basic | system_grant | TRUE | 允许应用配置WLAN信息。 | | ohos.permission.SET_WIFI_CONFIG | system_basic | system_grant | TRUE | 允许应用配置WLAN信息。 |
| ohos.permission.MANAGE_WIFI_CONNECTION | system_core | system_grant | TRUE | 允许应用管理WLAN连接。 | | ohos.permission.<br>MANAGE_WIFI_CONNECTION | system_core | system_grant | TRUE | 允许应用管理WLAN连接。 |
| ohos.permission.MANAGE_WIFI_HOTSPOT | system_core | system_grant | TRUE | 允许应用开启或者关闭WLAN热点。 | | ohos.permission.MANAGE_WIFI_HOTSPOT | system_core | system_grant | TRUE | 允许应用开启或者关闭WLAN热点。 |
| ohos.permission.GET_ALL_APP_ACCOUNTS | system_core | system_grant | FALSE | 允许应用获取所有应用账户信息。 | | ohos.permission.GET_ALL_APP_ACCOUNTS | system_core | system_grant | FALSE | 允许应用获取所有应用账户信息。 |
| ohos.permission.MANAGE_SECURE_SETTINGS | system_basic | system_grant | TRUE | 允许应用修改安全类系统设置。 | | ohos.permission.MANAGE_SECURE_SETTINGS | system_basic | system_grant | TRUE | 允许应用修改安全类系统设置。 |
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
| ohos.permission.NFC_TAG | normal | system_grant | FALSE | 允许应用读取Tag卡片。 | | ohos.permission.NFC_TAG | normal | system_grant | FALSE | 允许应用读取Tag卡片。 |
| ohos.permission.NFC_CARD_EMULATION | normal | system_grant | FALSE | 允许应用实现卡模拟功能。 | | ohos.permission.NFC_CARD_EMULATION | normal | system_grant | FALSE | 允许应用实现卡模拟功能。 |
| ohos.permission.PERMISSION_USED_STATS | system_basic | system_grant | TRUE | 允许系统应用访问权限使用记录。 | | ohos.permission.PERMISSION_USED_STATS | system_basic | system_grant | TRUE | 允许系统应用访问权限使用记录。 |
| ohos.permission.NOTIFICATION_AGENT_CONTROLLER | system_core | system_grant | TRUE | 允许应用发送代理通知。 | | ohos.permission.<br>NOTIFICATION_AGENT_CONTROLLER | system_core | system_grant | TRUE | 允许应用发送代理通知。 |
| ohos.permission.ANSWER_CALL | system_basic | user_grant | TRUE | 允许应用接听来电。 | | ohos.permission.ANSWER_CALL | system_basic | user_grant | TRUE | 允许应用接听来电。 |
| ohos.permission.READ_CALENDAR | normal | user_grant | TRUE | 允许应用读取日历信息。 | | ohos.permission.READ_CALENDAR | normal | user_grant | TRUE | 允许应用读取日历信息。 |
| ohos.permission.READ_CALL_LOG | system_basic | user_grant | TRUE | 允许应用读取通话记录。 | | ohos.permission.READ_CALL_LOG | system_basic | user_grant | TRUE | 允许应用读取通话记录。 |
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
| ohos.permission.WRITE_CONTACTS | system_basic | user_grant | TRUE | 允许应用添加、移除或更改联系人数据。 | | ohos.permission.WRITE_CONTACTS | system_basic | user_grant | TRUE | 允许应用添加、移除或更改联系人数据。 |
| ohos.permission.DISTRIBUTED_DATASYNC | normal | user_grant | TRUE | 允许不同设备间的数据交换。 | | ohos.permission.DISTRIBUTED_DATASYNC | normal | user_grant | TRUE | 允许不同设备间的数据交换。 |
| ohos.permission.MANAGE_VOICEMAIL | system_basic | user_grant | TRUE | 允许应用在语音信箱中留言 | | ohos.permission.MANAGE_VOICEMAIL | system_basic | user_grant | TRUE | 允许应用在语音信箱中留言 |
| ohos.permission.LOCATION_IN_BACKGROUND | normal | user_grant | FALSE | 允许应用在后台运行时获取设备位置信息。 | | ohos.permission.<br>LOCATION_IN_BACKGROUND | normal | user_grant | FALSE | 允许应用在后台运行时获取设备位置信息。 |
| ohos.permission.LOCATION | normal | user_grant | TRUE | 允许应用获取设备位置信息。 | | ohos.permission.LOCATION | normal | user_grant | TRUE | 允许应用获取设备位置信息。 |
| ohos.permission.APPROXIMATELY_LOCATION | normal | user_grant | FALSE | 允许应用获取设备模糊位置信息。 | | ohos.permission.APPROXIMATELY_LOCATION | normal | user_grant | FALSE | 允许应用获取设备模糊位置信息。 |
| ohos.permission.MEDIA_LOCATION | normal | user_grant | TRUE | 允许应用访问用户媒体文件中的地理位置信息。 | | ohos.permission.MEDIA_LOCATION | normal | user_grant | TRUE | 允许应用访问用户媒体文件中的地理位置信息。 |
...@@ -125,13 +125,13 @@ ...@@ -125,13 +125,13 @@
| ohos.permission.READ_HEALTH_DATA | normal | user_grant | TRUE | 允许应用读取用户的健康数据。 | | ohos.permission.READ_HEALTH_DATA | normal | user_grant | TRUE | 允许应用读取用户的健康数据。 |
| ohos.permission.GET_DEFAULT_APPLICATION | system_core | system_grant | TRUE | 允许应用查询默认应用。 | | ohos.permission.GET_DEFAULT_APPLICATION | system_core | system_grant | TRUE | 允许应用查询默认应用。 |
| ohos.permission.SET_DEFAULT_APPLICATION | system_core | system_grant | TRUE | 允许应用设置、重置默认应用。 | | ohos.permission.SET_DEFAULT_APPLICATION | system_core | system_grant | TRUE | 允许应用设置、重置默认应用。 |
| ohos.permission.MANAGE_DISPOSED_APP_STATUS | system_core | system_grant | TRUE | 允许设置和查询应用的处置状态。 | | ohos.permission.<br>MANAGE_DISPOSED_APP_STATUS | system_core | system_grant | TRUE | 允许设置和查询应用的处置状态。 |
| ohos.permission.ACCESS_IDS | system_core | system_grant | TRUE | 允许应用查询设备的唯一标识符信息。 | | ohos.permission.ACCESS_IDS | system_core | system_grant | TRUE | 允许应用查询设备的唯一标识符信息。 |
| ohos.permission.DUMP | system_core | system_grant | TRUE | 允许导出系统基础信息和SA服务信息。 | | ohos.permission.DUMP | system_core | system_grant | TRUE | 允许导出系统基础信息和SA服务信息。 |
| ohos.permission.DISTRIBUTED_SOFTBUS_CENTER | system_basic | system_grant | FALSE | 允许不同设备之间进行组网处理。 | | ohos.permission.<br>DISTRIBUTED_SOFTBUS_CENTER | system_basic | system_grant | FALSE | 允许不同设备之间进行组网处理。 |
| ohos.permission.ACCESS_DLP_FILE | system_core | system_grant | TRUE | 允许对DLP文件进行权限配置和管理。 | | ohos.permission.ACCESS_DLP_FILE | system_core | system_grant | TRUE | 允许对DLP文件进行权限配置和管理。 |
| ohos.permission.PROVISIONING_MESSAGE | system_core | system_grant | TRUE | 允许激活超级设备管理器应用。 | | ohos.permission.PROVISIONING_MESSAGE | system_core | system_grant | TRUE | 允许激活超级设备管理器应用。 |
| ohos.permission.ACCESS_SYSTEM_SETTINGS | system_basic | system_grant | TRUE | 允许应用接入或拉起系统设置界面。 | | ohos.permission.<br>ACCESS_SYSTEM_SETTINGS | system_basic | system_grant | TRUE | 允许应用接入或拉起系统设置界面。 |
| ohos.permission.READ_IMAGEVIDEO | system_basic | user_grant | TRUE | 允许读取用户公共目录的图片或视频文件。 | | ohos.permission.READ_IMAGEVIDEO | system_basic | user_grant | TRUE | 允许读取用户公共目录的图片或视频文件。 |
| ohos.permission.READ_AUDIO | system_basic | user_grant | TRUE | 允许读取用户公共目录的音频文件。 | | ohos.permission.READ_AUDIO | system_basic | user_grant | TRUE | 允许读取用户公共目录的音频文件。 |
| ohos.permission.READ_DOCUMENT | system_basic | user_grant | TRUE | 允许读取用户公共目录的文档。 | | ohos.permission.READ_DOCUMENT | system_basic | user_grant | TRUE | 允许读取用户公共目录的文档。 |
......
...@@ -13,7 +13,7 @@ Linux内核移植主要涉及基于linux内核基线合入三方芯片补丁后 ...@@ -13,7 +13,7 @@ Linux内核移植主要涉及基于linux内核基线合入三方芯片补丁后
### Bootloader ### Bootloader
可以使用芯片厂商自带的Bootloader,或者是开源Uboot等加载内核镜像。比如为支持Hi3516DV300开发板,OpenHarmony引入的开源[Uboot](https://gitee.com/openharmony/device_hisilicon_third_party_uboot) 可以使用芯片厂商自带的Bootloader,或者是开源Uboot等加载内核镜像。比如为支持Hi3516DV300开发板,OpenHarmony引入的开源[Uboot](https://gitee.com/openharmony/third_party_u-boot)
## 适配编译和烧录启动 ## 适配编译和烧录启动
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册