提交 a4d2aa41 编写于 作者: X xuzhihao

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

Signed-off-by: Nxuzhihao <xuzhihao16@huawei.com>
......@@ -31,3 +31,16 @@ This repository stores device and application development documents provided by
OpenHarmony_v1.x_release: OpenHarmony v1.1.4 LTS. [Learn more](en/release-notes/OpenHarmony-v1-1-4-LTS.md)
[More versions](en/release-notes/)
## Third-Party Open-Source Software and License Notice
3rd-Party-License: [Third-Party Open-Source Software and License Notice](en/contribute/third-party-open-source-software-and-license-notice.md)
## How to Contribute
A great open-source project wouldn't be possible without the hard work of many contributors. We'd like to invite anyone from around the world to [participate](contribute/contribution.md) in this exciting journey, and we're grateful for your time, passion, and efforts!
You can evaluate available documents, make simple modifications, provide feedback on document quality, and contribute your original content. For details, see [Documentation Contribution](contribute/documentation-contribution.md).
Excellent contributors will be awarded and the contributions will be publicized in the developer community.
# OpenHarmony<a name="EN-US_TOPIC_0000001158661243"></a>
# OpenHarmony
## Introduction<a name="section1270210396435"></a>
......@@ -331,7 +331,8 @@ The following table describes the subsystems of OpenHarmony. For details about t
## Getting Started<a name="section44681652104210"></a>
For details, see [device-dev/quick-start/Readme-EN.md](device-dev/quick-start/Readme-EN.md).
- Device development: [device-dev/quick-start/Readme.md](device-dev/quick-start/Readme-EN.md)
- Application development: [application-dev/quick-start/Readme.md](application-dev/quick-start/Readme-EN.md)
- [Getting Started for Device Development](device-dev/quick-start/quickstart-lite-overview.md)
- [Getting Started for Application Development](application-dev/quick-start/start-overview.md)
......@@ -377,4 +378,3 @@ Website:
Email:
contact@openharmony.io
......@@ -2,18 +2,30 @@
An ability is an abstraction of a functionality that an application can provide. It is the minimum unit for the system to schedule applications. An application can contain one or more **Ability** instances.
The ability framework model has two forms. The first form is the FA model, which applies to application development using API 8 and earlier versions. In the FA model, there are Feature Ability (FA) and Particle Ability (PA). The FA supports Page abilities, and the PA supports Service and Data abilities. The stage model is introduced since API 9. In the stage model, there are Page abilities and Extension abilities. The Extension ability is further extended to Service Extension, Form Extension, Data Share Extension, and more.
The ability framework model has two forms.
The stage model is designed to make complex application development easier in a distributed environment. The two models have differences in the following aspects:
- FA model, which applies to application development using API 8 and earlier versions. In the FA model, there are Feature Ability (FA) and Particle Ability (PA). The FA supports Page abilities, and the PA supports Service, Data, and Form abilities.
- Stage model, which is introduced since API 9. In the stage model, there are Ability and ExtensionAbility. The ExtensionAbility is further extended to ServiceExtensionAbility, FormExtensionAbility, DataShareExtensionAbility, and more.
* Ability type and API usage
The stage model is designed to make it easier to develop complex applications in the distributed environment. The table below lists the design differences between the two models.
| Item | FA Model | Stage Model |
| -------------- | ------------------------------------------------------------ | -------------------------------------------------------- |
| Development mode | Web-like APIs are provided. The UI development is the same as that of the stage model. | Object-oriented development mode is provided. The UI development is the same as that of the FA model. |
| Engine instance | Each ability in a process exclusively uses a JS VM engine instance. | Multiple abilities in a process share one JS VM engine instance. |
| Intra-process object sharing| Not supported. | Supported. |
| Bundle description file | The **config.json** file is used to describe the HAP and component information. The component must use a fixed file name.| The **module.json** file is used to describe the HAP and component information. The entry file name can be specified.|
| Component | Four types of components are provided: Page ability (used for UI page display), Service ability (used to provide services), Data ability (used for data sharing), and Form ability (used to provide widgets).| Two types of components are provided: Ability (used for UI page display) and Extension (scenario-based service extension). |
In addition, the following differences are available in the development process:
* Different ability types
![favsstage](figures/favsstage.png)
* Ability lifecycle
* Different ability lifecycles
![lifecycle](figures/lifecycle.png)
* Application configuration files and application package structure (The differences are reflected in the application packages generated by the IDE.)
For details about the two models, see [FA Model Overview](fa-brief.md) and [Stage Model Overview](stage-brief.md).
# Data Ability Development
## Basic Concepts
## When to Use
A Data ability helps applications manage access to data stored by themselves and other applications. It also provides APIs for sharing data with other applications either on the same device or across devices.
Data ability providers can customize data access-related APIs such as data inserting, deleting, updating, and querying, as well as file opening, and share data with other applications through these open APIs.
## Creating a Data Ability
### 1. Implementation of the Data Subsystem
1. To meet the basic requirements of the database storage service, implement the **Insert**, **Query**, **Update**, and **Delete** APIs in the **Data** class to provide batch data processing. The traversal logic has been implemented by the **BatchInsert** and **ExecuteBatch** APIs.
2. The APIs used in the lifecycle of the Data ability are as follows:
- onInitialized
Called during ability initialization to initialize the relational database (RDB).
- update
Updates data in the database.
- query
Queries data in the database.
- delete
Deletes one or multiple data records from the database.
- normalizeUri
Normalizes the URI. A normalized URI applies to cross-device use, persistence, backup, and restore. When the context changes, it ensures that the same data item can be referenced.
- batchInsert
Inserts multiple data records into the database.
- denormalizeUri
## Available APIs
**Table 1** Data ability lifecycle callbacks
|API|Description|
|:------|:------|
|onInitialized|Called during ability initialization to initialize the relational database (RDB).|
|update|Updates data in the database.|
|query|Queries data in the database.|
|delete|Deletes one or multiple data records from the database.|
|normalizeUri|Normalizes the URI. A normalized URI applies to cross-device use, persistence, backup, and restore. When the context changes, it ensures that the same data item can be referenced.|
|batchInsert|Inserts multiple data records into the database.|
|denormalizeUri|Converts a normalized URI generated by **normalizeUri** into a denormalized URI.|
|insert|Inserts a data record into the database.|
|openFile|Opens a file.|
|getFileTypes|Obtains the MIME type of a file.|
|getType|Obtains the MIME type matching the data specified by the URI.|
|executeBatch|Operates data in the database in batches.|
|call|A customized API.|
## How to Develop
### Creating a Data Ability
Converts a normalized URI generated by **normalizeUri** into a denormalized URI.
- insert
Inserts a data record into the database.
- openFile
Opens a file.
- getFileTypes
Obtains the MIME type of a file.
- getType
Obtains the MIME type matching the data specified by the URI.
- executeBatch
Operates data in the database in batches.
- call
A customized API.
1. To meet the basic requirements of the database storage service, implement the **Insert**, **Query**, **Update**, and **Delete** APIs in the **Data** class to provide batch data processing. The traversal logic has been implemented by the **BatchInsert** and **ExecuteBatch** APIs.
The following code snippet shows how to create a Data ability:
The following code snippet shows how to create a Data ability:
```javascript
import dataAbility from '@ohos.data.dataability'
import dataRdb from '@ohos.data.rdb'
const TABLE_NAME = 'book'
const STORE_CONFIG = { name: 'book.db', encryptKey: new Uint8Array([]) }
const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, age INTEGER, introduction TEXT NOT NULL)'
let rdbStore = undefined
export default {
onInitialized(abilityInfo) {
console.info('DataAbility onInitialized, abilityInfo:' + abilityInfo.bundleName)
dataRdb.getRdbStore(STORE_CONFIG, 1, (err, store) => {
console.info('DataAbility getRdbStore callback')
store.executeSql(SQL_CREATE_TABLE, [])
rdbStore = store
});
},
insert(uri, valueBucket, callback) {
console.info('DataAbility insert start')
rdbStore.insert(TABLE_NAME, valueBucket, callback)
},
batchInsert(uri, valueBuckets, callback) {
console.info('DataAbility batch insert start')
for (let i = 0;i < valueBuckets.length; i++) {
console.info('DataAbility batch insert i=' + i)
if (i < valueBuckets.length - 1) {
rdbStore.insert(TABLE_NAME, valueBuckets[i], (num: number) => {
console.info('DataAbility batch insert ret=' + num)
})
} else {
rdbStore.insert(TABLE_NAME, valueBuckets[i], callback)
}
onInitialized(abilityInfo) {
console.info('DataAbility onInitialized, abilityInfo:' + abilityInfo.bundleName)
dataRdb.getRdbStore(STORE_CONFIG, 1, (err, store) => {
console.info('DataAbility getRdbStore callback')
store.executeSql(SQL_CREATE_TABLE, [])
rdbStore = store
});
},
insert(uri, valueBucket, callback) {
console.info('DataAbility insert start')
rdbStore.insert(TABLE_NAME, valueBucket, callback)
},
batchInsert(uri, valueBuckets, callback) {
console.info('DataAbility batch insert start')
for (let i = 0;i < valueBuckets.length; i++) {
console.info('DataAbility batch insert i=' + i)
if (i < valueBuckets.length - 1) {
rdbStore.insert(TABLE_NAME, valueBuckets[i], (num: number) => {
console.info('DataAbility batch insert ret=' + num)
})
} else {
rdbStore.insert(TABLE_NAME, valueBuckets[i], callback)
}
},
query(uri, columns, predicates, callback) {
console.info('DataAbility query start')
let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates)
rdbStore.query(rdbPredicates, columns, callback)
},
update(uri, valueBucket, predicates, callback) {
console.info('DataAbilityupdate start')
let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates)
rdbStore.update(valueBucket, rdbPredicates, callback)
},
delete(uri, predicates, callback) {
console.info('DataAbilitydelete start')
let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates)
rdbStore.delete(rdbPredicates, callback)
}
},
query(uri, columns, predicates, callback) {
console.info('DataAbility query start')
let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates)
rdbStore.query(rdbPredicates, columns, callback)
},
update(uri, valueBucket, predicates, callback) {
console.info('DataAbilityupdate start')
let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates)
rdbStore.update(valueBucket, rdbPredicates, callback)
},
delete(uri, predicates, callback) {
console.info('DataAbilitydelete start')
let rdbPredicates = dataAbility.createRdbPredicates(TABLE_NAME, predicates)
rdbStore.delete(rdbPredicates, callback)
}
};
```
2. Submodule Configuration
### 2. Subsystem Configuration
| JSON Field | Description |
| ------------- | ------------------------------------------------------------ |
| "name" | Ability name, corresponding to the **Data** class name derived from **Ability**. |
| "type" | Ability type, which is **Data** for a Data ability. |
| "uri" | URI used for communication. |
| "visible" | Whether the Data ability is visible to other applications. When this parameter is set to **true**, the Data ability can communicate with other applications.|
| JSON Field| Description |
| ------------ | ------------------------------------------------------------ |
| "name" | Ability name, corresponding to the **Data** class name derived from **Ability**. |
| "type" | Ability type, which is **Data** for a Data ability. |
| "uri" | URI used for communication. |
| "visible" | Whether the Data ability is visible to other applications. When this parameter is set to **true**, the Data ability can communicate with other applications.|
**config.json configuration example**
**config.json configuration example**
```json
"abilities":[{
```json
"abilities":[{
"srcPath": "DataAbility",
"name": ".DataAbility",
"icon": "$media:icon",
......@@ -141,121 +97,142 @@ Data ability providers can customize data access-related APIs such as data inser
"type": "data",
"visible": true,
"uri": "dataability://ohos.samples.etsdataability.DataAbility"
}]
```
}]
```
### Accessing a Data ability
#### Development Preparations
Import the basic dependency packages and obtain the URI string for communicating with the Data submodule.
The basic dependency packages include:
- @ohos.ability.featureAbility
- @ohos.data.dataability
- @ohos.data.rdb
#### Data Ability API Development
## Accessing a Data ability
### 1. Preparing for JS Application Development
Basic dependency packages:
1. @ohos.ability.featureAbility
2. @ohos.data.dataability
3. @ohos.data.rdb
URI string used for communication with the Data ability.
### 2. JS Application Development APIs
Create a utility API object.
```js
// Different from the URI defined in the config.json file, the URI passed in the parameter has an extra slash (/), because there is a DeviceID parameter between the second and the third slash (/).
var urivar = "dataability:///com.ix.DataAbility"
var DAHelper = featureAbility.acquireDataAbilityHelper(
1. Create a Data ability helper.
For details about the APIs provided by **DataAbilityHelper**, see [DataAbilityHelper Module](../reference/apis/js-apis-dataAbilityHelper.md).
```js
// Different from the URI defined in the config.json file, the URI passed in the parameter has an extra slash (/), because there is a DeviceID parameter between the second and the third slash (/).
var urivar = "dataability:///com.ix.DataAbility"
var DAHelper = featureAbility.acquireDataAbilityHelper(
urivar
);
```
Construct RDB data.
```js
var valuesBucket = {"name": "gaolu"}
var da = new ohos_data_ability.DataAbilityPredicates()
var valArray =new Array("value1");
var cars = new Array({"batchInsert1" : "value1",});
```
Use **insert** to insert data to the Data subsystem.
```js
// Callback mode:
DAHelper.insert(
);
```
2. Construct RDB data.
```js
var valuesBucket = {"name": "gaolu"}
var da = new ohos_data_ability.DataAbilityPredicates()
var valArray =new Array("value1");
var cars = new Array({"batchInsert1" : "value1",});
```
3. Use **insert** to insert data to the Data submodule.
```js
// Callback mode:
DAHelper.insert(
urivar,
valuesBucket,
(error, data) => {
expect(typeof(data)).assertEqual("number")
}
);
// Promise mode:
var datainsert = await DAHelper.insert(
);
```
```js
// Promise mode:
var datainsert = await DAHelper.insert(
urivar,
valuesBucket
);
```
Use **delete** to delete data from the Data subsystem.
```js
// Callback mode:
DAHelper.delete(
);
```
4. Use **delete** to delete data from the Data submodule.
```js
// Callback mode:
DAHelper.delete(
urivar,
da,
(error, data) => {
expect(typeof(data)).assertEqual("number")
}
);
// Promise mode:
var datadelete = await DAHelper.delete(
);
```
```js
// Promise mode:
var datadelete = await DAHelper.delete(
urivar,
da,
);
```
Use **update** to update data in the Data subsystem.
```js
// Callback mode:
DAHelper.update(
);
```
5. Use **update** to update data in the Data submodule.
```js
// Callback mode:
DAHelper.update(
urivar
valuesBucket,
da,
(error, data) => {
expect(typeof(data)).assertEqual("number")
}
);
// Promise mode:
var dataupdate = await DAHelper.update(
);
```
```js
// Promise mode:
var dataupdate = await DAHelper.update(
urivar,
valuesBucket,
da,
);
```
Use **query** to query data in the Data subsystem.
```js
// Callback mode:
DAHelper.query(
);
```
6. Use **query** to query data in the Data submodule.
```js
// Callback mode:
DAHelper.query(
urivar,
valArray,
da,
(error, data) => {
expect(typeof(data)).assertEqual("object")
}
);
// Promise mode:
var dataquery = await DAHelper.query(
);
```
```js
// Promise mode:
var dataquery = await DAHelper.query(
urivar,
valArray,
da
);
```
Use **batchInsert** to insert data in batches to the Data subsystem.
```js
// Callback mode:
DAHelper.batchInsert(
);
```
7. Use **batchInsert** to insert data in batches to the Data submodule.
```js
// Callback mode:
DAHelper.batchInsert(
urivar,
cars,
(error, data) => {
expect(typeof(data)).assertEqual("number")
}
);
// Promise mode:
var databatchInsert = await DAHelper.batchInsert(
);
```
```js
// Promise mode:
var databatchInsert = await DAHelper.batchInsert(
urivar,
cars
);
```
Use **executeBatch** to process data in batches in the Data subsystem.
```js
// Callback mode:
DAHelper.executeBatch(
);
```
8. Use **executeBatch** to process data in batches in the Data submodule.
```js
// Callback mode:
DAHelper.executeBatch(
urivar,
[
{
......@@ -271,9 +248,12 @@ DAHelper.executeBatch(
(error, data) => {
expect(typeof(data)).assertEqual("object")
}
);
// Promise mode:
var dataexecuteBatch = await DAHelper.executeBatch(
);
```
```js
// Promise mode:
var dataexecuteBatch = await DAHelper.executeBatch(
urivar,
[
{
......@@ -289,8 +269,8 @@ var dataexecuteBatch = await DAHelper.executeBatch(
interrupted:true,
}
]
);
```
);
```
## Development Example
......
......@@ -3,20 +3,20 @@
## Widget Overview
A widget is a set of UI components used to display important information or operations for an application. It provides users with direct access to a desired application service, without requiring them to open the application.
A widget displays brief information about an application on the UI of another application (host application, currently system applications only) and provides basic interactive features such as opening a UI page or sending a message. The widget client is responsible for displaying the widget.
A widget displays brief information about an application on the UI of another application (host application, currently system applications only) and provides basic interactive features such as opening a UI page or sending a message. The widget host is responsible for displaying the widget.
Basic concepts:
- Widget provider
The widget provider is an atomic service that provides the content to be displayed. It controls the display content, component layout, and component click events of a widget.
- Widget client
The widget client is an application that displays the widget content and controls the position where the widget is displayed in the host application.
- Widget host
The widget host is an application that displays the widget content and controls the position where the widget is displayed in the host application.
- Widget Manager
The Widget Manager is a resident agent that manages widgets added to the system and provides functions such as periodic widget update.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The widget client and provider do not keep running all the time. The Widget Manager starts the widget provider to obtain widget information when a widget is added, deleted, or updated.
> The widget host and provider do not keep running all the time. The Widget Manager starts the widget provider to obtain widget information when a widget is added, deleted, or updated.
You only need to develop widget content as the widget provider. The system automatically handles the work done by the widget client and Widget Manager.
You only need to develop widget content as the widget provider. The system automatically handles the work done by the widget host and Widget Manager.
The widget provider controls the widget content to display, component layout, and click events bound to components.
......@@ -85,11 +85,11 @@ To create a widget in the FA model, you need to implement the lifecycles of **Li
return formData;
},
onCastToNormal(formId) {
// Called when the widget client converts the temporary widget into a normal one. The widget provider should do something to respond to the conversion.
// Called when the widget host converts the temporary widget into a normal one. The widget provider should do something to respond to the conversion.
console.log('FormAbility onCastToNormal');
},
onUpdate(formId) {
// To support scheduled update, periodic update, or update requested by the widget client for a widget, override this method for data update.
// To support scheduled update, periodic update, or update requested by the widget host for a widget, override this method for data update.
console.log('FormAbility onUpdate');
let obj = {
"title": "titleOnUpdate",
......@@ -101,7 +101,7 @@ To create a widget in the FA model, you need to implement the lifecycles of **Li
});
},
onVisibilityChange(newStatus) {
// Called when the widget client initiates an event about visibility changes. The widget provider should do something to respond to the notification.
// Called when the widget host initiates an event about visibility changes. The widget provider should do something to respond to the notification.
console.log('FormAbility onVisibilityChange');
},
onEvent(formId, message) {
......@@ -233,13 +233,13 @@ You should override **onDestroy** to delete widget data.
For details about the persistence method, see [Lightweight Data Store Development](../database/database-preference-guidelines.md).
Note that the **Want** passed by the widget client to the widget provider contains a temporary flag, indicating whether the requested widget is a temporary one.
Note that the **Want** passed by the widget host to the widget provider contains a temporary flag, indicating whether the requested widget is a temporary one.
Normal widget: a widget that will be persistently used by the widget client
Normal widget: a widget that will be persistently used by the widget host
Temporary widget: a widget that is temporarily used by the widget client
Temporary widget: a widget that is temporarily used by the widget host
Data of a temporary widget is not persistently stored. If the widget framework is killed and restarted, data of a temporary widget will be deleted. However, the widget provider is not notified of which widget is deleted, and still keeps the data. Therefore, the widget provider should implement data clearing. In addition, the widget client may convert a temporary widget into a normal one. If the conversion is successful, the widget provider should process the widget ID and store the data persistently. This prevents the widget provider from deleting persistent data when clearing temporary widgets.
Data of a temporary widget is not persistently stored. If the widget framework is killed and restarted, data of a temporary widget will be deleted. However, the widget provider is not notified of which widget is deleted, and still keeps the data. Therefore, the widget provider should implement data clearing. In addition, the widget host may convert a temporary widget into a normal one. If the conversion is successful, the widget provider should process the widget ID and store the data persistently. This prevents the widget provider from deleting persistent data when clearing temporary widgets.
### Developing the Widget UI Page
You can use HML, CSS, and JSON to develop the UI page for a JavaScript-programmed widget.
......
......@@ -4,21 +4,21 @@
A widget is a set of UI components used to display important information or operations for an application. It provides users with direct access to a desired application service, without requiring them to open the application.
A widget displays brief information about an application on the UI of another application (host application, currently system applications only) and provides basic interactive features such as opening a UI page or sending a message. The widget client is responsible for displaying the service widget.
A widget displays brief information about an application on the UI of another application (host application, currently system applications only) and provides basic interactive features such as opening a UI page or sending a message. The widget host is responsible for displaying the service widget.
Basic concepts:
- Widget provider
The widget provider is an atomic service that provides the content to be displayed. It controls the display content, component layout, and component click events of a widget.
- Widget client
The widget client is an application that displays the widget content and controls the position where the widget is displayed in the host application.
- Widget host
The widget host is an application that displays the widget content and controls the position where the widget is displayed in the host application.
- Widget Manager
The Widget Manager is a resident agent that manages widgets added to the system and provides functions such as periodic widget update.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The widget client and provider do not keep running all the time. The Widget Manager starts the widget provider to obtain widget information when a widget is added, deleted, or updated.
> The widget host and provider do not keep running all the time. The Widget Manager starts the widget provider to obtain widget information when a widget is added, deleted, or updated.
You only need to develop widget content as the widget provider. The system automatically handles the work done by the widget client and Widget Manager.
You only need to develop widget content as the widget provider. The system automatically handles the work done by the widget host and Widget Manager.
The widget provider controls the widget content to display, component layout, and click events bound to components.
......@@ -97,11 +97,11 @@ To create a widget in the stage model, you need to implement the lifecycle callb
return formData;
}
onCastToNormal(formId) {
// Called when the widget client converts the temporary widget into a normal one. The widget provider should do something to respond to the conversion.
// Called when the widget host converts the temporary widget into a normal one. The widget provider should do something to respond to the conversion.
console.log('FormAbility onCastToNormal');
}
onUpdate(formId) {
// To support scheduled update, periodic update, or update requested by the widget client for a widget, override this method for data update.
// To support scheduled update, periodic update, or update requested by the widget host for a widget, override this method for data update.
console.log('FormAbility onUpdate');
let obj = {
"title": "titleOnUpdate",
......@@ -113,7 +113,7 @@ To create a widget in the stage model, you need to implement the lifecycle callb
});
}
onVisibilityChange(newStatus) {
// Called when the widget client initiates an event about visibility changes. The widget provider should do something to respond to the notification.
// Called when the widget host initiates an event about visibility changes. The widget provider should do something to respond to the notification.
console.log('FormAbility onVisibilityChange');
}
onEvent(formId, message) {
......@@ -246,13 +246,13 @@ You should override **onDestroy** to delete widget data.
For details about the persistence method, see [Lightweight Data Store Development](../database/database-preference-guidelines.md).
Note that the **Want** passed by the widget client to the widget provider contains a temporary flag, indicating whether the requested widget is a temporary one.
Note that the **Want** passed by the widget host to the widget provider contains a temporary flag, indicating whether the requested widget is a temporary one.
Normal widget: a widget that will be persistently used by the widget client
Normal widget: a widget that will be persistently used by the widget host
Temporary widget: a widget that is temporarily used by the widget client
Temporary widget: a widget that is temporarily used by the widget host
Data of a temporary widget is not persistently stored. If the widget framework is killed and restarted, data of a temporary widget will be deleted. However, the widget provider is not notified of which widget is deleted, and still keeps the data. Therefore, the widget provider should implement data clearing. In addition, the widget client may convert a temporary widget into a normal one. If the conversion is successful, the widget provider should process the widget ID and store the data persistently. This prevents the widget provider from deleting persistent data when clearing temporary widgets.
Data of a temporary widget is not persistently stored. If the widget framework is killed and restarted, data of a temporary widget will be deleted. However, the widget provider is not notified of which widget is deleted, and still keeps the data. Therefore, the widget provider should implement data clearing. In addition, the widget host may convert a temporary widget into a normal one. If the conversion is successful, the widget provider should process the widget ID and store the data persistently. This prevents the widget provider from deleting persistent data when clearing temporary widgets.
### Developing the Widget UI Page
You can use HML, CSS, and JSON to develop the UI page for a JavaScript-programmed widget.
......
......@@ -378,6 +378,7 @@
- [ImageAnimator](reference/arkui-ts/ts-basic-components-imageanimator.md)
- [LoadingProgress](reference/arkui-ts/ts-basic-components-loadingprogress.md)
- [Marquee](reference/arkui-ts/ts-basic-components-marquee.md)
- [Navigation](reference/arkui-ts/ts-basic-components-navigation.md)
- [PatternLock](reference/arkui-ts/ts-basic-components-patternlock.md)
- [PluginComponent](reference/arkui-ts/ts-basic-components-plugincomponent.md)
- [Progress](reference/arkui-ts/ts-basic-components-progress.md)
......@@ -385,6 +386,7 @@
- [Radio](reference/arkui-ts/ts-basic-components-radio.md)
- [Rating](reference/arkui-ts/ts-basic-components-rating.md)
- [RichText](reference/arkui-ts/ts-basic-components-richtext.md)
- [ScrollBar](reference/arkui-ts/ts-basic-components-scrollbar.md)
- [Search](reference/arkui-ts/ts-basic-components-search.md)
- [Select](reference/arkui-ts/ts-basic-components-select.md)
- [Slider](reference/arkui-ts/ts-basic-components-slider.md)
......@@ -413,14 +415,12 @@
- [GridItem](reference/arkui-ts/ts-container-griditem.md)
- [List](reference/arkui-ts/ts-container-list.md)
- [ListItem](reference/arkui-ts/ts-container-listitem.md)
- [Navigator](reference/arkui-ts/ts-container-navigator.md)
- [Navigation](reference/arkui-ts/ts-basic-components-navigation.md)
- [Navigator](reference/arkui-ts/ts-container-navigator.md)
- [Panel](reference/arkui-ts/ts-container-panel.md)
- [Refresh](reference/arkui-ts/ts-container-refresh.md)
- [Row](reference/arkui-ts/ts-container-row.md)
- [RowSplit](reference/arkui-ts/ts-container-rowsplit.md)
- [Scroll](reference/arkui-ts/ts-container-scroll.md)
- [ScrollBar](reference/arkui-ts/ts-basic-components-scrollbar.md)
- [Scroll](reference/arkui-ts/ts-container-scroll.md)
- [SideBarContainer](reference/arkui-ts/ts-container-sidebarcontainer.md)
- [Stack](reference/arkui-ts/ts-container-stack.md)
- [Swiper](reference/arkui-ts/ts-container-swiper.md)
......
......@@ -170,9 +170,9 @@ You can set a USB device as a host to connect to a device for data transfer. The
var pipe = usb.connectDevice(deviceList[0]);
/*
Claim the corresponding interface from deviceList.
interface must be one present in the device configuration.
interface1 must be one present in the device configuration.
*/
usb.claimInterface(pipe , interface, true);
usb.claimInterface(pipe , interface1, true);
```
4. Perform data transfer.
......
......@@ -55,8 +55,7 @@ In this example, an application event is logged after the application startup ex
}).catch((err) => {
console.error(`failed to write event because ${err.code}`);
});
});
// 3. Set the application event logging switch.
hiAppEvent.configure({
disable: true
......
......@@ -6,9 +6,7 @@ HiAppEvent provides event logging APIs for applications to log the fault, statis
The HiAppEvent module of OpenHarmony can be used to develop application event services and provide functions related to application events, including flushing application events to a disk and querying historical application event data.
- **Logging**
Logs changes caused by user operations to provide service data for development, product, and O&M analysis.
**Logging**: Logs changes caused by user operations to provide service data for development, product, and O&M analysis.
## Event Verification Result Codes
......
# Ability Access Control
# Ability Access Control
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......
# Want
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
**Want** is the basic communication component of the system.
## Modules to Import
```
import Want from '@ohos.application.Want';
```
## Attributes
**System capability**: SystemCapability.Ability.AbilityBase
| Name | Readable/Writable| Type | Mandatory| Description |
| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ |
| deviceId | Read only | string | No | ID of the device running the ability. |
| bundleName | Read only | string | No | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can directly match the specified ability.|
| abilityName | Read only | string | No | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can directly match the specified ability.|
| uri | Read only | string | No | URI information to match. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.|
| type | Read only | string | No | MIME type, for example, **text/plain** or **image/***. |
| flags | Read only | number | No | How the **Want** object will be handled. By default, numbers are passed in. For details, see [flags](js-apis-featureAbility.md#flags).|
| action | Read only | string | No | Action option. |
| parameters | Read only | {[key: string]: any} | No | List of parameters in the **Want** object. |
| entities | Read only | Array\<string> | No | List of entities. | |
# appManager
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Implements application management.
......@@ -9,7 +9,7 @@ Implements application management.
## Modules to Import
```js
import app from '@ohos.application.appManager';
```
......@@ -77,18 +77,16 @@ Checks whether this application is running in a RAM constrained device. This API
| Type| Description|
| -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return whether the the application is running in a RAM constrained device. If the the application is running in a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
| Promise&lt;boolean&gt; | Promise used to return whether the application is running in a RAM constrained device. If the application is running in a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
**Example**
```js
IsRamConstrainedDevicePromise(){
app.isRamConstrainedDevicePromise().then((data) => {
console.log('success:' + JSON.stringify(data));
}).catch((error) => {
console.log('failed:' + JSON.stringify(error));
});
}
```
## appManager.isRamConstrainedDevice
......@@ -103,17 +101,15 @@ Checks whether this application is running in a RAM constrained device. This API
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;boolean&gt; | No| Callback used to return whether the the application is running in a RAM constrained device. If the the application is running in a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
| callback | AsyncCallback&lt;boolean&gt; | No| Callback used to return whether the application is running in a RAM constrained device. If the application is running in a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
**Example**
```js
IsRamConstrainedDeviceCallBack(){
app.isRamConstrainedDevicePromise((err, data) => {
console.log('startAbility result failed:' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data));
})
}
```
## appManager.getAppMemorySize
......@@ -133,13 +129,11 @@ Obtains the memory size of this application. This API uses a promise to return t
**Example**
```js
GetAppMemorySize(){
app.getAppMemorySize().then((data) => {
console.log('success:' + JSON.stringify(data));
}).catch((error) => {
console.log('failed:' + JSON.stringify(error));
});
}
```
## appManager.getAppMemorySize
......@@ -159,10 +153,65 @@ Obtains the memory size of this application. This API uses an asynchronous callb
**Example**
```js
GetAppMemorySizeCallBack(){
app.getAppMemorySize((err, data) => {
console.log('startAbility result failed :' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data));
})
}
```
## appManager.getProcessRunningInfos<sup>8+</sup>
getProcessRunningInfos(): Promise<Array<ProcessRunningInfo>>;
Obtains information about the running processes. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Return value**
| Type| Description|
| -------- | -------- |
| Promise<Array\<ProcessRunningInfo>> | Promise used to return the process information.|
**Example**
```js
app.GetProcessRunningInfos().then((data) => {
console.log('success:' + JSON.stringify(data));
}).catch((error) => {
console.log('failed:' + JSON.stringify(error));
});
```
## appManager.getProcessRunningInfos<sup>8+</sup>
getProcessRunningInfos(callback: AsyncCallback<Array<ProcessRunningInfo>>): void;
Obtains information about the running processes. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<Array\<ProcessRunningInfo>> | No| Callback used to return the process information.|
**Example**
```js
app.GetProcessRunningInfos((err, data) => {
console.log('startAbility result failed :' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data));
})
```
## ProcessRunningInfo
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Readable/Writable| Type | Mandatory| Description |
| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ |
| pid<sup>8+</sup> | Read only | number | No | Process ID. |
| uid<sup>8+</sup> | Read only | number | No | User ID.|
| processName<sup>8+</sup> | Read only | string | No | Process name.|
| bundleNames<sup>8+</sup> | Read only | Array\<string> | No | **bundleName** array in the running process.|
......@@ -56,6 +56,7 @@ Obtains the remaining duration before the application is suspended. This API use
| callback | AsyncCallback&lt;number&gt; | Yes| Callback used to return the remaining duration before the application is suspended, in milliseconds.|
**Example**
```js
let id = 1;
backgroundTaskManager.getRemainingDelayTime(id, (err, res) => {
......@@ -127,12 +128,12 @@ Requests a continuous task from the system. This API uses an asynchronous callba
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| context | [Context](js-apis-Context.md) | Yes| Application context.|
| bgMode | [BackgroundMode](#backgroundmode8) | Yes| Background mode requested.|
| wantAgent | [WantAgent](js-apis-notification.md#WantAgent)| Yes| Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| context | [Context](js-apis-Context.md) | Yes| Application context.|
| bgMode | [BackgroundMode](#backgroundmode8) | Yes| Background mode requested.|
| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes| Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Example**
```js
......@@ -178,13 +179,13 @@ Requests a continuous task from the system. This API uses a promise to return th
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| context | [Context](js-apis-Context.md) | Yes| Application context.|
| bgMode | [BackgroundMode](#backgroundmode8) | Yes| Background mode requested.|
| wantAgent | [WantAgent](js-apis-notification.md#WantAgent)| Yes| Notification parameter, which is used to specify the target page when a continuous task notification is clicked.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| context | [Context](js-apis-Context.md) | Yes| Application context.|
| bgMode | [BackgroundMode](#backgroundmode8) | Yes| Background mode requested.|
| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes| Notification parameter, which is used to specify the target page when a continuous task notification is clicked.|
**Return value**
| Type | Description |
| -------------- | ------------------------- |
......@@ -225,8 +226,6 @@ stopBackgroundRunning(context: Context, callback: AsyncCallback&lt;void&gt;): vo
Requests to cancel a continuous task. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.KEEP_BACKGROUND_RUNNING
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
**Parameters**
......@@ -258,8 +257,6 @@ stopBackgroundRunning(context: Context): Promise&lt;void&gt;
Requests to cancel a continuous task. This API uses a promise to return the result.
**Required permissions**: ohos.permission.KEEP_BACKGROUND_RUNNING
**System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
**Parameters**
......
......@@ -49,7 +49,7 @@ Inserts an entry at the front of this container.
**Example**
```
let deque = new Deque;
let deque = new Deque();
deque.insertFront("a");
deque.insertFront(1);
let b = [1, 2, 3];
......@@ -73,7 +73,7 @@ Inserts an entry at the end of this container.
**Example**
```
let deque = new Deque;
let deque = new Deque();
deque.insertEnd("a");
deque.insertEnd(1);
let b = [1, 2, 3];
......
# FormInfo
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Provides widget information.
## Modules to Import
```
import formInfo from '@ohos.application.formInfo';
```
## Required Permissions
None.
## FormInfo
Describes widget information.
**System capability**
SystemCapability.Ability.Form
| Name | Readable/Writable| Type | Description |
| ----------- | -------- | -------------------- | ------------------------------------------------------------ |
| bundleName | Read only | string | Name of the bundle to which the widget belongs. |
| moduleName | Read only | string | Name of the module to which the widget belongs. |
| abilityName | Read only | string | Name of the ability to which the widget belongs. |
| name | Read only | string | Widget name. |
| description | Read only | string | Description of the widget. |
| type | Read only | [FormType](#formtype) | Widget type. Currently, only JS widgets are supported.|
| jsComponentName | Read only | string | Component name of the JS widget. |
| colorMode | Read only | [ColorMode](#colormode) | Color mode of the widget. |
| isDefault | Read only | boolean | Whether the widget is the default one. |
| updateEnabled | Read only | boolean | Whether the widget is updatable. |
| formVisibleNotify | Read only | string | Whether to send a notification when the widget is visible. |
| relatedBundleName | Read only | string | Name of the associated bundle to which the widget belongs. |
| scheduledUpdateTime | Read only | string | Time when the widget was updated. |
| formConfigAbility | Read only | string | Configuration ability of the widget. |
| updateDuration | Read only | string | Widget update period.|
| defaultDimension | Read only | number | Default dimension of the widget. |
| supportDimensions | Read only | Array&lt;number&gt; | Dimensions supported by the widget. |
| customizeData | Read only | {[key: string]: [value: string]} | Custom data of the widget. |
## FormType
Enumerates the widget types.
**System capability**
SystemCapability.Ability.Form
| Name | Value | Description |
| ----------- | ---- | ------------ |
| JS | 1 | JS widget. |
## ColorMode
Enumerates the color modes supported by the widget.
**System capability**
SystemCapability.Ability.Form
| Name | Value | Description |
| ----------- | ---- | ------------ |
| MODE_AUTO | -1 | Automatic mode. |
| MODE_DARK | 0 | Dark mode. |
| MODE_LIGHT | 1 | Light mode. |
## FormStateInfo
Describes the widget state information.
**System capability**
SystemCapability.Ability.Form
| Name | Readable/Writable| Type | Description |
| ----------- | -------- | -------------------- | ------------------------------------------------------------ |
| formState | Read only | [FormState](#formstate) | Widget state. |
| want | Read only | Want | Want text. |
## FormState
Enumerates the widget states.
**System capability**
SystemCapability.Ability.Form
| Name | Value | Description |
| ----------- | ---- | ------------ |
| UNKNOWN | -1 | Unknown state. |
| DEFAULT | 0 | Default state. |
| READY | 1 | Ready state. |
## FormParam
Enumerates the widget parameters.
**System capability**
SystemCapability.Ability.Form
| Name | Value | Description |
| ----------- | ---- | ------------ |
| IDENTITY_KEY | "ohos.extra.param.key.form_identity" | ID of a widget. |
| DIMENSION_KEY | "ohos.extra.param.key.form_dimension" | Widget dimension. |
| NAME_KEY | "ohos.extra.param.key.form_name" | Widget name. |
| MODULE_NAME_KEY | "ohos.extra.param.key.module_name" | Name of the module to which the widget belongs. |
| WIDTH_KEY | "ohos.extra.param.key.form_width" | Widget width. |
| HEIGHT_KEY | "ohos.extra.param.key.form_height" | Widget height. |
| TEMPORARY_KEY | "ohos.extra.param.key.form_temporary" | Temporary widget. |
......@@ -25,7 +25,7 @@ Creates a **FormBindingData** object.
| Name| Type | Mandatory| Description |
| ------ | -------------- | ---- | ------------------------------------------------------------ |
| obj | Object or string| No | Data to be displayed on the JS service widget. The value can be an object containing multiple key-value pairs or a string in JSON format.|
| obj | Object or string| No | Data to be displayed on the JS service widget. The value can be an object containing multiple key-value pairs or a string in JSON format. The image data is identified by "formImages", and the content is multiple key-value pairs, each of which consists of an image identifier and image file descriptor. The final format is {"formImages": {"key1": fd1, "key2": fd2}}.|
**Return value**
......@@ -38,20 +38,20 @@ Creates a **FormBindingData** object.
**Example**
```js
let obj = {"temperature": "21°"};
let fd = fileio.openSync(path);
let obj = {
"temperature": "21°",
"formImages": {"image": fd}
};
let formBindingDataObj = formBindingData.createFormBindingData(obj);
```
## formBindingData.FormBindingData
data: Object
## Attributes
Describes a **FormBindingData** object.
**System capability**: SystemCapability.Ability.Form
**Parameters**
| Name| Type | Description |
| ---- | -------------- | ------------------------------------------------------------ |
| data | Object or string| Data to be displayed on the JS service widget. The value can be an object containing multiple key-value pairs or a string in JSON format.|
| Name| Readable| Writable| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- | -------- |
| data | Yes| No| Object | Yes| Data to be displayed on the JS service widget. The value can be an object containing multiple key-value pairs or a string in JSON format.|
# FormError
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Provides widget-related error codes.
## Modules to Import
```
import formError from '@ohos.application.formError';
```
## Required Permissions
None.
## enum FormError
Enumerates the available error codes.
**System capability**
SystemCapability.Ability.Form
| Name | Value | Description |
| ----------- | ---- | ------------ |
| ERR_COMMON | 1 | Default error code. |
| ERR_PERMISSION_DENY | 2 | No permission to perform the operation. |
| ERR_GET_INFO_FAILED | 4 | Failed to query widget information. |
| ERR_GET_BUNDLE_FAILED | 5 | Failed to query the bundle information. |
| ERR_GET_LAYOUT_FAILED | 6 | Failed to query the layout information. |
| ERR_ADD_INVALID_PARAM | 7 | Invalid parameter. |
| ERR_CFG_NOT_MATCH_ID | 8 | The widget ID does not match. |
| ERR_NOT_EXIST_ID | 9 | The widget ID does not exist. |
| ERR_BIND_PROVIDER_FAILED | 10 | Failed to bind to the widget provider. |
| ERR_MAX_SYSTEM_FORMS | 11 | The number of system widgets exceeds the upper limit. |
| ERR_MAX_INSTANCES_PER_FORM | 12 | The number of instances per widget exceeds the upper limit. |
| ERR_OPERATION_FORM_NOT_SELF | 13 | The application is not allowed to operate widgets applied by other applications. |
| ERR_PROVIDER_DEL_FAIL | 14 | The widget provider failed to delete the widget. |
| ERR_MAX_FORMS_PER_CLIENT | 15 | The number of widgets applied for by the widget host exceeds the upper limit. |
| ERR_MAX_SYSTEM_TEMP_FORMS | 16 | The number of temporary widgets exceeds the upper limit. |
| ERR_FORM_NO_SUCH_MODULE | 17 | The module does not exist. |
| ERR_FORM_NO_SUCH_ABILITY | 18 | The ability component does not exist. |
| ERR_FORM_NO_SUCH_DIMENSION | 19 | The widget dimension does not exist. |
| ERR_FORM_FA_NOT_INSTALLED | 20 | The FA where the widget is located is not installed. |
| ERR_SYSTEM_RESPONSES_FAILED | 30 | The system service failed to respond. |
| ERR_FORM_DUPLICATE_ADDED | 31 | The widget has been added. |
| ERR_IN_RECOVERY | 36 | Failed to overwrite the widget data. |
此差异已折叠。
......@@ -61,6 +61,12 @@ SystemCapability.Ability.Form
| formId | string | Yes | ID of a widget. |
| minute | number | Yes | Refresh interval, in minutes. The value must be greater than or equal to 5. |
**Return value**
| Type | Description |
| ------------- | ---------------------------------- |
| Promise\<void> |Promise used to return the result. |
**Example**
```js
......@@ -118,6 +124,12 @@ SystemCapability.Ability.Form
| formId | string | Yes | ID of the widget to update.|
| formBindingData | [FormBindingData](js-apis-formbindingdata.md#formbindingdata) | Yes | Data to be used for the update. |
**Return value**
| Type | Description |
| -------------- | ----------------------------------- |
| Promise\<void> | Promise used to return the result.|
**Example**
```js
......
# Input Event Client
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> - The APIs of this module are system APIs and cannot be called by third-party applications.
## Modules to Import
```
import inputEventClient from '@ohos.multimodalInput.inputEventClient';
```
## inputEventClient.injectEvent
injectEvent({KeyEvent: KeyEvent}): void
Injects a key.
**System capability**: SystemCapability.MultimodalInput.Input.InputSimulator
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| KeyEvent | [KeyEvent](#keyevent) | Yes| Information about the key to inject.|
**Example**
```
let keyEvent = {
isPressed: true,
keyCode: 2,
keyDownDuration: 0,
isIntercepted: false
}
res = inputEventClient.injectEvent({KeyEvent: keyEvent});
```
## KeyEvent
Defines the information about the key to inject.
**System capability**: SystemCapability.MultimodalInput.Input.InputSimulator
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| isPressed | boolean | Yes| Whether the key is pressed.|
| keyCode | Number | Yes| Key code.|
| keyDownDuration | boolean | Yes| Duration for which the key is pressed.|
| isIntercepted | Number | Yes| Whether the key can be intercepted.|
......@@ -893,7 +893,7 @@ Defines the network capability set.
| linkUpBandwidthKbps | number | Uplink (from the device to the network) bandwidth.|
| linkDownBandwidthKbps | number | Downlink (from the network to the device) bandwidth.|
| networkCap | Array<[NetCap](#netcap)> | Network capability. |
| bearerTypes | Array<[NetBearType](#netbearType)> | Network type. |
| bearerTypes | Array<[NetBearType](#netbeartype)> | Network type. |
## NetCap
......
......@@ -528,6 +528,7 @@ vector.increaseCapacityTo(8);
```
### trimToCurrentLength
trimToCurrentLength(): void
Trims the capacity of this container into its current length.
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册