提交 85ca2bbc 编写于 作者: L LiAn 提交者: Gitee

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

Signed-off-by: NLiAn <lian15@huawei.com>
......@@ -22,9 +22,11 @@ This repository stores device and application development documents provided by
- OpenHarmony 3.1 Release. [Learn more](en/release-notes/OpenHarmony-v3.1-release.md)
This version is upgraded to OpenHarmony 3.1.1 LTS. [Learn more](en/release-notes/OpenHarmony-v3.1.1-release.md)
- OpenHarmony 3.0 LTS. [Learn more](en/release-notes/OpenHarmony-v3.0-LTS.md)
This version is upgraded to OpenHarmony 3.0.3 LTS. [Learn more](en/release-notes/OpenHarmony-v3.0.3-LTS.md)
This version is upgraded to OpenHarmony 3.0.5 LTS. [Learn more](en/release-notes/OpenHarmony-v3.0.5-LTS.md)
- OpenHarmony 2.2 Beta2. [Learn more](en/release-notes/OpenHarmony-v2.2-beta2.md)
......@@ -41,10 +43,14 @@ OpenHarmony_v1.x_release: OpenHarmony v1.1.4 LTS. [Learn more](en/release-notes/
Third-party license: [Third-Party Open-Source Software and License Notice](en/contribute/third-party-open-source-software-and-license-notice.md)
## How to Contribute
## Contribution
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](en/contribute/how-to-contribute.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](en/contribute/documentation-contribution.md).
Excellent contributors will be awarded and the contributions will be publicized in the developer community.
- Mail list: docs@openharmony.io
- Zulip group: documentation_sig
\ No newline at end of file
......@@ -30,7 +30,7 @@ A Service ability is used to run tasks in the background, such as playing music
},
onConnect(want) {
console.log('ServiceAbility OnConnect');
return null;
return new FirstServiceAbilityStub('test');
},
onDisconnect(want) {
console.log('ServiceAbility OnDisConnect');
......@@ -113,8 +113,6 @@ let promise = featureAbility.startAbility(
Once created, the Service ability keeps running in the background. The system does not stop or destroy it unless memory resources must be reclaimed.
### Connecting to a Local Service Ability
If you need to connect a Service ability to a Page ability or to a Service ability in another application, you must first implement the **IAbilityConnection** API for the connection. A Service ability allows other abilities to connect to it through **connectAbility()**.
......@@ -124,7 +122,7 @@ You can use either of the following methods to connect to a Service ability:
1. Using the IDL to automatically generate code
Use OpenHarmony Interface Definition Language (IDL) to automatically generate the corresponding client, server, and **IRemoteObject** code. For details, see [“Development Using TS” in OpenHarmony IDL Specifications and User Guide](https://gitee.com/openharmony/docs/blob/master/en/application-dev/IDL/idl-guidelines.md#development-using-ts).
Use OpenHarmony Interface Definition Language (IDL) to automatically generate the corresponding client, server, and **IRemoteObject** code. For details, see “Development Using TS" in [OpenHarmony IDL Specifications and User Guide](../IDL/idl-guidelines.md).
2. Writing code in the corresponding file
......@@ -135,41 +133,36 @@ You can use either of the following methods to connect to a Service ability:
```javascript
import prompt from '@system.prompt'
let mRemote;
function onConnectCallback(element, remote){
console.log('onConnectLocalService onConnectDone element: ' + element);
console.log('onConnectLocalService onConnectDone remote: ' + remote);
mRemote = remote;
if (mRemote == null) {
var option = {
onConnect: function onConnectCallback(element, proxy) {
console.log(`onConnectLocalService onConnectDone`)
if (proxy === null) {
prompt.showToast({
message: "onConnectLocalService not connected yet"
});
return;
message: "Connect service failed"
})
return
}
let option = new rpc.MessageOption();
let data = new rpc.MessageParcel();
let reply = new rpc.MessageParcel();
data.writeInt(1);
data.writeInt(99);
mRemote.sendRequest(1, data, reply, option).then((result) => {
console.log('sendRequest success');
let msg = reply.readInt();
let data = rpc.MessageParcel.create()
let reply = rpc.MessageParcel.create()
let option = new rpc.MessageOption()
data.writeInterfaceToken("connect.test.token")
proxy.sendRequest(0, data, reply, option)
prompt.showToast({
message: "onConnectLocalService connect result: " + msg,
duration: 3000
});
}).catch((e) => {
console.log('sendRequest error:' + e);
});
}
function onDisconnectCallback(element){
console.log('ConnectAbility onDisconnect Callback')
message: "Connect service success"
})
},
onDisconnect: function onDisconnectCallback(element) {
console.log(`onConnectLocalService onDisconnectDone element:${element}`)
prompt.showToast({
message: "Disconnect service success"
})
},
onFailed: function onFailedCallback(code) {
console.log(`onConnectLocalService onFailed errCode:${code}`)
prompt.showToast({
message: "Connect local service onFailed"
})
}
function onFailedCallback(code){
console.log('ConnectAbility onFailed Callback')
}
```
......@@ -197,45 +190,28 @@ You can use either of the following methods to connect to a Service ability:
```javascript
import rpc from "@ohos.rpc";
let mMyStub;
export default {
onStart() {
class MyStub extends rpc.RemoteObject{
constructor(des) {
class FirstServiceAbilityStub extends rpc.RemoteObject {
constructor(des: any) {
if (typeof des === 'string') {
super(des);
super(des)
} else {
return
}
return null;
}
onRemoteRequest(code, data, reply, option) {
console.log("ServiceAbility onRemoteRequest called");
onRemoteRequest(code: number, data: any, reply: any, option: any) {
console.log(printLog + ` onRemoteRequest called`)
if (code === 1) {
let op1 = data.readInt();
let op2 = data.readInt();
console.log("op1 = " + op1 + ", op2 = " + op2);
reply.writeInt(op1 + op2);
let string = data.readString()
console.log(printLog + ` string=${string}`)
let result = Array.from(string).sort().join('')
console.log(printLog + ` result=${result}`)
reply.writeString(result)
} else {
console.log("ServiceAbility unknown request code");
console.log(printLog + ` unknown request code`)
}
return true;
}
}
mMyStub = new MyStub("ServiceAbility-test");
},
onCommand(want, startId) {
console.log('ServiceAbility onCommand');
},
onConnect(want) {
console.log('ServiceAbility OnConnect');
return mMyStub;
},
onDisconnect(want) {
console.log('ServiceAbility OnDisConnect');
},
onStop() {
console.log('ServiceAbility onStop');
},
}
```
### Connecting to a Remote Service Ability
......@@ -253,40 +229,36 @@ The following code snippet shows how to implement the callbacks:
```ts
import prompt from '@system.prompt'
let mRemote;
function onConnectCallback(element, remote){
console.log('onConnectRemoteService onConnectDone element: ' + element);
console.log('onConnectRemoteService onConnectDone remote: ' + remote);
mRemote = remote;
if (mRemote == null) {
var option = {
onConnect: function onConnectCallback(element, proxy) {
console.log(`onConnectRemoteService onConnectDone`)
if (proxy === null) {
prompt.showToast({
message: "onConnectRemoteService not connected yet"
});
return;
message: "Connect service failed"
})
return
}
let option = new rpc.MessageOption();
let data = new rpc.MessageParcel();
let reply = new rpc.MessageParcel();
data.writeInt(1);
data.writeInt(99);
mRemote.sendRequest(1, data, reply, option).then((result) => {
console.log('sendRequest success');
let msg = reply.readInt();
let data = rpc.MessageParcel.create()
let reply = rpc.MessageParcel.create()
let option = new rpc.MessageOption()
data.writeInterfaceToken("connect.test.token")
proxy.sendRequest(0, data, reply, option)
prompt.showToast({
message: "onConnectRemoteService connect result: " + msg,
duration: 3000
});
}).catch((e) => {
console.log('sendRequest error:' + e);
});
}
function onDisconnectCallback(element){
console.log('ConnectRemoteAbility onDisconnect Callback')
}
function onFailedCallback(code){
console.log('ConnectRemoteAbility onFailed Callback')
message: "Connect service success"
})
},
onDisconnect: function onDisconnectCallback(element) {
console.log(`onConnectRemoteService onDisconnectDone element:${element}`)
prompt.showToast({
message: "Disconnect service success"
})
},
onFailed: function onFailedCallback(code) {
console.log(`onConnectRemoteService onFailed errCode:${code}`)
prompt.showToast({
message: "Connect local service onFailed"
})
}
}
```
......@@ -372,23 +344,25 @@ The following code snippet shows how the Service ability instance returns itself
```ts
import rpc from "@ohos.rpc";
class FirstServiceAbilityStub extends rpc.RemoteObject{
constructor(des) {
class FirstServiceAbilityStub extends rpc.RemoteObject {
constructor(des: any) {
if (typeof des === 'string') {
super(des);
super(des)
} else {
return null;
return
}
}
onRemoteRequest(code, data, reply, option) {
console.log("ServiceAbility onRemoteRequest called");
onRemoteRequest(code: number, data: any, reply: any, option: any) {
console.log(printLog + ` onRemoteRequest called`)
if (code === 1) {
let op1 = data.readInt();
let op2 = data.readInt();
console.log("op1 = " + op1 + ", op2 = " + op2);
reply.writeInt(op1 + op2);
let string = data.readString()
console.log(printLog + ` string=${string}`)
let result = Array.from(string).sort().join('')
console.log(printLog + ` result=${result}`)
reply.writeString(result)
} else {
console.log("ServiceAbility unknown request code");
console.log(printLog + ` unknown request code`)
}
return true;
}
......
......@@ -14,6 +14,7 @@ You can `import` the native .so that contains the JS processing logic. For examp
* Add **static** to the **nm_register_func** function to prevent symbol conflicts with other .so files.
* The name of the module registration entry, that is, the function decorated by **\_\_attribute\_\_((constructor))**, must be unique.
### .so Naming Rules
Each module has a .so file. For example, if the module name is `hello`, name the .so file **libhello.so**. The `nm_modname` field in `napi_module` must be `hello`, which is the same as the module name. The sample code for importing the .so file is `import hello from 'libhello.so'`.
......@@ -25,6 +26,10 @@ The Ark engine prevents NAPIs from being called to operate JS objects in non-JS
* The NAPIs can be used only in JS threads.
* **env** is bound to a thread and cannot be used across threads. The JS object created by a NAPI can be used only in the thread, in which the object is created, that is, the JS object is bound to the **env** of the thread.
### Importing Header Files
Before using NAPI objects and methods, include **napi/native_api.h**. Otherwise, when only the third-party library header file is included, an error will be reporting, indicating that the interface cannot be found.
### napi_create_async_work
**napi_create_async_work** has two callbacks:
......@@ -635,3 +640,8 @@ export default {
}
}
```
## Samples
The following samples are provided for native API development:
- [`NativeAPI`: NativeAPI (eTS) (API8)](https://gitee.com/openharmony/app_samples/tree/master/Native/NativeAPI)
- [First Native C++ Application (eTS) (API9)](https://gitee.com/openharmony/codelabs/tree/master/NativeAPI/NativeTemplateDemo)
- [Native Component (eTS) (API9) ](https://gitee.com/openharmony/codelabs/tree/master/NativeAPI/XComponent)
......@@ -89,7 +89,7 @@ Adds an app account name and additional information (information that can be con
### addAccount
addAccount(name: string, extraInfo: string): Promise&lt;void&gt;
addAccount(name: string, extraInfo?: string): Promise&lt;void&gt;
Adds an app account name and additional information (information that can be converted into the string type, such as token) to the **AppAccountManager** service. This API uses a promise to return the result.
......@@ -100,7 +100,7 @@ Adds an app account name and additional information (information that can be con
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ---------------------------------------- |
| name | string | Yes | Name of the app account to add. |
| extraInfo | string | Yes | Additional information to add. The additional information cannot contain sensitive information, such as the app account password.|
| extraInfo | string | No | Additional information to add. The additional information cannot contain sensitive information, such as the app account password.|
**Return value**
......@@ -1696,7 +1696,7 @@ Checks whether an app account has specific labels. This API uses an asynchronous
| name | string | Yes | Name of the target app account. |
| owner | string | Yes | Owner of the app account. The value is the bundle name of the app.|
| labels | Array&lt;string&gt; | Yes | Labels to check. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback invoked to return the result. |
**Example**
......@@ -1710,7 +1710,7 @@ Checks whether an app account has specific labels. This API uses an asynchronous
### checkAccountLabels<sup>9+</sup>
checkAccountLabels(name: string, owner: string, labels: Array&lt;string&gt;): Promise&lt;void&gt;
checkAccountLabels(name: string, owner: string, labels: Array&lt;string&gt;): Promise&lt;boolean&gt;
Checks whether an app account has specific labels. This API uses a promise to return the result.
......@@ -1771,7 +1771,7 @@ Selects the accounts accessible to the requester based on the options. This API
### selectAccountsByOptions<sup>9+</sup>
selectAccountsByOptions(options: SelectAccountsOptions): Promise&lt;void&gt;
selectAccountsByOptions(options: SelectAccountsOptions): Promise&lt;Array&lt;AppAccountInfo&gt;&gt;
Selects the accounts accessible to the requester based on the options. This API uses a promise to return the result.
......@@ -1836,7 +1836,7 @@ Verifies the user credential. This API uses an asynchronous callback to return t
### verifyCredential<sup>9+</sup>
verifyCredential(name: string, owner: string, options, callback: AuthenticatorCallback): void;
verifyCredential(name: string, owner: string, options: VerifyCredentialOptions, callback: AuthenticatorCallback): void;
Verifies the user credential. This API uses an asynchronous callback to return the result.
......@@ -1953,10 +1953,10 @@ Defines OAuth token information.
**System capability**: SystemCapability.Account.AppAccount
| Name | Type | Mandatory | Description |
| -------- | ------ | ---- | -------- |
| authType | string | Yes | Authentication type.|
| -------------------- | -------------- | ----- | ---------------- |
| authType | string | Yes | Authentication type. |
| token | string | Yes | Value of the token. |
| account<sup>9+</sup> | AppAccountInfo | No | Account information of the token. |
| account<sup>9+</sup> | AppAccountInfo | No | Account information of the token.|
## AuthenticatorInfo<sup>8+</sup>
......@@ -1978,7 +1978,7 @@ Represents the options for selecting accounts.
| Name | Type | Mandatory | Description |
| --------------- | --------------------------- | ----- | ------------------- |
| allowedAccounts | Array&lt;[AppAccountInfo](#appAccountinfo)&gt; | No | Allowed accounts. |
| allowedAccounts | Array&lt;[AppAccountInfo](#appaccountinfo)&gt; | No | Allowed accounts. |
| allowedOwners | Array&lt;string&gt; | No | Allowed account owners.|
| requiredLabels | Array&lt;string&gt; | No | Labels required for the authenticator. |
......@@ -2013,7 +2013,7 @@ Enumerates the constants.
**System capability**: SystemCapability.Account.AppAccount
| Name | Default Value | Description |
| ----------------------------- | ---------------------- | ------------- |
| -------------------------------- | ---------------------- | ----------------------- |
| ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | Operation of adding an account implicitly. |
| ACTION_AUTHENTICATE | "authenticate" | Authentication operation. |
| KEY_NAME | "name" | App account name. |
......@@ -2025,8 +2025,8 @@ Enumerates the constants.
| KEY_CALLER_PID | "callerPid" | PID of the caller. |
| KEY_CALLER_UID | "callerUid" | UID of the caller. |
| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Bundle name of the caller. |
| KEY_REQUIRED_LABELS | "requiredLabels" | Required labels. |
| KEY_BOOLEAN_RESULT | "booleanResult" | Return value of the Boolean type. |
| KEY_REQUIRED_LABELS<sup>9+</sup> | "requiredLabels" | Required labels. |
| KEY_BOOLEAN_RESULT<sup>9+</sup> | "booleanResult" | Return value of the Boolean type. |
## ResultCode<sup>8+</sup>
......@@ -2125,7 +2125,7 @@ Called to redirect a request.
### onRequestContinued<sup>9+</sup>
onRequestContinued: () =&gt; void
onRequestContinued?: () =&gt; void
Called to continue to process the request.
......
......@@ -2148,11 +2148,10 @@ Subscribes to audio capturer change events.
**System capability**: SystemCapability.Multimedia.Audio.Capturer
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ------------------------------------------------------------------- ---- |
| -------- | ------- | --------- | ----------------------------------------------------------------------- |
| type | string | Yes | Event type. The event `'audioCapturerChange'` is triggered when the audio capturer changes. |
| callback | Callback<[AudioCapturerChangeInfoArray](#audiocapturerchangeinfoarray9)> | Yes | Callback used to return the result. |
| callback | Callback\<[AudioCapturerChangeInfoArray](#audiocapturerchangeinfoarray9)> | Yes | Callback used to return the result. |
**Example**
```
......
......@@ -18,9 +18,11 @@ The **ApplicationInfo** module provides application information. Unless otherwis
| systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. |
| enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. |
| label | string | Yes | No | Application label. |
| labelId | string | Yes | No | Application label ID. |
| labelId<sup>(deprecated)</sup> | string | Yes | No | Application label ID.<br>\- **NOTE**: This attribute is deprecated from API version 9. Use **labelIndex** instead. |
| labelIndex<sup>9+</sup> | number | Yes | No | Index of the application label.|
| icon | string | Yes | No | Application icon. |
| iconId | string | Yes | No | Application icon ID. |
| iconId<sup>(deprecated)</sup> | string | Yes | No | Application icon ID.<br>\- **NOTE**: This attribute is deprecated from API version 9. Use **iconIndex** instead. |
| iconIndex<sup>9+</sup> | number | Yes | No | Index of the application icon.|
| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used. |
| supportedModes | number | Yes | No | Running modes supported by the application. |
| moduleSourceDirs | Array\<string> | Yes | No | Relative paths for storing application resources. |
......
......@@ -2,9 +2,11 @@
The **DataShareResultSet** module provides APIs for accessing the result set obtained from the database. You can access the values in the specified rows or the value of the specified data type.
>**NOTE**
> **NOTE**
>
>The initial APIs of this module are supported since API version 9. 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 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module are system APIs.
## Modules to Import
......@@ -44,7 +46,10 @@ dataShareHelper.query(uri, da, columns).then((data) => {
});
```
## Attributes
## DataShareResultSet
Provides methods for accessing the result sets generated by querying the database.
### Attributes
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
......@@ -55,7 +60,7 @@ dataShareHelper.query(uri, da, columns).then((data) => {
| rowCount | number | Yes | Number of rows in the result set. |
| isClosed | boolean | Yes | Whether the result set is closed.|
## goToFirstRow
### goToFirstRow
goToFirstRow(): boolean
......@@ -76,7 +81,7 @@ let isGoTOFirstRow = resultSet.goToFirstRow();
console.info('resultSet.goToFirstRow: ' + isGoTOFirstRow);
```
## goToLastRow
### goToLastRow
goToLastRow(): boolean
......@@ -97,7 +102,7 @@ let isGoToLastRow = resultSet.goToLastRow();
console.info('resultSet.goToLastRow: ' + isGoToLastRow);
```
## goToNextRow
### goToNextRow
goToNextRow(): boolean
......@@ -118,7 +123,7 @@ let isGoToNextRow = resultSet.goToNextRow();
console.info('resultSet.goToNextRow: ' + isGoToNextRow);
```
## goToPreviousRow
### goToPreviousRow
goToPreviousRow(): boolean
......@@ -139,7 +144,7 @@ let isGoToPreviousRow = resultSet.goToPreviousRow();
console.info('resultSet.goToPreviousRow: ' + isGoToPreviousRow);
```
## goTo
### goTo
goTo(offset:number): boolean
......@@ -167,7 +172,7 @@ let isGoTo = resultSet.goTo(goToNum);
console.info('resultSet.goTo: ' + isGoTo);
```
## goToRow
### goToRow
goToRow(position: number): boolean
......@@ -195,7 +200,7 @@ let isGoToRow = resultSet.goToRow(goToRowNum);
console.info('resultSet.goToRow: ' + isGoToRow);
```
## getBlob
### getBlob
getBlob(columnIndex: number): Uint8Array
......@@ -224,7 +229,7 @@ let getBlob = resultSet.getBlob(columnIndex);
console.info('resultSet.getBlob: ' + getBlob);
```
## getString
### getString
getString(columnIndex: number): *string*
......@@ -253,7 +258,7 @@ let getString = resultSet.getString(columnIndex);
console.info('resultSet.getString: ' + getString);
```
## getLong
### getLong
getLong(columnIndex: number): number
......@@ -282,7 +287,7 @@ let getLong = resultSet.getLong(columnIndex);
console.info('resultSet.getLong: ' + getLong);
```
## getDouble
### getDouble
getDouble(columnIndex: number): number
......@@ -311,7 +316,7 @@ let getDouble = resultSet.getDouble(columnIndex);
console.info('resultSet.getDouble: ' + getDouble);
```
## close
### close
close(): void
......@@ -325,7 +330,7 @@ Closes this result set.
resultSet.close();
```
## getColumnIndex
### getColumnIndex
getColumnIndex(columnName: string): number
......@@ -353,7 +358,7 @@ let getColumnIndex = resultSet.getColumnIndex(ColumnName)
console.info('resultSet.getColumnIndex: ' + getColumnIndex);
```
## getColumnName
### getColumnName
getColumnName(columnIndex: number): *string*
......@@ -381,7 +386,7 @@ let getColumnName = resultSet.getColumnName(columnIndex)
console.info('resultSet.getColumnName: ' + getColumnName);
```
## getDataType
### getDataType
getDataType(columnIndex: number): DataType
......
......@@ -174,6 +174,42 @@ Obtains all display objects. This API uses a promise to return the result.
});
```
## display.hasPrivateWindow<sup>9+</sup>
hasPrivateWindow(displayId: number): boolean
Checks whether there is a visible privacy window on a display. The privacy window can be set by calling **[setPrivacyMode](js-apis-window.md#setprivacymode7)**. The content in the privacy window cannot be captured or recorded.
This is a system API.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------------------------- | ---- |----------|
| id | number | Yes | ID of the display.|
**Return value**
| Type | Description |
| -------------------------------- |-----------------------------------------------------------------------|
|boolean | Whether there is a visible privacy window on the display.<br>The value **true** means that there is a visible privacy window on the display, and **false** means the opposite.<br>|
**Example**
```js
var ret = display.hasPrivateWindow(displayClass.id);
if (ret == undefined) {
console.log("HasPrivateWindow undefined.");
}
if (ret) {
console.log("HasPrivateWindow.");
} else if (!ret) {
console.log("Don't HasPrivateWindow.");
}
```
## display.on('add'|'remove'|'change')
on(type: 'add'|'remove'|'change', callback: Callback&lt;number&gt;): void
......
......@@ -19,8 +19,6 @@ getDistributedAccountAbility(): DistributedAccountAbility
Obtains a **DistributedAccountAbility** instance.
**System capability**: SystemCapability.Account.OsAccount
- Return value
| Type| Description|
| -------- | -------- |
......@@ -43,7 +41,7 @@ Obtains distributed account information. This API uses an asynchronous callback
**System capability**: SystemCapability.Account.OsAccount
**Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC (available only to system applications)
**Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC
- Parameters
| Name| Type| Mandatory| Description|
......@@ -68,7 +66,7 @@ Obtains distributed account information. This API uses a promise to return the r
**System capability**: SystemCapability.Account.OsAccount
**Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC (available only to system applications)
**Required permissions**: ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC
- Return value
| Type| Description|
......
......@@ -16,22 +16,23 @@ import image from '@ohos.multimedia.image';
createPixelMap(colors: ArrayBuffer, options: InitializationOptions): Promise\<PixelMap>
Creates a **PixelMap** object. This API uses a promise to return the result.
Creates a **PixelMap** object with the default BGRA_8888 format and pixel properties specified. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Image.Core
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------------------------------------------------ | ---- | ------------------------------------------------------------ |
| ------- | ------------------------------------------------ | ---- | ---------------------------------------------------------------- |
| colors | ArrayBuffer | Yes | Color array in BGRA_8888 format. |
| options | [InitializationOptions](#initializationoptions8) | Yes | Pixel properties, including the alpha type, size, scale mode, pixel format, and editable.|
**Return value**
| Type | Description |
| -------------------------------- | -------------- |
| Promise\<[PixelMap](#pixelmap7)> | Promise used to return the **PixelMap** object.|
| -------------------------------- | ----------------------------------------------------------------------- |
| Promise\<[PixelMap](#pixelmap7)> | Promise used to return the **PixelMap** object.<br>If the size of the created pixel map exceeds that of the original image, the pixel map size of the original image is returned.|
**Example**
......@@ -48,7 +49,7 @@ image.createPixelMap(color, opts)
createPixelMap(colors: ArrayBuffer, options: InitializationOptions, callback: AsyncCallback\<PixelMap>): void
Creates a **PixelMap** object. This API uses an asynchronous callback to return the result.
Creates a **PixelMap** object with the default BGRA_8888 format and pixel properties specified. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Image.Core
......@@ -91,7 +92,7 @@ Provides APIs to read or write image pixel map data and obtain image pixel map i
readPixelsToBuffer(dst: ArrayBuffer): Promise\<void>
Reads image pixel map data and writes the data to an **ArrayBuffer**. This API uses a promise to return the result.
Reads image pixel map data and writes the data to an **ArrayBuffer**. This API uses a promise to return the result. If the pixel map is created in the BGRA_8888 format, the pixel map data read is the same as the original data.
**System capability**: SystemCapability.Multimedia.Image.Core
......@@ -122,7 +123,7 @@ pixelmap.readPixelsToBuffer(readBuffer).then(() => {
readPixelsToBuffer(dst: ArrayBuffer, callback: AsyncCallback\<void>): void
Reads image pixel map data and writes the data to an **ArrayBuffer**. This API uses an asynchronous callback to return the result.
Reads image pixel map data and writes the data to an **ArrayBuffer**. This API uses an asynchronous callback to return the result. If the pixel map is created in the BGRA_8888 format, the pixel map data read is the same as the original data.
**System capability**: SystemCapability.Multimedia.Image.Core
......@@ -1008,7 +1009,7 @@ const imageSourceApi = image.createImageSource(fd);
createImageSource(buf: ArrayBuffer): ImageSource
Creates an **ImageSource** instance based on the buffer.
Creates an **ImageSource** instance based on the buffers.
**System capability**: SystemCapability.Multimedia.Image.ImageSource
......@@ -1029,7 +1030,7 @@ const imageSourceApi = image.createImageSource(buf);
createImageSource(buf: ArrayBuffer, options: SourceOptions): ImageSource
Creates an **ImageSource** instance based on the buffer.
Creates an **ImageSource** instance based on the buffers.
**System capability**: SystemCapability.Multimedia.Image.ImageSource
......@@ -1057,7 +1058,7 @@ const imageSourceApi = image.createImageSource(data);
CreateIncrementalSource(buf: ArrayBuffer): ImageSource
Creates an **ImageSource** instance in incremental mode based on the buffer.
Creates an **ImageSource** instance in incremental mode based on the buffers.
**System capability**: SystemCapability.Multimedia.Image.ImageSource
......@@ -1084,7 +1085,7 @@ const imageSourceApi = image.CreateIncrementalSource(buf);
CreateIncrementalSource(buf: ArrayBuffer, options?: SourceOptions): ImageSource
Creates an **ImageSource** instance in incremental mode based on the buffer.
Creates an **ImageSource** instance in incremental mode based on the buffers.
**System capability**: SystemCapability.Multimedia.Image.ImageSource
......@@ -2246,7 +2247,7 @@ Describes image properties.
## PropertyKey<sup>7+</sup>
Describes the exchangeable image file format (Exif) information of an image.
Describes the exchangeable image file format (EXIF) information of an image.
**System capability**: SystemCapability.Multimedia.Image.Core
......@@ -2322,7 +2323,7 @@ Enumerates the response codes returned upon build errors.
| ERR_IMAGE_CROP | 62980109 | An error occurs during image cropping. |
| ERR_IMAGE_SOURCE_DATA | 62980110 | The image source data is incorrect. |
| ERR_IMAGE_SOURCE_DATA_INCOMPLETE | 62980111 | The image source data is incomplete. |
| ERR_IMAGE_MISMATCHED_FORMAT | 62980112 | The image format does not match. |
| ERR_IMAGE_MISMATCHED_FORMAT | 62980112 | The image formats do not match. |
| ERR_IMAGE_UNKNOWN_FORMAT | 62980113 | Unknown image format. |
| ERR_IMAGE_SOURCE_UNRESOLVED | 62980114 | The image source is not parsed. |
| ERR_IMAGE_INVALID_PARAMETER | 62980115 | Invalid image parameter. |
......@@ -2338,4 +2339,4 @@ Enumerates the response codes returned upon build errors.
| ERR_IMAGE_READ_PIXELMAP_FAILED | 62980246 | Failed to read the pixel map. |
| ERR_IMAGE_WRITE_PIXELMAP_FAILED | 62980247 | Failed to write the pixel map. |
| ERR_IMAGE_PIXELMAP_NOT_ALLOW_MODIFY | 62980248 | Modification to the pixel map is not allowed. |
| ERR_IMAGE_CONFIG_FAILED | 62980259 | The software parameter setting is incorrect. |
| ERR_IMAGE_CONFIG_FAILED | 62980259 | The configuration is incorrect. |
......@@ -2278,7 +2278,7 @@ Describes options for fetching media files.
| Name | Type | Readable| Writable| Mandatory| Description |
| ----------------------- | ------------------- | ---- | ---- | ---- | ------------------------------------------------------------ |
| selections | string | Yes | Yes | Yes | Conditions for fetching files. The enumerated values in [FileKey](#filekey8) are used as the column names of the conditions. Example:<br>selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? OR' +mediaLibrary.FileKey.MEDIA_TYPE + '= ?',|
| selections | string | Yes | Yes | Yes | Conditions for fetching files. The enumerated values in [FileKey](#filekey8) are used as the column names of the conditions. Example:<br>selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? OR ' +mediaLibrary.FileKey.MEDIA_TYPE + '= ?', |
| selectionArgs | Array&lt;string&gt; | Yes | Yes | Yes | Value of the condition, which corresponds to the value of the condition column in **selections**.<br>Example:<br>selectionArgs: [mediaLibrary.MediaType.IMAGE.toString(), mediaLibrary.MediaType.VIDEO.toString()], |
| order | string | Yes | Yes | No | Sorting mode of the search results, which can be ascending or descending. The enumerated values in [FileKey](#filekey8) are used as the columns for sorting the search results. Example:<br>Ascending: order: mediaLibrary.FileKey.DATE_ADDED + " AESC"<br>Descending: order: mediaLibrary.FileKey.DATE_ADDED + " DESC"|
| uri<sup>8+</sup> | string | Yes | Yes | No | File URI. |
......
# Prompt
The **Prompt** module provides APIs for creating and showing toasts, dialog boxes, and action menus.
> **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.
## Modules to Import
```
```js
import prompt from '@ohos.prompt'
```
## Required Permissions
None.
## prompt.showToast
showToast(options: ShowToastOptions): void
Shows the toast.
Shows a toast.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
......@@ -26,15 +26,11 @@ Shows the toast.
| options | [ShowToastOptions](#showtoastoptions) | Yes | Toast options.|
**Example**
```
export default {
showToast() {
prompt.showToast({
```js
prompt.showToast({
message: 'Message Info',
duration: 2000,
});
}
}
});
```
## ShowToastOptions
......@@ -43,10 +39,10 @@ Describes the options for showing the toast.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description |
| -------- | -------------- | ---- | ---------------------------------------- |
| message | string | Yes | Text to display. |
| -------- | ---------------------------------------- | ------ | ---------------------------------------- |
| message | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Text to display. |
| duration | number | No | Duration that the toast will remain on the screen. The default value is 1500 ms. The recommended value range is 1500 ms to 10000 ms. If a value less than 1500 ms is set, the default value is used.|
| bottom | &lt;length&gt; | No | Distance between the toast border and the bottom of the screen. |
| bottom | string\| number | No | Distance between the toast border and the bottom of the screen. |
## prompt.showDialog
......@@ -69,10 +65,8 @@ Shows a dialog box. This API uses a promise to return the result synchronously.
**Example**
```
export default {
showDialog() {
prompt.showDialog({
```js
prompt.showDialog({
title: 'Title Info',
message: 'Message Info',
buttons: [
......@@ -85,22 +79,20 @@ Shows a dialog box. This API uses a promise to return the result synchronously.
color: '#000000',
}
],
})
})
.then(data => {
console.info('showDialog success, click button: ' + data.index);
})
.catch(err => {
console.info('showDialog error: ' + err);
})
}
}
```
## prompt.showDialog
showDialog(options: ShowDialogOptions, callback: AsyncCallback&lt;ShowDialogSuccessResponse&gt;):void
Shows a dialog box. This API uses a callback to return the result asynchronously.
Shows a dialog box. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
......@@ -112,17 +104,8 @@ Shows a dialog box. This API uses a callback to return the result asynchronously
| callback | AsyncCallback&lt;[ShowDialogSuccessResponse](#showdialogsuccessresponse)&gt; | Yes | Callback used to return the dialog box response result. |
**Example**
```
export default {
callback(err, data) {
if(err) {
console.info('showDialog err: ' + err);
return;
}
console.info('showDialog success callback, click button: ' + data.index);
},
showDialog() {
prompt.showDialog({
```js
prompt.showDialog({
title: 'showDialog Title Info',
message: 'Message Info',
buttons: [
......@@ -135,9 +118,13 @@ Shows a dialog box. This API uses a callback to return the result asynchronously
color: '#000000',
}
]
}, this.callback);
}
}, (err, data) => {
if (err) {
console.info('showDialog err: ' + err);
return;
}
console.info('showDialog success callback, click button: ' + data.index);
});
```
## ShowDialogOptions
......@@ -147,10 +134,10 @@ Describes the options for showing the dialog box.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | ---------------------------------------- |
| title | string | No | Title of the text to display. |
| message | string | No | Text body. |
| buttons | Array | No | Array of buttons in the dialog box. The array structure is **{text:'button',&nbsp;color:&nbsp;'\#666666'}**. One to three buttons are supported. The first button is of the **positiveButton** type, the second is of the **negativeButton** type, and the third is of the **neutralButton** type.|
| ------- | ---------------------------------------- | ---- | ---------------------------------------- |
| title | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Title of the dialog box. |
| message | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Text body. |
| buttons | Array | No | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. Up to three buttons are supported. The first button is of the **positiveButton** type, the second is of the **negativeButton** type, and the third is of the **neutralButton** type.|
## ShowDialogSuccessResponse
......@@ -160,7 +147,7 @@ Describes the dialog box response result.
| Name | Type | Description |
| ----- | ------ | ------------------- |
| index | number | Index of the selected button in the array.|
| index | number | Index of the selected button in the **buttons** array.|
## prompt.showActionMenu
......@@ -179,17 +166,8 @@ Shows an action menu. This API uses a callback to return the result asynchronous
**Example**
```
export default {
callback(err, data) {
if(err) {
console.info('showActionMenu err: ' + err);
return;
}
console.info('showActionMenu success callback, click button: ' + data.index);
},
showActionMenu() {
prompt.showActionMenu({
```js
prompt.showActionMenu({
title: 'Title Info',
buttons: [
{
......@@ -201,14 +179,18 @@ Shows an action menu. This API uses a callback to return the result asynchronous
color: '#000000',
},
]
}, this.callback)
}
}, (err, data) => {
if (err) {
console.info('showActionMenu err: ' + err);
return;
}
console.info('showActionMenu success callback, click button: ' + data.index);
})
```
## prompt.showActionMenu
showActionMenu(options: ActionMenuOptions): Promise\<ActionMenuSuccessResponse>
showActionMenu(options: ActionMenuOptions): Promise&lt;ActionMenuSuccessResponse&gt;
Shows an action menu. This API uses a promise to return the result synchronously.
......@@ -225,10 +207,8 @@ Shows an action menu. This API uses a promise to return the result synchronously
| Promise&lt;[ActionMenuSuccessResponse](#actionmenusuccessresponse)&gt; | Promise used to return the action menu response result.|
**Example**
```
export default {
showActionMenu() {
prompt.showActionMenu({
```js
prompt.showActionMenu({
title: 'showActionMenu Title Info',
buttons: [
{
......@@ -240,15 +220,13 @@ Shows an action menu. This API uses a promise to return the result synchronously
color: '#000000',
},
]
})
})
.then(data => {
console.info('showActionMenu success, click button: ' + data.index);
})
.catch(err => {
console.info('showActionMenu error: ' + err);
})
}
}
```
## ActionMenuOptions
......@@ -257,9 +235,9 @@ Describes the options for showing the action menu.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | ---------------------------------------- |
| title | string | No | Title of the text to display. |
| buttons | Array | Yes | Array of menu items. The array structure is **{text:'button',&nbsp;color:&nbsp;'\#666666'}**. One to six items are supported. If there are more than six items, extra items will not be displayed.|
| ------- | ---------------------------------------- | ---- | ---------------------------------------- |
| title | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| No | Title of the text to display. |
| buttons | Array&lt;[Button](#button)&gt; | Yes | Array of menu item buttons. The array structure is **{text:'button', color: '\#666666'}**. Up to six buttons are supported. If there are more than six buttons, extra buttons will not be displayed.|
## ActionMenuSuccessResponse
......@@ -269,4 +247,15 @@ Describes the action menu response result.
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ------------------------ |
| index | number | No | Index of the selected button in the array, starting from **0**.|
| index | number | No | Index of the selected button in the **buttons** array, starting from **0**.|
## Button
Describes the menu item button in the action menu.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description |
| ----- | ---------------------------------------- | ---- | ------- |
| text | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Button text.|
| color | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Text color of the button.|
......@@ -1113,11 +1113,11 @@ Resumes this download task. This API uses an asynchronous callback to return the
| -------- | -------- | -------- | -------- |
| url | string | Yes| Resource URL.|
| header | object | No| HTTP or HTTPS header added to a download request.|
| enableMetered | boolean | No| Download allowed in metered connections.|
| enableRoaming | boolean | No| Download allowed on a roaming network.|
| enableMetered | boolean | No| Whether download is allowed on a metered connection.<br>- **true**: yes<br> **false**: no|
| enableRoaming | boolean | No| Whether download is allowed on a roaming network.<br>- **true**: yes<br> **false**: no|
| description | string | No| Description of the download session.|
| filePath<sup>7+</sup> | string | No| Download path. (The default path is **'internal://cache/'**.)<br>- filePath:'workspace/test.txt': The **workspace** directory is created in the default path to store files.<br>- filePath:'test.txt': Files are stored in the default path.<br>- filePath:'workspace/': The **workspace** directory is created in the default path to store files.|
| networkType | number | No| Network type allowed for download.|
| networkType | number | No| Network type allowed for download.<br>- NETWORK_MOBILE: 0x00000001<br>- NETWORK_WIFI: 0x00010000|
| title | string | No| Title of the download session.|
| background | boolean | No| Whether to enable the background task notification. When this parameter is enabled, the download status is displayed in the notification panel.|
......
......@@ -14,9 +14,9 @@
| 8 | Deprecated API description | Do not delete the deprecated content from the document. Instead, suffix `deprecated` as a superscript to the content, and use the greater-than sign (`>`) to introduce the substitute API plus a link to the API description.<br>Example: abandonmentMethod<sup>(deprecated)</sup><br>> This API is no longer maintained since API version 7. You are advised to use [newMethod]\(#newmethod) instead.|
| 9 | Permission description | Provide the same permission description as that defined in the code for each method, enum, and attribute.<br>1. If a specific permission required for using an API can be requested only by system applications, provide the description in the following format:<br> **Required permissions**: ohos.permission.examplePermission (available only to system applications)<br>2. If a specific permission required for using an API can be requested by all applications, provide the description in the following format:<br> **Required permissions**: ohos.permission.examplePermission<br>3. If multiple permissions are required for using an API, provide the permissions with `and` or `or` in the following format:<br> **Required permissions**: ohos.permission.examplePermissionA and ohos.permission.examplePermissionB<br> **Required permissions**: ohos.permission.examplePermissionA or ohos.permission.examplePermissionB|
| 10 | @syscap | 1. Provide a description for every API in the following format, wherein *A.B* indicates a specific system capability.<br> **System capability**: SystemCapability.*A.B*<br>2. There are two cases for adding system capability information to a table (of attributes, enums, constants, or variables).<br> 1) If all the items in a table require the same system capability, add the following information to the front of the table:<br> **System capability**: SystemCapability.*A.B*<br> 2) If the items in a table require different system capabilities,<br> list the system capability for each item in the table. |
| 11 | @system api | 1. If all APIs of a module are system APIs, add the following sentence to the next line of the initial version description:<br> The APIs provided by this module are system APIs.<br>2. If an API is a system API that can be used only by original equipment manufacturers (OEMs), add the following sentence to the API description:<br> This is a system API. |
| 12 | @FAModelOnly<br>@StageModelOnly | 1. If a module is implemented only for a specific ability model, add the following sentence to the next line of the initial version description:<br> - The APIs of this module can be used only in the FA model.<br>Or<br> - The APIs of this module can be used only in the stage model.<br>2. If an API is implemented only for a specific ability model, add the following sentence to the API description:<br> - This API can be used only in the FA model.<br>Or<br> - This API can be used only in the stage model.|
| 13 | Asynchronous methods (callback and promise)| Use the following sentences for callback methods.<br>Method introduction: *Describe the method.* This API uses an asynchronous callback to return the result.<br>Parameter description:<br>**callback\<boolean>**: Callback used to return the result. The value `true` indicates *something*, and `false` indicates the opposite.<br>**callback\<Object>**: Callback used to return *something*. Example: Callback used to return the `AudioCapturer` object. <br>**AsyncCallback\<void>**: Callback used to return the result. If the operation (or a specific operation description) is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.<br>**AsyncCallback\<Object x>**: Callback used to return the result. If the operation (or a specific operation description) is successful, `err` is `undefined`, and `data` is the *x* object obtained; otherwise, `err` is an `Error` object.<br>Use the following sentences for promise methods.<br>Method introduction: *Describe the method.* This API uses a promise to return the result.<br>Parameter description:<br>**Promise\<boolean>**: Promise used to return the result. The value `true` indicates *something*, and `false` indicates the opposite.<br>**Promise\<Object>**: Promise used to return *something*. Example: Promise used to return the `AudioCapturer` object. <br>**Promise\<void>**: Promise that returns no value. |
| 11 | @system api | 1. If all APIs of a module are system APIs, add the following sentence to the next line of the initial version description:<br> The APIs provided by this module are system APIs.<br>2. If an API is a system API that can be used only by original equipment manufacturers (OEMs), add the following sentence to the API description:<br> **System API**: This is a system API. |
| 12 | @FAModelOnly<br>@StageModelOnly | 1. If a module is implemented only for a specific ability model, add the following sentence to the next line of the initial version description:<br> The APIs of this module can be used only in the FA model.<br>Or<br> The APIs of this module can be used only in the stage model.<br>2. If an API is implemented only for a specific ability model, add the following sentence to the API description:<br> **Model restriction**: This API can be used only in the FA model.<br/>Or<br/> **Model restriction**: This API can be used only in the stage model. |
| 13 | Asynchronous methods (callback and promise)| Use the following sentences for callback methods.<br>Method introduction: *Describe the method.* This API uses an asynchronous callback to return the result.<br>Parameter description:<br>**callback\<boolean>**: Callback used to return the result. The value `true` indicates *something*, and `false` indicates the opposite.<br>**callback\<Object>**: Callback used to return *something*. Example: Callback used to return the `AudioCapturer` object. <br>**AsyncCallback\<void>**: Callback used to return the result. If the operation (or a specific operation description) is successful, `err` is `undefined`; otherwise, `err` is an `Error` object.<br>**AsyncCallback\<Object x>**: Callback used to return the result. If the operation (or a specific operation description) is successful, `err` is `undefined`, and `data` is the *x* object obtained; otherwise, `err` is an `Error` object.<br>Use the following sentences for promise methods.<br>Method introduction: *Describe the method.* This API uses a promise to return the result.<br>Parameter description:<br>**Promise\<boolean>**: Promise used to return the result. The value `true` indicates *something*, and `false` indicates the opposite.<br>**Promise\<Object>**: Promise used to return *something*. Example: Promise used to return the `AudioCapturer` object. <br>**Promise\<void>**: Promise that returns no value.|
| 14 | Sample code programming language | Use code blocks to provide sample code and mark the programming language.<br>Use `js` as the mark if both JS and eTS can be used, and use `ts` if only eTS can be used.|
| 15 | Link | Link format: [Link text]\(Link content)<br>Cross-folder link format: [markdown file name]\(\.\./../xxx/xxx.md). One `./` indicates one upper-level folder.<br>Intra-topic link: [Interface A<sup>7+</sup>]\(#xxxa7). The text in the intra-topic link must be the same as the title to be linked. In the link, all letters must be in lowercase, and no special character or label is included.|
......@@ -57,7 +57,6 @@ When compared with `LinkedList`, `ArrayList` is more efficient in random access
You are advised to use `ArrayList` when elements in a container need to be frequently read.
> **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.
## Modules to Import
......@@ -67,7 +66,7 @@ You are advised to use `ArrayList` when elements in a container need to be frequ
> 1. Write the modules to import based on the actual conditions. Provide the **import** statement in the form of a code block.
>
> 2. If no module needs to be imported, change "Modules to Import" to "Usage" and provide a usage description. <br>Example of **Usage**:<br>
> Before using the `AbilityContext`, obtain the `Context` object through [getContext()]\(*API-reference*.md).
> Before using the `AbilityContext`, obtain the `Context` object through \[getContext()]\(*API-reference*.md)\.
>
> ```js
> import ability_featureAbility from '@ohos.ability.featureAbility';
......@@ -106,7 +105,6 @@ import call from '@ohos.telephony.call';
> 2. Use the actual method name, in the format of ClassName.methodName, as the level-2 heading. For a subscription method, add the subscription event to the method name.
>
> Example of a common method: sim.getSimIccId
>
> Example of a subscription method: sim.on('exampleEvent')
>
> 3. **Method calling mode**: The description must be the same as that in the .d.ts file and include the parameter type, parameter name, and return value type.
......@@ -123,9 +121,9 @@ Provide the method name in the following format: (`static` if it is a static met
Describe the method. For details, see the fourth and fifth points in "Writing Instructions" above.
This API can be used only in the stage model. (optional)
**Model restriction**: This API can be used only in the FA model. (Delete this part if it is not involved.)
This is a system API. (optional)
**System API**: This is a system API. (Delete this part if it is not involved.)
**Required permissions**: ohos.permission.examplePermission (Delete this part if no permission is involved. If a system permission is required, specify it.)
......@@ -179,15 +177,15 @@ Provide the method name in the following format: (`static` if it is a static met
Describe the method. For details, see the fourth and fifth points in "Writing Instructions" under [Methods](#methods).
This API can be used only in the stage model. (optional)
**Model restriction**: This API can be used only in the FA model. (Delete this part if it is not involved.)
This is a system API. (optional)
**System API**: This is a system API. (Delete this part if it is not involved.)
**Required permissions**: ohos.permission.examplePermission (Delete this part if no permission is involved. If a system permission is required, specify it.)
**System capability**: SystemCapability.*A.B* (mandatory)
**Parameters** (Optional. Delete this heading if there is no parameter.)
**Parameters** (Optional. Delete this part if there is no parameter.)
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------ | ---- | ------------------------------------------------------------ |
......@@ -268,7 +266,7 @@ The following is an example of the custom type of a key-value pair.
| Name | Type | Readable| Writable| Description |
| ------------ | ------------------- | ---- | ---- | ------------------------------------------------------------ |
| parameterUrl | string | Yes | Yes | Media output URI. Supported: 1. Relative path whose protocol type is `internal`. Example: <br/>Temporary directory: internal://cache/test.mp4<br/> 2. Absolute path. Example:<br/> file:///data/data/ohos.xxx.xxx/files/test.mp4|
| parameterUrl | string | Yes | Yes | Media output URI. Supported:<br>1. Relative path whose protocol type is `internal`. Example: <br/>Temporary directory: internal://cache/test.mp4<br>2. Absolute path. Example:<br/>file:///data/data/ohos.xxx.xxx/files/test.mp4 |
| parameterOne | [CustomEnum](#Enumeration)| Yes | Yes | Describe the attributes. The requirements are similar to those for the parameter description. |
## Change History
......
......@@ -52,7 +52,7 @@ The camera module encapsulates camera operations in camera preview, photographin
| API | Description |
| ------------------------------------------------------------ | ---------------------------- |
| CamRetCode GetStreamOperator(<br> const OHOS::sptr<IStreamOperatorCallback> &callback,<br> OHOS::sptr<IStreamOperator> &streamOperator) | Obtains the stream controller. |
| CamRetCode UpdateSettings(const std::shared_ptr<CameraSetting> &settingss) | Updates device control parameters. |
| CamRetCode UpdateSettings(const std::shared_ptr<CameraSetting> &settings) | Updates device control parameters. |
| CamRetCode SetResultMode(const ResultCallbackMode &mode) | Sets the result callback mode and function.|
| CamRetCode GetEnabledResults(std::vector<MetaType> &results) | Obtains the enabled ResultMeta. |
| CamRetCode EnableResult(const std::vector<MetaType> &results) | Enables specific ResultMeta. |
......@@ -730,7 +730,7 @@ There is a camera demo in the **/drivers/peripheral/camera/hal/init** directory.
"-o | --offline stream offline test\n"
"-c | --capture capture one picture\n"
"-w | --set WB Set white balance Cloudy\n"
"-v | --video capture Viedeo of 10s\n"
"-v | --video capture Video of 10s\n"
"-a | --Set AE Set Auto exposure\n"
"-f | --Set Flashlight Set flashlight ON 5s OFF\n"
"-q | --quit stop preview and quit this app\n");
......
......@@ -175,7 +175,7 @@ VOID SendEntry(VOID)
ret = LOS_QueueWriteCopy(g_queue, abuf, len, 0);
if(ret != LOS_OK) {
printf("send message failure, error: %x\n", ret);
printf("Failed to send the message, error: %x\n", ret);
}
}
......@@ -189,17 +189,17 @@ VOID RecvEntry(VOID)
usleep(1000000);
ret = LOS_QueueReadCopy(g_queue, readBuf, &readLen, 0);
if(ret != LOS_OK) {
printf("recv message failure, error: %x\n", ret);
printf("Failed to receive the message, error: %x\n", ret);
}
printf("recv message: %s\n", readBuf);
ret = LOS_QueueDelete(g_queue);
if(ret != LOS_OK) {
printf("delete the queue failure, error: %x\n", ret);
printf("Failed to delete the queue, error: %x\n", ret);
}
printf("delete the queue success.\n");
printf("Deleted the queue successfully.\n");
}
UINT32 ExampleQueue(VOID)
......@@ -217,7 +217,7 @@ UINT32 ExampleQueue(VOID)
LOS_TaskLock();
ret = LOS_TaskCreate(&task1, &initParam);
if(ret != LOS_OK) {
printf("create task1 failed, error: %x\n", ret);
printf("Failed to create task1, error: %x\n", ret);
return ret;
}
......@@ -226,16 +226,16 @@ UINT32 ExampleQueue(VOID)
initParam.usTaskPrio = 10;
ret = LOS_TaskCreate(&task2, &initParam);
if(ret != LOS_OK) {
printf("create task2 failed, error: %x\n", ret);
printf("Failed to create task2, error: %x\n", ret);
return ret;
}
ret = LOS_QueueCreate("queue", 5, &g_queue, 0, 50);
if(ret != LOS_OK) {
printf("create queue failure, error: %x\n", ret);
printf("Failed to create the queue, error: %x\n", ret);
}
printf("create the queue succes.\n");
printf("Created the queue successfully.\n");
LOS_TaskUnlock();
return ret;
}
......
......@@ -75,7 +75,7 @@ The following table describes the APIs available for signal operations.
>```
>You can obtain and modify the configuration of signal registration. Currently, only the **SIGINFO** options are supported. For details, see the description of the **sigtimedwait** API.
>Transmit a signal.
>a. Among the default signal-receiving behaviors, the process does not support **STOP**, **COTINUE**, and **COREDUMP** defined in the POSIX standard.
>a. Among the default signal-receiving behaviors, the process does not support **STOP**, **CONTINUE**, and **COREDUMP** defined in the POSIX standard.
>b. The **SIGSTOP**, **SIGKILL**, and **SIGCONT** signals cannot be shielded.
>c. If a process killed is not reclaimed by its parent process, the process becomes a zombie process.
>d. A process will not call back the signal received until the process is scheduled.
......
......@@ -45,8 +45,8 @@ The typical development process of adding a system call API is as follows:
#define __NR_pthread_set_detach (__NR_OHOS_BEGIN + 0)
#define __NR_pthread_join (__NR_OHOS_BEGIN + 1)
#define __NR_pthread_deatch (__NR_OHOS_BEGIN + 2)
#define __NR_creat_user_thread (__NR_OHOS_BEGIN + 3)
#define __NR_processcreat (__NR_OHOS_BEGIN + 4)
#define __NR_create_user_thread (__NR_OHOS_BEGIN + 3)
#define __NR_processcreate (__NR_OHOS_BEGIN + 4)
#define __NR_processtart (__NR_OHOS_BEGIN + 5)
#define __NR_printf (__NR_OHOS_BEGIN + 6)
#define __NR_dumpmemory (__NR_OHOS_BEGIN + 13)
......@@ -91,8 +91,8 @@ The typical development process of adding a system call API is as follows:
#define __NR_pthread_set_detach (__NR_OHOS_BEGIN + 0)
#define __NR_pthread_join (__NR_OHOS_BEGIN + 1)
#define __NR_pthread_deatch (__NR_OHOS_BEGIN + 2)
#define __NR_creat_user_thread (__NR_OHOS_BEGIN + 3)
#define __NR_processcreat (__NR_OHOS_BEGIN + 4)
#define __NR_create_user_thread (__NR_OHOS_BEGIN + 3)
#define __NR_processcreate (__NR_OHOS_BEGIN + 4)
#define __NR_processtart (__NR_OHOS_BEGIN + 5)
#define __NR_printf (__NR_OHOS_BEGIN + 6)
#define __NR_dumpmemory (__NR_OHOS_BEGIN + 13)
......
......@@ -30,7 +30,7 @@ sem \[_ID__ / fulldata_\]
</tr>
<tr id="row458mcpsimp"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.2.4.1.1 "><p id="p460mcpsimp"><a name="p460mcpsimp"></a><a name="p460mcpsimp"></a>fulldata</p>
</td>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p462mcpsimp"><a name="p462mcpsimp"></a><a name="p462mcpsimp"></a>Queries information about all the semaphores in use. The information includes <strong id="b189454249533849"><a name="b189454249533849"></a><a name="b189454249533849"></a>SemID</strong>, <strong id="b162724654333849"><a name="b162724654333849"></a><a name="b162724654333849"></a>Count</strong>, <strong id="b111325307233849"><a name="b111325307233849"></a><a name="b111325307233849"></a>OriginalCount</strong>, <strong id="b182850346833849"><a name="b182850346833849"></a><a name="b182850346833849"></a>Creater(TaskEntry)</strong>, and <strong id="b213750533633849"><a name="b213750533633849"></a><a name="b213750533633849"></a>LastAccessTime</strong>.</p>
<td class="cellrowborder" valign="top" width="52%" headers="mcps1.2.4.1.2 "><p id="p462mcpsimp"><a name="p462mcpsimp"></a><a name="p462mcpsimp"></a>Queries information about all the semaphores in use. The information includes <strong id="b189454249533849"><a name="b189454249533849"></a><a name="b189454249533849"></a>SemID</strong>, <strong id="b162724654333849"><a name="b162724654333849"></a><a name="b162724654333849"></a>Count</strong>, <strong id="b111325307233849"><a name="b111325307233849"></a><a name="b111325307233849"></a>OriginalCount</strong>, <strong id="b182850346833849"><a name="b182850346833849"></a><a name="b182850346833849"></a>Creator(TaskEntry)</strong>, and <strong id="b213750533633849"><a name="b213750533633849"></a><a name="b213750533633849"></a>LastAccessTime</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="27%" headers="mcps1.2.4.1.3 "><p id="entry464mcpsimpp0"><a name="entry464mcpsimpp0"></a><a name="entry464mcpsimpp0"></a>N/A</p>
</td>
......@@ -103,7 +103,7 @@ OHOS # sem
</tbody>
</table>
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>![](../public_sys-resources/icon-note.gif) **NOTE**
>The **ID** value can be in decimal or hexadecimal format.
>When **ID** is a value within \[0, 1023\], semaphore information of the specified ID is displayed. If the specified semaphore is not used, a message is displayed to inform you of this case. For other values, a message is displayed indicating that the parameter is incorrect.
......@@ -112,7 +112,7 @@ Example 2: detailed semaphore information
```
OHOS # sem fulldata
Used Semaphore List:
SemID Count OriginalCount Creater(TaskEntry) LastAccessTime
SemID Count OriginalCount Creator(TaskEntry) LastAccessTime
------ ------ ------------- ------------------ --------------
0xb 0x0 0x0 0x404978fc 0xa1
0xc 0x0 0x0 0x404978fc 0xa1
......@@ -165,7 +165,7 @@ Used Semaphore List:
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p282916401148"><a name="p282916401148"></a><a name="p282916401148"></a>Original count of the semaphore</p>
</td>
</tr>
<tr id="row148347401646"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1782914401646"><a name="p1782914401646"></a><a name="p1782914401646"></a>Creater</p>
<tr id="row148347401646"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1782914401646"><a name="p1782914401646"></a><a name="p1782914401646"></a>Creator</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p168298407419"><a name="p168298407419"></a><a name="p168298407419"></a>Address of the entry function of the thread used to create the semaphore</p>
</td>
......
......@@ -82,7 +82,8 @@ The following steps show how to configure and modify the toolchains for cross-co
**OHOS\_SYSROOT\_PATH** specifies the absolute path where **sysroot** is located. For OpenHarmony, set **OHOS\_SYSROOT\_PATH** to the absolute path of the **out/hispark\__xxx_/ipcamera\_hispark\__xxx_/sysroot** directory. This directory is generated after full compilation is complete. Therefore, complete full compilation before porting.
3. View the result.
After step 2 is complete, a static library file and test cases are generated in the **build** directory.
After step 2 is complete, a static library file and test cases are generated in the **build** directory.
**Table 2** Directory structure of compiled files
......@@ -109,7 +110,7 @@ The following steps show how to configure and modify the toolchains for cross-co
The following screen is displayed after a successful login to the OS.
**Figure 1** Successful startup of OpenHarmony<a name="fig13279524162418"></a>
**Figure 1** Successful startup of OpenHarmony
![](figures/successful-startup-of-openharmony.png "successful-startup-of-openharmony")
2. Mount the **nfs** directory and put the executable file **cctest** into the **test** directory \(listed in [Table 2](#table1452412391911)\) to the **nfs** directory.
......@@ -213,9 +214,9 @@ The following steps show how to configure and modify the toolchains for cross-co
#CMAKE_FLAG: config compile feature
CMAKE_FLAG = "-DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=11"
#toolchain: follow up-layer, depend on $ohos_build_compiler
#toolchain: follow up-layer,depend on $ohos_build_compiler
if (ohos_build_compiler == "clang") {
CMAKE_TOOLCHAIN_FLAG = "- DOHOS_SYSROOT_PATH=${root_out_dir}sysroot/"
CMAKE_TOOLCHAIN_FLAG = "-DOHOS_SYSROOT_PATH=${root_out_dir}sysroot"
} else {
CMAKE_TOOLCHAIN_FLAG = ""
}
......@@ -284,7 +285,7 @@ The following steps show how to configure and modify the toolchains for cross-co
Execute the following command:
```
hb build -T //third_party/double-conversion:double-conversion
hb build -T //third_party/double-conversion:double-conversion
```
If the compilation is successful, a static library file and test cases will be generated in the [build](#li15717101715249) directory.
......
......@@ -49,6 +49,7 @@
- [Introduction to the Hi3861 Development Board](quickstart-lite-introduction-hi3861.md)
- [Introduction to the Hi3516 Development Board](quickstart-lite-introduction-hi3516.md)
- [Reference](quickstart-lite-reference.md)
- [Burning Code by Using HiTool](quickstart-lite-hitool.md)
- [Overall Description of Compilation Form Factors](quickstart-build.md)
- Getting Started with Standard System (IDE Mode, Recommended)
- [Standard System Overview](quickstart-ide-standard-overview.md)
......@@ -94,4 +95,5 @@
- [Introduction to the Hi3516 Development Board](quickstart-standard-board-introduction-hi3516.md)
- [Introduction to the RK3568 Development Board](quickstart-standard-board-introduction-rk3568.md)
- [Reference](quickstart-standard-reference.md)
- [Burning Code by Using HiTool](quickstart-standard-hitool.md)
- [Overall Description of Compilation Form Factors](quickstart-build.md)
# Building
1. In **Projects**, click **Settings**. The Hi3516D V300 configuration page is displayed.
1. Click **Project Settings** on the menu bar to access the Hi3516D V300 project configuration page.
![en-us_image_0000001265492885](figures/en-us_image_0000001265492885.png)
2. On the **toolchain** tab page, DevEco Device Tool automatically checks whether the dependent compilation toolchain is complete. If a message is displayed indicating that some tools are missing, click **SetUp** to automatically install the required tools.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the pip component fails to be installed, [change the Python](https://device.harmonyos.com/en/docs/documentation/guide/ide-set-python-source-0000001227639986) source and try again.
2. On the **Tool Chain** tab page, DevEco Device Tool automatically checks whether the dependent compilation toolchain is complete. If a message is displayed indicating that some tools are missing, click **Install** to automatically install the required tools.
![en-us_image_0000001265652869](figures/en-us_image_0000001265652869.png)
3. Install the toolchain related to Hi3516D V300. Certain tools may require the root access to install. In this case, enter the user password in the **TERMINAL** window.
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> If the pip component fails to be installed, [change the Python source](https://device.harmonyos.com/en/docs/documentation/guide/ide-set-python-source-0000001227639986) and try again.
![en-us_image_0000001220852753](figures/en-us_image_0000001220852753.png)
After the toolchain is automatically installed, the figure below is displayed.
![en-us_image_0000001220852754](figures/en-us_image_0000001220852754.png)
3. On the **hi3516dv300** tab page, set **build_type**. The default value is **debug**. Click **Save** to save the settings.
4. On the **hi3516dv300** tab page, set **build_type**. The default value is **debug**. Click **Save** to save the settings.
![en-us_image_0000001221172710](figures/en-us_image_0000001221172710.png)
![en-us_image_0000001221172711](figures/en-us_image_0000001221172711.png)
4. Choose **PROJECT TASKS** > **hi3516dv300** > **Build** to start building.
5. Choose **PROJECT TASKS** > **hi3516dv300** > **Build** to start building.
![en-us_image_0000001265772913](figures/en-us_image_0000001265772913.png)
5. Wait until **SUCCESS** is displayed in the **TERMINAL** window, indicating that the compilation is complete.
6. Wait until **SUCCESS** is displayed in the **TERMINAL** window, indicating that the compilation is complete.
![en-us_image_0000001221012766](figures/en-us_image_0000001221012766.png)
After the building is complete, go to the out directory of the project to view the generated files, which are needed in [burning](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3516-upload-0000001052148681).
After the building is complete, go to the **out** directory of the project to view the generated files, which are needed in [burning](quickstart-ide-lite-steps-hi3516-burn.md).
# Burning Code by Using HiTool
To burn code to the Hi3516D V300 development board, you can use HiTool in addition to DevEco Device Tool.
## Prerequisites
- The source code of the development board has been compiled into files for burning.
- [HiTool](http://www.hihope.org/download/download.aspx) has been installed on the client platform (for example, a Windows-based computer).
- The USB driver has been installed on the client platform. For details, see [Installing the USB Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393).
- A serial port terminal tool, such as IPOP, has been installed on the client platform.
- The client platform and development board are connected using a USB cable and serial cable.
## Procedure
1. Prepare the files to be burnt.
1. On the client platform, create a folder for storing the files to be burnt, for example, **D:\liteos** or **D:\linux**.
2. Save the burning configuration file and boot file to the new folder.
- For the small system using the LiteOS kernel, the burning configuration file is **L1_3516_liteos.xml**, and the boot file is [u-boot-hi3516dv300.bin](https://gitee.com/openharmony/device_board_hisilicon/tree/master/hispark_taurus/uboot/out/boot).
You need to prepare the **L1_3516_liteos.xml** file on your own by applying the template below:
```
<?xml version="1.0" encoding="GB2312" ?>
<Partition_Info ProgrammerFile="">
<Part Sel="1" PartitionName="fastboot" FlashType="emmc" FileSystem="none" Start="0" Length="1M" SelectFile="D:\liteos\u-boot-hi3516dv300.bin"/>
<Part Sel="1" PartitionName="" FlashType="emmc" FileSystem="none" Start="1M" Length="9M" SelectFile="D:\liteos\OHOS_Image.bin"/>
<Part Sel="1" PartitionName="" FlashType="emmc" FileSystem="none" Start="10M" Length="50M" SelectFile="D:\liteos\rootfs_vfat.img"/>
<Part Sel="1" PartitionName="" FlashType="emmc" FileSystem="none" Start="60M" Length="50M" SelectFile="D:\liteos\userfs_vfat.img"/>
</Partition_Info>
```
- For the small system using the Linux kernel, the burning configuration file is **L1_3516_linux.xml**, and the boot file is [u-boot-hi3516dv300.bin](https://gitee.com/openharmony/device_board_hisilicon/tree/master/hispark_taurus/uboot/out/boot).
You need to prepare the **L1_3516_linux.xml** file on your own by applying the template below:
```
<?xml version="1.0" encoding="GB2312" ?>
<Partition_Info ProgrammerFile="">
<Part Sel="1" PartitionName="fastboot" FlashType="emmc" FileSystem="none" Start="0" Length="1M" SelectFile="D:\linux\u-boot-hi3516dv300.bin"/>
<Part Sel="1" PartitionName="ohos_image" FlashType="emmc" FileSystem="none" Start="1M" Length="9M" SelectFile="D:\linux\uImage_hi3516dv300_smp"/>
<Part Sel="1" PartitionName="rootfs" FlashType="emmc" FileSystem="ext3/4" Start="10M" Length="50M" SelectFile="D:\linux\rootfs_ext4.img"/>
<Part Sel="1" PartitionName="userfs" FlashType="emmc" FileSystem="ext3/4" Start="60M" Length="50M" SelectFile="D:\linux\userfs_ext4.img"/>
<Part Sel="1" PartitionName="userdata" FlashType="emmc" FileSystem="ext3/4" Start="110M" Length="1024M" SelectFile="D:\linux\userdata_ext4.img"/>
</Partition_Info>
```
3. Download the compiled source package to the client platform, decompress the package, and copy the files required for burning to the folder created in step 1.
For the Hi3516 development board, the files required for burning of the small system are as follows:
- LiteOS: **OHOS_Image.bin**, **rootfs_vfat.img**, and **userfs_vfat.img**
- Linux: **uImage_hi3516dv300_smp**, **rootfs_ext4.img**, **userfs_ext4.img**, and **userdata_ext4.img**
2. Burn the image files using HiTool.
1. Open HiTool.
2. Set up HiTool.
Set the transfer mode to USB and burning mode to eMMC (the storage medium of the development board is eMMC).
3. Click **Browse** and select the burning configuration file (for example, **L1_3516_linux.xml**) from the folder created in step 1.
4. After clicking the **Burn** button, press and hold the **Update** key next to the serial port on the development board, and remove and insert the USB cable.
After the burning starts, logs are displayed in the console area at the bottom of HiTool.
When the burning is complete, HiTool displays a dialog box indicating that the burning is successful.
5. Click **OK**.
3. Import startup parameters.
1. Use the terminal tool to enable the serial port.
2. Restart the development board by removing and inserting its power supply. Press **Enter** in the serial port terminal tool within 3 seconds.
If **hisilicon \#** is displayed on the terminal tool page, the serial port of the development board is connected.
3. Copy the following startup parameters in the serial port terminal tool and press **Enter** to complete the setup.
- The startup parameters for the small system using the LiteOS kernel are as follows:
```
setenv bootcmd "mmc read 0x0 0x80000000 0x800 0x4800;go 0x80000000";
setenv bootargs "console=ttyAMA0,115200n8 root=emmc fstype=vfat rootaddr=10M rootsize=50M rw";
saveenv
reset
```
- The startup parameters for the small system using the Linux kernel are as follows:
```
setenv bootargs "mem=128M console=ttyAMA0,115200 root=/dev/mmcblk0p3 rw rootfstype=ext4 rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),50M(rootfs),50M(userfs),1024M(userdata)"
setenv bootcmd "mmc read 0x0 0x82000000 0x800 0x4800; mw 0x10FF0044 0x0600;mw 0x120D2010 0x00000000;mw 0x120D2400 0x000000ff;mw 0x120D2010 0x00000000; bootm 0x82000000"
saveenv;
reset
```
此差异已折叠。
......@@ -631,12 +631,12 @@ The following uses the RTL8720 development board provided by Realtek as an examp
# Board arch, e.g. "armv7-a", "rv32imac".
board_arch = ""
# Toolchain name used for system compiling.
# Toolchain name used for system build.
# E.g. gcc-arm-none-eabi, arm-linux-harmonyeabi-gcc, ohos-clang, riscv32-unknown-elf.
# Note: The default toolchain is "ohos-clang". It's not mandatory if you use the default toochain.
board_toolchain = "gcc-arm-none-eabi"
# The toolchain path installed, it's not mandatory if you have added toolchain path to your ~/.bashrc.
# Toolchain installation path, which can be left blank if the installation path is added to ~/.bashrc.
board_toolchain_path =
rebase_path("//prebuilts/gcc/linux-x86/arm/gcc-arm-none-eabi/bin",
root_build_dir)
......
......@@ -777,7 +777,7 @@ After the build is complete, the test cases are automatically saved in **out/his
Run the following command to execute test cases:
```
run -t UT -ts CalculatorSubTest -tc interger_sub_00l
run -t UT -ts CalculatorSubTest -tc integer_sub_00l
```
In the command:
```
......@@ -819,7 +819,7 @@ To enable test cases to be executed on a remote Linux server or a Linux VM, map
The test framework locates the test cases based on the command, and automatically builds and executes the test cases.
```
run -t UT -ts CalculatorSubTest -tc interger_sub_00l
run -t UT -ts CalculatorSubTest -tc integer_sub_00l
```
In the command:
```
......
此差异已折叠。
......@@ -4,6 +4,7 @@
- [OpenHarmony v3.1.1 Release (2022-05-31)](OpenHarmony-v3.1.1-release.md)
- [OpenHarmony v3.1 Release (2022-03-30)](OpenHarmony-v3.1-release.md)
- [OpenHarmony v3.1 Beta (2021-12-31)](OpenHarmony-v3.1-beta.md)
- [OpenHarmony v3.0.5 LTS (2022-07-01)](OpenHarmony-v3.0.5-LTS.md)
- [OpenHarmony v3.0.3 LTS (2022-04-08)](OpenHarmony-v3.0.3-LTS.md)
- [OpenHarmony v3.0.2 LTS (2022-03-18)](OpenHarmony-v3.0.2-LTS.md)
- [OpenHarmony v3.0.1 LTS (2022-01-12)](OpenHarmony-v3.0.1-LTS.md)
......
# JS API Changes of the Utils Subsystem
The table below lists the APIs changes of the Utils subsystem in OpenHarmony 3.2 Beta2 over OpenHarmony 3.2 Beta1.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.util | util | promisify(original: (err: Object, value: Object) => void): Function; | Added|
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册