提交 5f5dffa9 编写于 作者: D donglin

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

Signed-off-by: Ndonglin <donglin9@huawei.com>
Change-Id: I5dd709a9333c23b93a2e58579be121c6e3faa3e2
......@@ -17,7 +17,7 @@ The application recovery APIs are provided by the **appRecovery** module, which
| API | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| enableAppRecovery(restart?: RestartFlag, saveOccasion?: SaveOccasionFlag, saveMode?: SaveModeFlag) : void; | Enables the application recovery function. |
| enableAppRecovery(restart?: RestartFlag, saveOccasion?: SaveOccasionFlag, saveMode?: SaveModeFlag) : void; | Enables the application recovery function. |
| saveAppState(): boolean; | Saves the ability status of an application. |
| restartApp(): void; | Restarts the current process. If there is saved ability status, it will be passed to the **want** parameter's **wantParam** attribute of the **onCreate** lifecycle callback of the ability.|
......
......@@ -6,7 +6,7 @@ Applicable to: OpenHarmony SDK 3.2.5.5
1. Locate the crash-related code based on the service log.
2. View the error information in the crash file. The crash file is located at **/data/log/faultlog/faultlogger/**.
2. View the error information in the crash file, which is located at **/data/log/faultlog/faultlogger/**.
## Why cannot access controls in the UiTest test framework?
......
......@@ -51,9 +51,9 @@ build() {
Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9
1. Obtain data in Uint8Array format by calling the **RawFile** API of **resourceManager**.
1. Obtain Uint8Array data by calling the **RawFile** API of **resourceManager**.
2. Convert data in Uint8Array format to the string type by calling the **String.fromCharCode** API.
2. Convert the Uint8Array data to strings by calling the **String.fromCharCode** API.
Reference: [Resource Manager](../reference/apis/js-apis-resource-manager.md)
......
......@@ -19,112 +19,121 @@ const color = new ArrayBuffer(96); // Create a buffer to store image pixel data.
let opts = { alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: { height: 2, width: 3 } } // Image pixel data.
// Create a PixelMap object.
const color = new ArrayBuffer(96);
let opts = { alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: { height: 2, width: 3 } }
image.createPixelMap(color, opts, (err, pixelmap) => {
console.log('Succeeded in creating pixelmap.');
})
// Read pixels.
const area = {
pixels: new ArrayBuffer(8),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }
}
pixelmap.readPixels(area,() => {
var bufferArr = new Uint8Array(area.pixels);
var res = true;
for (var i = 0; i < bufferArr.length; i++) {
console.info(' buffer ' + bufferArr[i]);
if(res) {
if(bufferArr[i] == 0) {
res = false;
console.log('readPixels end.');
break;
}
}
// Failed to create the PixelMap object.
if (err) {
console.info('create pixelmap failed, err' + err);
return
}
})
// Store pixels.
const readBuffer = new ArrayBuffer(96);
pixelmap.readPixelsToBuffer(readBuffer,() => {
var bufferArr = new Uint8Array(readBuffer);
var res = true;
for (var i = 0; i < bufferArr.length; i++) {
if(res) {
if (bufferArr[i] !== 0) {
res = false;
console.log('readPixelsToBuffer end.');
break;
}
}
// Read pixels.
const area = {
pixels: new ArrayBuffer(8),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }
}
})
// Write pixels.
pixelmap.writePixels(area,() => {
const readArea = { pixels: new ArrayBuffer(20), offset: 0, stride: 8, region: { size: { height: 1, width: 2 }, x: 0, y: 0 }}
pixelmap.readPixels(readArea,() => {
var readArr = new Uint8Array(readArea.pixels);
var res = true;
for (var i = 0; i < readArr.length; i++) {
pixelmap.readPixels(area,() => {
let bufferArr = new Uint8Array(area.pixels);
let res = true;
for (let i = 0; i < bufferArr.length; i++) {
console.info(' buffer ' + bufferArr[i]);
if(res) {
if (readArr[i] !== 0) {
if(bufferArr[i] == 0) {
res = false;
console.log('readPixels end.please check buffer');
console.log('readPixels end.');
break;
}
}
}
})
})
// Write pixels to the buffer.
pixelmap.writeBufferToPixels(writeColor).then(() => {
// Store pixels.
const readBuffer = new ArrayBuffer(96);
pixelmap.readPixelsToBuffer(readBuffer).then (() => {
var bufferArr = new Uint8Array(readBuffer);
var res = true;
for (var i = 0; i < bufferArr.length; i++) {
pixelmap.readPixelsToBuffer(readBuffer,() => {
let bufferArr = new Uint8Array(readBuffer);
let res = true;
for (let i = 0; i < bufferArr.length; i++) {
if(res) {
if (bufferArr[i] !== i) {
if (bufferArr[i] !== 0) {
res = false;
console.log('readPixels end.please check buffer');
console.log('readPixelsToBuffer end.');
break;
}
}
}
})
})
// Write pixels.
pixelmap.writePixels(area,() => {
const readArea = { pixels: new ArrayBuffer(20), offset: 0, stride: 8, region: { size: { height: 1, width: 2 }, x: 0, y: 0 }}
pixelmap.readPixels(readArea,() => {
let readArr = new Uint8Array(readArea.pixels);
let res = true;
for (let i = 0; i < readArr.length; i++) {
if(res) {
if (readArr[i] !== 0) {
res = false;
console.log('readPixels end.please check buffer');
break;
}
}
}
})
})
// Obtain image information.
pixelmap.getImageInfo((error, imageInfo) => {
if (imageInfo !== null) {
console.log('Succeeded in getting imageInfo');
}
})
const writeColor = new ArrayBuffer(96); // Pixel data of the image.
// Write pixels to the buffer.
pixelmap.writeBufferToPixels(writeColor).then(() => {
const readBuffer = new ArrayBuffer(96);
pixelmap.readPixelsToBuffer(readBuffer).then (() => {
let bufferArr = new Uint8Array(readBuffer);
let res = true;
for (let i = 0; i < bufferArr.length; i++) {
if(res) {
if (bufferArr[i] !== i) {
res = false;
console.log('readPixels end.please check buffer');
break;
}
}
}
})
})
// Release the PixelMap object.
pixelmap.release(()=>{
console.log('Succeeded in releasing pixelmap');
// Obtain image information.
pixelmap.getImageInfo((err, imageInfo) => {
// Failed to obtain the image information.
if (err || imageInfo == null) {
console.info('getImageInfo failed, err' + err);
return
}
if (imageInfo !== null) {
console.log('Succeeded in getting imageInfo');
}
})
// Release the PixelMap object.
pixelmap.release(()=>{
console.log('Succeeded in releasing pixelmap');
})
})
// Create an image source (uri).
let path = '/data/local/tmp/test.jpg';
const imageSourceApi = image.createImageSource(path);
const imageSourceApi1 = image.createImageSource(path);
// Create an image source (fd).
let fd = 29;
const imageSourceApi = image.createImageSource(fd);
const imageSourceApi2 = image.createImageSource(fd);
// Create an image source (data).
const data = new ArrayBuffer(96);
const imageSourceApi = image.createImageSource(data);
const imageSourceApi3 = image.createImageSource(data);
// Release the image source.
imageSourceApi.release(() => {
imageSourceApi3.release(() => {
console.log('Succeeded in releasing imagesource');
})
......@@ -133,6 +142,10 @@ const imagePackerApi = image.createImagePacker();
const imageSourceApi = image.createImageSource(0);
let packOpts = { format:"image/jpeg", quality:98 };
imagePackerApi.packing(imageSourceApi, packOpts, (err, data) => {
if (err) {
console.info('packing from imagePackerApi failed, err' + err);
return
}
console.log('Succeeded in packing');
})
......@@ -161,36 +174,33 @@ let decodingOptions = {
// Create a pixel map in callback mode.
imageSourceApi.createPixelMap(decodingOptions, (err, pixelmap) => {
// Failed to create the PixelMap object.
if (err) {
console.info('create pixelmap failed, err' + err);
return
}
console.log('Succeeded in creating pixelmap.');
})
// Create a pixel map in promise mode.
imageSourceApi.createPixelMap().then(pixelmap => {
console.log('Succeeded in creating pixelmap.');
})
// Capture error information when an exception occurs during function invoking.
catch(error => {
console.log('Failed in creating pixelmap.' + error);
})
// Obtain the number of bytes in each line of pixels.
var num = pixelmap.getBytesNumberPerRow();
// Obtain the number of bytes in each line of pixels.
let num = pixelmap.getBytesNumberPerRow();
// Obtain the total number of pixel bytes.
var pixelSize = pixelmap.getPixelBytesNumber();
// Obtain the total number of pixel bytes.
let pixelSize = pixelmap.getPixelBytesNumber();
// Obtain the pixel map information.
pixelmap.getImageInfo().then( imageInfo => {});
// Obtain the pixel map information.
pixelmap.getImageInfo().then( imageInfo => {});
// Release the PixelMap object.
pixelmap.release(()=>{
console.log('Succeeded in releasing pixelmap');
})
// Capture release failure information.
catch(error => {
console.log('Failed in releasing pixelmap.' + error);
// Release the PixelMap object.
pixelmap.release(()=>{
console.log('Succeeded in releasing pixelmap');
})
}).catch(error => {
console.log('Failed in creating pixelmap.' + error);
})
```
......@@ -216,7 +226,7 @@ if (imagePackerApi == null) {
}
// Set encoding parameters if the image packer is successfully created.
let packOpts = { format:["image/jpeg"], // The supported encoding format is jpg.
let packOpts = { format:"image/jpeg", // The supported encoding format is jpg.
quality:98 } // Image quality, which ranges from 0 to 100.
// Encode the image.
......@@ -233,8 +243,9 @@ imageSourceApi.getImageInfo((err, imageInfo) => {
console.log('Succeeded in getting imageInfo');
})
const array = new ArrayBuffer(100); // Incremental data.
// Update incremental data.
imageSourceIncrementalSApi.updateData(array, false, 0, 10,(error, data)=> {})
imageSourceApi.updateData(array, false, 0, 10,(error, data)=> {})
```
......@@ -246,10 +257,15 @@ Example scenario: The camera functions as the client to transmit image data to t
public async init(surfaceId: any) {
// (Server code) Create an ImageReceiver object.
var receiver = image.createImageReceiver(8 * 1024, 8, image.ImageFormat.JPEG, 1);
let receiver = image.createImageReceiver(8 * 1024, 8, image.ImageFormat.JPEG, 1);
// Obtain the surface ID.
receiver.getReceivingSurfaceId((err, surfaceId) => {
// Failed to obtain the surface ID.
if (err) {
console.info('getReceivingSurfaceId failed, err' + err);
return
}
console.info("receiver getReceivingSurfaceId success");
});
// Register a surface listener, which is triggered after the buffer of the surface is ready.
......
......@@ -15,7 +15,7 @@ In ArkTS, you define a custom component by using decorators **@Component** and *
}
```
- **build** function: a function that complies with the **Builder** API definition and is used to define the declarative UI description of components. A **build** function must be defined for custom components, and custom constructors are prohibited for custom components.
- **build** function: A custom component must implement the **build** function and must implement no constructor. The **build** function meets the definition of the **Builder** API and is used to define the declarative UI description of components.
```ts
interface Builder {
......@@ -49,9 +49,9 @@ Column() {
}
```
### Structs with Mandatory Parameters
### Structs with Parameters
A struct with mandatory parameters is a component whose API definition expects parameters enclosed in the parentheses. You can use constants to assign values to the parameters.
A struct with parameters is a component whose API definition expects parameters enclosed in the parentheses. You can use constants to assign values to the parameters.
Sample code:
......@@ -61,7 +61,7 @@ Sample code:
Image('https://xyz/test.jpg')
```
- Set the mandatory parameter **content** of the **\<Text>** component as follows:
- Set the optional parameter **content** of the **\<Text>** component as follows:
```ts
Text('test')
......@@ -83,35 +83,35 @@ Component attributes are configured using an attribute method, which follows the
```ts
Text('test')
.fontSize(12)
.fontSize(12)
```
- Example of configuring multiple attributes at the same time by using the "**.**" operator to implement chain call:
```ts
Image('test.jpg')
.alt('error.jpg')
.width(100)
.height(100)
.alt('error.jpg')
.width(100)
.height(100)
```
- Example of passing variables or expressions in addition to constants:
```ts
Text('hello')
.fontSize(this.size)
.fontSize(this.size)
Image('test.jpg')
.width(this.count % 2 === 0 ? 100 : 200)
.height(this.offset + 100)
.width(this.count % 2 === 0 ? 100 : 200)
.height(this.offset + 100)
```
- For attributes of built-in components, ArkUI also provides some predefined [enumeration types](../reference/arkui-ts/ts-appendix-enums.md), which you can pass as parameters to methods if they meet the parameter type requirements. For example, you can configure the font color and weight attributes of the **\<Text>** component as follows:
```ts
Text('hello')
.fontSize(20)
.fontColor(Color.Red)
.fontWeight(FontWeight.Bold)
.fontSize(20)
.fontColor(Color.Red)
.fontWeight(FontWeight.Bold)
```
### Event Configuration
......@@ -123,7 +123,7 @@ Events supported by components are configured using event methods, which each fo
```ts
Button('add counter')
.onClick(() => {
this.counter += 2
this.counter += 2;
})
```
......@@ -132,7 +132,7 @@ Events supported by components are configured using event methods, which each fo
```ts
Button('add counter')
.onClick(function () {
this.counter += 2
this.counter += 2;
}.bind(this))
```
......@@ -140,13 +140,13 @@ Events supported by components are configured using event methods, which each fo
```ts
myClickHandler(): void {
this.counter += 2
this.counter += 2;
}
...
Button('add counter')
.onClick(this.myClickHandler)
.onClick(this.myClickHandler.bind(this))
```
### Child Component Configuration
......@@ -158,11 +158,11 @@ For a component that supports child components, for example, a container compone
```ts
Column() {
Text('Hello')
.fontSize(100)
.fontSize(100)
Divider()
Text(this.myText)
.fontSize(100)
.fontColor(Color.Red)
.fontSize(100)
.fontColor(Color.Red)
}
```
......@@ -176,10 +176,10 @@ For a component that supports child components, for example, a container compone
.height(100)
Button('click +1')
.onClick(() => {
console.info('+1 clicked!')
console.info('+1 clicked!');
})
}
Divider()
Row() {
Image('test2.jpg')
......@@ -187,10 +187,10 @@ For a component that supports child components, for example, a container compone
.height(100)
Button('click +2')
.onClick(() => {
console.info('+2 clicked!')
console.info('+2 clicked!');
})
}
Divider()
Row() {
Image('test3.jpg')
......@@ -198,7 +198,7 @@ For a component that supports child components, for example, a container compone
.height(100)
Button('click +3')
.onClick(() => {
console.info('+3 clicked!')
console.info('+3 clicked!');
})
}
}
......
......@@ -230,27 +230,27 @@ When referencing resources in the **rawfile** subdirectory, use the **"$rawfile(
>
> The return value of **$r** is a **Resource** object. You can obtain the corresponding string by using the [getStringValue](../reference/apis/js-apis-resource-manager.md) API.
In the **.ets** file, you can use the resources defined in the **resources** directory.
In the **.ets** file, you can use the resources defined in the **resources** directory. The following is a resource usage example based on the resource file examples in [Resource Group Sub-directories](#resource-group-subdirectories):
```ts
Text($r('app.string.string_hello'))
.fontColor($r('app.color.color_hello'))
.fontSize($r('app.float.font_hello'))
}
.fontColor($r('app.color.color_hello'))
.fontSize($r('app.float.font_hello'))
Text($r('app.string.string_world'))
.fontColor($r('app.color.color_world'))
.fontSize($r('app.float.font_world'))
}
Text($r('app.string.message_arrive', "five of the clock")) // Reference string resources. The second parameter of $r is used to replace %s.
.fontColor($r('app.color.color_hello'))
.fontSize($r('app.float.font_hello'))
}
Text($r('app.plural.eat_apple', 5, 5)) // Reference plural resources. The first parameter indicates the plural resource, the second parameter indicates the number of plural resources, and the third parameter indicates the substitute of %d.
.fontColor($r('app.color.color_world'))
.fontSize($r('app.float.font_world'))
.fontColor($r('app.color.color_world'))
.fontSize($r('app.float.font_world'))
// Reference string resources. The second parameter of $r is used to replace %s, and value is "We will arrive at five'o clock".
Text($r('app.string.message_arrive', "five'o clock"))
.fontColor($r('app.color.color_hello'))
.fontSize($r('app.float.font_hello'))
// Reference plural resources. The first parameter indicates the plural resource, the second parameter indicates the number of plural resources, and the third parameter indicates the substitute of %d.
// The value is "5 apple" in singular form and "5 apples" in plural form.
Text($r('app.plural.eat_apple', 5, 5))
.fontColor($r('app.color.color_world'))
.fontSize($r('app.float.font_world'))
}
Image($r('app.media.my_background_image')) // Reference media resources.
......@@ -274,14 +274,20 @@ To reference a system resource, use the **"$r('sys.type.resource_id')"** format.
```ts
Text('Hello')
.fontColor($r('sys.color.ohos_id_color_emphasize'))
.fontSize($r('sys.float.ohos_id_text_size_headline1'))
.fontFamily($r('sys.string.ohos_id_text_font_family_medium'))
.backgroundColor($r('sys.color.ohos_id_color_palette_aux1'))
.fontColor($r('sys.color.ohos_id_color_emphasize'))
.fontSize($r('sys.float.ohos_id_text_size_headline1'))
.fontFamily($r('sys.string.ohos_id_text_font_family_medium'))
.backgroundColor($r('sys.color.ohos_id_color_palette_aux1'))
Image($r('sys.media.ohos_app_icon'))
.border({color: $r('sys.color.ohos_id_color_palette_aux1'), radius: $r('sys.float.ohos_id_corner_radius_button'), width: 2})
.margin({top: $r('sys.float.ohos_id_elements_margin_horizontal_m'), bottom: $r('sys.float.ohos_id_elements_margin_horizontal_l')})
.height(200)
.width(300)
.border({
color: $r('sys.color.ohos_id_color_palette_aux1'),
radius: $r('sys.float.ohos_id_corner_radius_button'), width: 2
})
.margin({
top: $r('sys.float.ohos_id_elements_margin_horizontal_m'),
bottom: $r('sys.float.ohos_id_elements_margin_horizontal_l')
})
.height(200)
.width(300)
```
......@@ -55,7 +55,7 @@ Initiates a call based on the specified options. This API uses an asynchronous c
| Name | Type | Mandatory | Description |
| ----------- | ---------------------------- | ---- | --------------------------------------- |
| phoneNumber | string | Yes | Phone number. |
| options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call. |
| options | [DialOptions](#dialoptions) | No | Call option, which indicates whether the call is a voice call or video call. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure |
**Example**
......@@ -313,7 +313,7 @@ Checks whether the called number is an emergency number based on the specified p
| Name | Type | Mandatory | Description |
| ----------- | -------------------------------------------------- | ---- | -------------------------------------------- |
| phoneNumber | string | Yes | Phone number. |
| options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number options. |
| options | [EmergencyNumberOptions](#emergencynumberoptions7) | No | Phone number options. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br> - **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number. |
**Example**
......@@ -397,7 +397,7 @@ A formatted phone number is a standard numeric string, for example, 555 0100.
| Name | Type | Mandatory | Description |
| ----------- | -------------------------------------------- | ---- | ------------------------------------ |
| phoneNumber | string | Yes | Phone number. |
| options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting options, for example, country code. |
| options | [NumberFormatOptions](#numberformatoptions7) | No | Number formatting options, for example, country code. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. |
**Example**
......@@ -566,33 +566,6 @@ promise.then(data => {
});
```
## call.answer<sup>7+</sup>
answer\(callback: AsyncCallback<void\>\): void
Answers a call. This API uses an asynchronous callback to return the result.
This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
**System capability**: SystemCapability.Telephony.CallManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example**
```js
call.answer((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## call.answer<sup>7+</sup>
answer\(callId: number, callback: AsyncCallback<void\>\): void
......@@ -658,7 +631,7 @@ promise.then(data => {
## call.hangup<sup>7+</sup>
hangup\(callback: AsyncCallback<void\>\): void
hangup\(callId: number, callback: AsyncCallback<void\>\): void
Ends a call. This API uses an asynchronous callback to return the result.
......@@ -672,22 +645,23 @@ This is a system API.
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- |
| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example**
```js
call.hangup((err, data) => {
call.hangup(1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## call.hangup<sup>7+</sup>
## call.answer<sup>9+</sup>
hangup\(callId: number, callback: AsyncCallback<void\>\): void
answer\(callback: AsyncCallback<void\>\): void
Ends a call based on the specified call ID. This API uses an asynchronous callback to return the result.
Answers a call.This API uses an asynchronous callback to return the result.
This is a system API.
......@@ -699,13 +673,12 @@ This is a system API.
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ----------------------------------------------- |
| callId | number | Yes | Call ID. You can obtain the value by subscribing to **callDetailsChange** events.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
```js
call.hangup(1, (err, data) => {
call.answer((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
......@@ -746,11 +719,11 @@ promise.then(data => {
});
```
## call.reject<sup>7+</sup>
## call.hangup<sup>9+</sup>
reject\(callback: AsyncCallback<void\>\): void
hangup\(callback: AsyncCallback<void\>\): void
Rejects a call. This API uses an asynchronous callback to return the result.
Ends a call. This API uses an asynchronous callback to return the result.
This is a system API.
......@@ -767,38 +740,7 @@ This is a system API.
**Example**
```js
call.reject((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## call.reject<sup>7+</sup>
reject\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): void
Rejects a call based on the specified options. This API uses an asynchronous callback to return the result.
This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
**System capability**: SystemCapability.Telephony.CallManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------- | ---- | -------------- |
| options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
```js
let rejectMessageOptions={
messageContent: "Unknown number blocked"
}
call.reject(rejectMessageOptions, (err, data) => {
call.hangup((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
......@@ -903,6 +845,65 @@ promise.then(data => {
});
```
## call.reject<sup>9+</sup>
reject\(callback: AsyncCallback<void\>\): void
Rejects a call. This API uses an asynchronous callback to return the result.
This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
**System capability**: SystemCapability.Telephony.CallManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example:**
```js
call.reject((err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## call.reject<sup>9+</sup>
reject\(options: RejectMessageOptions, callback: AsyncCallback<void\>\): void
Rejects a call. This API uses an asynchronous callback to return the result.
This is a system API.
**Required permission**: ohos.permission.ANSWER_CALL
**System capability**: SystemCapability.Telephony.CallManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------- | ---- | -------------- |
| options | [RejectMessageOptions](#rejectmessageoptions7) | Yes | Options for the call rejection message.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example:**
```js
let rejectMessageOptions={
messageContent: "Unknown number blocked"
}
call.reject(rejectMessageOptions, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## call.holdCall<sup>7+</sup>
holdCall\(callId: number, callback: AsyncCallback<void\>\): void
......@@ -1344,8 +1345,8 @@ This is a system API.
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback&lt;[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.<br><br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.|
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback&lt;[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.<br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.|
**Example**
......@@ -2399,7 +2400,7 @@ promise.then(data => {
});
```
## call.setAudioDevice<sup>8+</sup>
## call.setAudioDevice<sup>9+</sup>
setAudioDevice\(device: AudioDevice, callback: AsyncCallback<void\>\): void
......@@ -2425,7 +2426,7 @@ call.setAudioDevice(1, (err, data) => {
```
## call.setAudioDevice<sup>8+</sup>
## call.setAudioDevice<sup>9+</sup>
setAudioDevice\(device: AudioDevice, options: AudioDeviceOptions, callback: AsyncCallback<void\>\): void
......
# Internationalization – I18N
This module provides system-related or enhanced I18N capabilities, such as locale management, phone number formatting, and calendar, through supplementary I18N APIs that are not defined in ECMA 402.
The I18N module provides system-related or enhanced I18N capabilities, such as locale management, phone number formatting, and calendar, through supplementary I18N APIs that are not defined in ECMA 402.
The [Intl](js-apis-intl.md) module provides basic I18N capabilities through the standard I18N APIs defined in ECMA 402. It works with the I18N module to provide a complete suite of I18N capabilities.
> **NOTE**
> - 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.
>
> - This module provides system-related or enhanced I18N capabilities, such as locale management, phone number formatting, and calendar, through supplementary I18N APIs that are not defined in ECMA 402. For details about the basic I18N capabilities, see [Intl](js-apis-intl.md).
> 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.
## Modules to Import
......@@ -247,9 +244,9 @@ This is a system API.
**Parameters**
| Name | Type | Description |
| -------- | ------ | ----- |
| language | string | Language ID.|
| Name | Type | Mandatory | Description |
| -------- | ------ | ----- | ----- |
| language | string | Yes | Language ID.|
**Error codes**
......@@ -313,9 +310,9 @@ This is a system API.
**Parameters**
| Name | Type | Description |
| ------ | ------ | ----- |
| region | string | Region ID.|
| Name | Type | Mandatory | Description |
| -------- | ------ | ----- | ----- |
| region | string | Yes | Region ID.|
**Error codes**
......@@ -379,9 +376,9 @@ This is a system API.
**Parameters**
| Name | Type | Description |
| ------ | ------ | --------------- |
| locale | string | System locale ID, for example, **zh-CN**.|
| Name | Type | Mandatory | Description |
| -------- | ------ | ----- | ----- |
| locale | string | Yes | System locale ID, for example, **zh-CN**.|
**Error codes**
......@@ -713,9 +710,9 @@ Checks whether the localized script for the specified language is displayed from
**Parameters**
| Name | Type | Description |
| ------ | ------ | ------- |
| locale | string | Locale ID.|
| Name | Type | Mandatory | Description |
| -------- | ------ | ----- | ----- |
| locale | string | Yes | Locale ID.|
**Return value**
......@@ -905,7 +902,7 @@ Sets the start day of a week for this **Calendar** object.
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | --------------------- |
| value | number | No | Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.|
| value | number | Yes | Start day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday.|
**Example**
```js
......@@ -947,7 +944,7 @@ Sets the minimum number of days in the first week of a year.
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ------------ |
| value | number | No | Minimum number of days in the first week of a year.|
| value | number | Yes | Minimum number of days in the first week of a year.|
**Example**
```js
......
# Input Method Subtype
# @ohos.inputmethodsubtype
The **inputMethodEngine** module provides APIs for managing the attributes of input method subtypes. Different attribute settings result in different subtypes.
The **inputMethodSubtype** module provides APIs for managing the attributes of input method subtypes. Different attribute settings result in different subtypes.
> **NOTE**
>
......
# Internationalization – Intl
This module provides basic I18N capabilities, such as time and date formatting, number formatting, and string sorting, through the standard I18N APIs defined in ECMA 402.
The Intl module provides basic I18N capabilities, such as time and date formatting, number formatting, and string sorting, through the standard I18N APIs defined in ECMA 402.
The [I18N](js-apis-i18n.md) module provides enhanced I18N capabilities through supplementary APIs that are not defined in ECMA 402. It works with the Intl module to provide a complete suite of I18N capabilities.
......
......@@ -2,7 +2,8 @@
The Keycode module provides keycodes for a key device.
> **NOTE**<br>
> **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.
## Modules to Import
......@@ -337,7 +338,7 @@ import {KeyCode} from '@ohos.multimodalInput.keyCode';
| KEYCODE_WWAN_WIMAX | number | Yes| No| WWAN WiMAX key|
| KEYCODE_RFKILL | number | Yes| No| RF Kill key|
| KEYCODE_CHANNEL | number | Yes| No| Channel key|
| KEYCODE_BTN_0 | number | Yes| No| Key 0|
| KEYCODE_BTN_0 | number | Yes| No| Button 0|
| KEYCODE_BTN_1 | number | Yes| No| Button 1|
| KEYCODE_BTN_2 | number | Yes| No| Button 2|
| KEYCODE_BTN_3 | number | Yes| No| Button 3|
......
......@@ -332,7 +332,6 @@ connection.getDefaultNet().then(function (netHandle) {
});
```
## connection.reportNetConnected
reportNetConnected(netHandle: NetHandle): Promise&lt;void&gt;
......@@ -490,7 +489,6 @@ connection.getAddressesByName(host).then(function (addresses) {
})
```
## connection.enableAirplaneMode
enableAirplaneMode(callback: AsyncCallback\<void>): void
......@@ -539,7 +537,6 @@ connection.enableAirplaneMode().then(function (error) {
})
```
## connection.disableAirplaneMode
disableAirplaneMode(callback: AsyncCallback\<void>): void
......@@ -588,7 +585,6 @@ connection.disableAirplaneMode().then(function (error) {
})
```
## connection.createNetConnection
createNetConnection(netSpecifier?: NetSpecifier, timeout?: number): NetConnection
......@@ -825,7 +821,7 @@ Before invoking NetHandle APIs, call **getNetHandle** to obtain a **NetHandle**
| Name| Type | Description |
| ------ | ------ | ------------------------- |
| netId | number | Network ID. The value must be greater than or equal to 100.|
| netId | number | Network ID. The value **0** indicates no default network. Any other value must be greater than or equal to 100.|
### bindSocket
......@@ -847,33 +843,50 @@ Binds a **TCPSocket** or **UDPSocket** object to the data network. This API uses
**Example**
```js
connection.getDefaultNet().then(function (netHandle) {
import socket from "@ohos.net.socket";
connection.getDefaultNet().then((netHandle)=>{
var tcp = socket.constructTCPSocketInstance();
var udp = socket.constructUDPSocketInstance();
let socketType = "xxxx";
let socketType = "TCPSocket";
if (socketType == "TCPSocket") {
tcp.bind({
address: "xxxx", port: xxxx, family: xxxx
address: '192.168.xx.xxx', port: xxxx, family: 1
}, err => {
netHandle.bindSocket(tcp, function (error, data) {
console.log(JSON.stringify(error))
console.log(JSON.stringify(data))
if (err) {
console.log('bind fail');
}
netHandle.bindSocket(tcp, (error, data)=>{
if (error) {
console.log(JSON.stringify(error));
} else {
console.log(JSON.stringify(data));
}
})
})
} else {
let callback = value => {
console.log(TAG + "on message, message:" + value.message + ", remoteInfo:" + value.remoteInfo);
}
udp.on('message', callback);
udp.bind({
address: "xxxx", port: xxxx, family: xxxx
address: '192.168.xx.xxx', port: xxxx, family: 1
}, err => {
if (err) {
console.log('bind fail');
}
udp.on('message', (data) => {
console.log(JSON.stringify(data))
});
netHandle.bindSocket(udp, function (error, data) {
console.log(JSON.stringify(error))
console.log(JSON.stringify(data))
console.log(JSON.stringify(data))
});
netHandle.bindSocket(udp,(error, data)=>{
if (error) {
console.log(JSON.stringify(error));
} else {
console.log(JSON.stringify(data));
}
})
})
}
}
}
})
```
### bindSocket
......@@ -901,31 +914,50 @@ Binds a **TCPSocket** or **UDPSocket** object to the data network. This API uses
**Example**
```js
connection.getDefaultNet().then(function (netHandle) {
import socket from "@ohos.net.socket";
connection.getDefaultNet().then((netHandle)=>{
var tcp = socket.constructTCPSocketInstance();
var udp = socket.constructUDPSocketInstance();
let socketType = "xxxx";
if(socketType == "TCPSocket") {
let socketType = "TCPSocket";
if (socketType == "TCPSocket") {
tcp.bind({
address: "xxxx", port: xxxx, family: xxxx
address: '192.168.xx.xxx', port: xxxx, family: 1
}, err => {
netHandle.bindSocket(tcp).then(err, data) {
console.log(JSON.stringify(data))
if (err) {
console.log('bind fail');
}
netHandle.bindSocket(tcp).then((err, data) => {
if (err) {
console.log(JSON.stringify(err));
} else {
console.log(JSON.stringify(data));
}
})
})
} else {
let callback = value => {
console.log(TAG + "on message, message:" + value.message + ", remoteInfo:" + value.remoteInfo);
}
udp.on('message', callback);
udp.bind({
address: "xxxx", port: xxxx, family: xxxx
address: '192.168.xx.xxx', port: xxxx, family: 1
}, err => {
if (err) {
console.log('bind fail');
}
udp.on('message', (data) => {
console.log(JSON.stringify(data))
});
netHandle.bindSocket(tcp).then(err, data) {
console.log(JSON.stringify(data))
});
console.log(JSON.stringify(data));
})
netHandle.bindSocket(udp).then((err, data) => {
if (err) {
console.log(JSON.stringify(err));
} else {
console.log(JSON.stringify(data));
}
})
})
}
}
}
})
```
......
# Network Sharing Management
The Network Sharing Management module allows you to share your device's Internet connection with other connected devices by means of Wi-Fi hotspot, Bluetooth, and USB sharing. It also allows you to query the network sharing state and shared mobile data volume.
The Network Sharing Management module allows you to share your device's Internet connection with other connected devices by means of Wi-Fi hotspot, and Bluetooth sharing. It also allows you to query the network sharing state and shared mobile data volume.
> **NOTE**
>
......@@ -405,7 +405,7 @@ Obtains the names of NICs in the specified network sharing state. This API uses
**Example**
```js
import SharingIfaceState from '@ohos.net.sharing'
import SharingIfaceType from '@ohos.net.sharing'
sharing.getSharingIfaces(SharingIfaceState.SHARING_NIC_CAN_SERVER, (error, data) => {
console.log(JSON.stringify(error));
console.log(JSON.stringify(data));
......@@ -498,7 +498,7 @@ Obtains the network sharing state of the specified type. This API uses a promise
```js
import SharingIfaceType from '@ohos.net.sharing'
sharing.getSharingIfaces(SharingIfaceType.SHARING_WIFI).then(data => {
sharing.getSharingState(SharingIfaceType.SHARING_WIFI).then(data => {
console.log(JSON.stringify(data));
}).catch(error => {
console.log(JSON.stringify(error));
......@@ -525,8 +525,8 @@ Obtains regular expressions of NICs of a specified type. This API uses an asynch
**Example**
```js
import SharingIfaceState from '@ohos.net.sharing'
sharing.getSharingState(SharingIfaceType.SHARING_WIFI, (error, data) => {
import SharingIfaceType from '@ohos.net.sharing'
sharing.getSharableRegexes(SharingIfaceType.SHARING_WIFI, (error, data) => {
console.log(JSON.stringify(error));
console.log(JSON.stringify(data));
});
......@@ -565,7 +565,7 @@ sharing.getSharableRegexes(SharingIfaceType.SHARING_WIFI).then(data => {
});
```
## on('sharingStateChange')
## sharing.on('sharingStateChange')
on(type: 'sharingStateChange', callback: Callback\<boolean>): void
......@@ -591,7 +591,7 @@ sharing.on('sharingStateChange', (error, data) => {
});
```
## off('sharingStateChange')
## sharing.off('sharingStateChange')
off(type: 'sharingStateChange', callback?: Callback\<boolean>): void
......@@ -617,7 +617,7 @@ sharing.off('sharingStateChange', (error, data) => {
});
```
## on('interfaceSharingStateChange')
## sharing.on('interfaceSharingStateChange')
on(type: 'interfaceSharingStateChange', callback: Callback\<{ type: SharingIfaceType, iface: string, state: SharingIfaceState }>): void
......@@ -643,7 +643,7 @@ sharing.on('interfaceSharingStateChange', (error, data) => {
});
```
## off('interfaceSharingStateChange')
## sharing.off('interfaceSharingStateChange')
off(type: 'interfaceSharingStateChange', callback?: Callback\<{ type: SharingIfaceType, iface: string, state: SharingIfaceState }>): void
......@@ -669,7 +669,7 @@ sharing.off('interfaceSharingStateChange', (error, data) => {
});
```
## on('sharingUpstreamChange')
## sharing.on('sharingUpstreamChange')
on(type: 'sharingUpstreamChange', callback: Callback\<NetHandle>): void
......@@ -695,7 +695,7 @@ sharing.on('sharingUpstreamChange', (error, data) => {
});
```
## off('sharingUpstreamChange')
## sharing.off('sharingUpstreamChange')
off(type: 'sharingUpstreamChange', callback?: Callback\<NetHandle>): void
......@@ -735,12 +735,12 @@ Enumerates the network sharing states of an NIC.
## SharingIfaceType
Enumerates the network sharing types of an NIC.
Enumerates the network sharing types of an NIC.
**System capability**: SystemCapability.Communication.NetManager.Core
| Name | Value | Description |
| ------------------------ | ---- | ---------------------- |
| SHARING_WIFI | 0 | Wi-Fi hotspot sharing.|
| SHARING_USB | 1 | USB sharing.|
| SHARING_USB | 1 | USB sharing (not supported currently).|
| SHARING_BLUETOOTH | 2 | Bluetooth sharing.|
......@@ -531,8 +531,8 @@ Enumerates SIM card types and states.
**System capability**: SystemCapability.Telephony.StateRegistry
| Name | Type | Description |
| ----------------- | --------------------- | ------------------------------------------------------------ |
| type | [CardType](js-apis-sim.md#cardtype) | SIM card type. For details, see [CardType](js-apis-sim.md#cardtype).|
| state | [SimState](js-apis-sim.md#simstate) | SIM card status. For details, see [SimState](js-apis-sim.md#simstate).|
| reason<sup>8+</sup> | [LockReason](#lockreason8) | SIM card lock type.|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| type | [CardType](js-apis-sim.md#cardtype) | Yes| SIM card type. For details, see [CardType](js-apis-sim.md#cardtype).|
| state | [SimState](js-apis-sim.md#simstate) | Yes| SIM card status. For details, see [SimState](js-apis-sim.md#simstate).|
| reason<sup>8+</sup> | [LockReason](#lockreason8) | Yes| SIM card lock type.|
......@@ -142,7 +142,7 @@ Sets the mouse movement speed. This API uses an asynchronous callback to return
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ------------------------------------- |
| speed | number | Yes | Mouse movement speed. The value ranges from **1** to **11**. The default value is **5**. |
| callback | AysncCallback&lt;void&gt; | Yes | Callback used to return the result.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example**
......@@ -349,7 +349,7 @@ Sets the mouse pointer style. This API uses an asynchronous callback to return t
| ------------ | ------------------------------ | ---- | ----------------------------------- |
| windowId | number | Yes | Window ID. |
| pointerStyle | [PointerStyle](#pointerstyle9) | Yes | Mouse pointer style ID. |
| callback | AysncCallback&lt;void&gt; | Yes | Callback used to return the result.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example**
......
......@@ -1734,8 +1734,8 @@ Enables listening for **imsRegStateChange** events for the SIM card in the speci
**Example**
```js
radio.on('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
radio.on('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, data => {
console.log(`callback: data->${JSON.stringify(data)}`);
});
```
......@@ -1763,8 +1763,8 @@ Disables listening for **imsRegStateChange** events for the SIM card in the spec
**Example**
```js
radio.off('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
radio.off('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, data => {
console.log(`callback: data->${JSON.stringify(data)}`);
});
```
......@@ -1797,10 +1797,10 @@ Defines the signal strength.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ----------- | --------------------------- | ------------------ |
| signalType | [NetworkType](#networktype) | Signal strength type.|
| signalLevel | number | Signal strength level.|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| signalType | [NetworkType](#networktype) | Yes| Signal strength type.|
| signalLevel | number | Yes| Signal strength level.|
## NetworkType
......@@ -1825,17 +1825,17 @@ Defines the network status.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ----------------- | --------------------- | ------------------------------------------------------------ |
| longOperatorName | string | Long carrier name of the registered network.|
| shortOperatorName | string | Short carrier name of the registered network.|
| plmnNumeric | string | PLMN code of the registered network.|
| isRoaming | boolean | Whether the user is roaming.|
| regState | [RegState](#regstate) | Network registration status of the device.|
| cfgTech<sup>8+</sup> | [RadioTechnology](#radiotechnology) | RAT of the device.|
| nsaState | [NsaState](#nsastate) | NSA network registration status of the device.|
| isCaActive | boolean | CA status.|
| isEmergency | boolean | Whether only emergency calls are allowed.|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| longOperatorName | string | Yes | Long carrier name of the registered network.|
| shortOperatorName | string | Yes | Short carrier name of the registered network.|
| plmnNumeric | string | Yes | PLMN code of the registered network.|
| isRoaming | boolean | Yes | Whether the user is roaming.|
| regState | [RegState](#regstate) | Yes | Network registration status of the device.|
| cfgTech<sup>8+</sup> | [RadioTechnology](#radiotechnology) | Yes | RAT of the device.|
| nsaState | [NsaState](#nsastate) | Yes | NSA network registration status of the device.|
| isCaActive | boolean | Yes | CA status.|
| isEmergency | boolean | Yes | Whether only emergency calls are allowed.|
## RegState
......@@ -1933,13 +1933,13 @@ Defines the cell information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| networkType | [NetworkType](#networktype) | Network type of the cell. |
| isCamped | boolean | Status of the cell. |
| timeStamp | number | Timestamp when cell information is obtained. |
| signalInformation | [SignalInformation](#signalinformation) | Signal information. |
| data | [CdmaCellInformation](#cdmacellinformation8) \| [GsmCellInformation](#gsmcellinformation8) \| [LteCellInformation](#ltecellinformation8) \| [NrCellInformation](#nrcellinformation8) \| [TdscdmaCellInformation](#tdscdmacellinformation8) | CDMA cell information \|GSM cell information \|LTE cell information \|NR cell information \|TD-SCDMA cell information|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| networkType | [NetworkType](#networktype) | Yes | Network type of the cell. |
| isCamped | boolean | Yes | Status of the cell. |
| timeStamp | number | Yes | Timestamp when cell information is obtained. |
| signalInformation | [SignalInformation](#signalinformation) | Yes | Signal information. |
| data | [CdmaCellInformation](#cdmacellinformation8) \| [GsmCellInformation](#gsmcellinformation8) \| [LteCellInformation](#ltecellinformation8) \| [NrCellInformation](#nrcellinformation8) \| [TdscdmaCellInformation](#tdscdmacellinformation8) | Yes | CDMA cell information \|GSM cell information \|LTE cell information \|NR cell information \|TD-SCDMA cell information|
## CdmaCellInformation<sup>8+</sup>
......@@ -1949,13 +1949,13 @@ Defines the CDMA cell information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| --------- | ------ | ------------ |
| baseId | number | Base station ID. |
| latitude | number | Longitude. |
| longitude | number | Latitude. |
| nid | number | Network ID.|
| sid | number | System ID.|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| baseId | number | Yes | Base station ID. |
| latitude | number | Yes | Longitude. |
| longitude | number | Yes | Latitude. |
| nid | number | Yes | Network ID.|
| sid | number | Yes | System ID.|
## GsmCellInformation<sup>8+</sup>
......@@ -1965,14 +1965,14 @@ Defines the GSM cell information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ------ | ------ | -------------------- |
| lac | number | Location area code. |
| cellId | number | Cell ID. |
| arfcn | number | Absolute radio frequency channel number.|
| bsic | number | Base station ID. |
| mcc | string | Mobile country code. |
| mnc | string | Mobile network code. |
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| lac | number | Yes | Location area code. |
| cellId | number | Yes | Cell ID. |
| arfcn | number | Yes | Absolute radio frequency channel number.|
| bsic | number | Yes | Base station ID. |
| mcc | string | Yes | Mobile country code. |
| mnc | string | Yes | Mobile network code. |
## LteCellInformation<sup>8+</sup>
......@@ -1982,16 +1982,16 @@ Defines the LTE cell information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ------------- | ------- | ----------------------- |
| cgi | number | Cell global identification. |
| pci | number | Physical cell ID. |
| tac | number | Tracking area code. |
| earfcn | number | Absolute radio frequency channel number. |
| bandwidth | number | Bandwidth. |
| mcc | string | Mobile country code. |
| mnc | string | Mobile network code. |
| isSupportEndc | boolean | Support New Radio_Dual Connectivity|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| cgi | number | Yes | Cell global identification. |
| pci | number | Yes | Physical cell ID. |
| tac | number | Yes | Tracking area code. |
| earfcn | number | Yes | Absolute radio frequency channel number. |
| bandwidth | number | Yes | Bandwidth. |
| mcc | string | Yes | Mobile country code. |
| mnc | string | Yes | Mobile network code. |
| isSupportEndc | boolean | Yes | Support for New Radio_Dual Connectivity. |
## NrCellInformation<sup>8+</sup>
......@@ -2001,14 +2001,14 @@ Defines the NR cell information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ------- | ------ | ---------------- |
| nrArfcn | number | 5G frequency number. |
| pci | number | Physical cell ID. |
| tac | number | Tracking area code. |
| nci | number | 5G network cell ID.|
| mcc | string | Mobile country code. |
| mnc | string | Mobile network code. |
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| nrArfcn | number | Yes | 5G frequency number. |
| pci | number | Yes | Physical cell ID. |
| tac | number | Yes | Tracking area code. |
| nci | number | Yes | 5G network cell ID.|
| mcc | string | Yes | Mobile country code. |
| mnc | string | Yes | Mobile network code. |
## TdscdmaCellInformation<sup>8+</sup>
......@@ -2018,14 +2018,14 @@ Defines the TD-SCDMA cell information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ------ | ------ | ------------ |
| lac | number | Location area code.|
| cellId | number | Cell ID. |
| cpid | number | Cell parameter ID.|
| uarfcn | number | Absolute radio frequency number.|
| mcc | string | Mobile country code.|
| mnc | string | Mobile network code. |
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| lac | number | Yes | Location area code.|
| cellId | number | Yes | Cell ID. |
| cpid | number | Yes | Cell parameter ID.|
| uarfcn | number | Yes | Absolute radio frequency number.|
| mcc | string | Yes | Mobile country code.|
| mnc | string | Yes | Mobile network code. |
## WcdmaCellInformation<sup>8+</sup>
......@@ -2035,14 +2035,14 @@ Defines the WCDMA cell information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ------ | ------ | ------------ |
| lac | number | Location area code.|
| cellId | number | Cell ID. |
| psc | number | Primary scrambling code. |
| uarfcn | number | Absolute radio frequency number.|
| mcc | string | Mobile country code.|
| mnc | string | Mobile network code. |
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| lac | number | Yes | Location area code.|
| cellId | number | Yes | Cell ID. |
| psc | number | Yes | Primary scrambling code. |
| uarfcn | number | Yes | Absolute radio frequency number.|
| mcc | string | Yes | Mobile country code.|
| mnc | string | Yes | Mobile network code. |
## NrOptionMode<sup>8+</sup>
......@@ -2067,10 +2067,10 @@ Defines the network search result.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ---------------------- | ------------------------------------------------- | -------------- |
| isNetworkSearchSuccess | boolean | Successful network search.|
| networkSearchResult | Array<[NetworkInformation](#networkinformation)\> | Network search result.|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| isNetworkSearchSuccess | boolean | Yes | Successful network search.|
| networkSearchResult | Array<[NetworkInformation](#networkinformation)\> | Yes | Network search result.|
## NetworkInformation
......@@ -2080,12 +2080,12 @@ Defines the network information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| --------------- | ----------------------------------------- | -------------- |
| operatorName | string | Carrier name.|
| operatorNumeric | string | Carrier number. |
| state | [NetworkInformation](#networkinformationstate) | Network information status.|
| radioTech | string | Radio technology. |
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| operatorName | string | Yes | Carrier name.|
| operatorNumeric | string | Yes | Carrier number. |
| state | [NetworkInformation](#networkinformationstate) | Yes | Network information status.|
| radioTech | string | Yes | Radio technology. |
## NetworkInformationState
......@@ -2110,12 +2110,12 @@ Defines the network selection mode.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ------------------ | --------------------------------------------- | -------------------------------------- |
| slotId | number | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| selectMode | [NetworkSelectionMode](#networkselectionmode) | Network selection mode. |
| networkInformation | [NetworkInformation](#networkinformation) | Network information. |
| resumeSelection | boolean | Whether to resume selection. |
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| selectMode | [NetworkSelectionMode](#networkselectionmode) | Yes | Network selection mode. |
| networkInformation | [NetworkInformation](#networkinformation) | Yes | Network information. |
| resumeSelection | boolean | Yes | Whether to resume selection. |
## ImsRegState<sup>9+</sup>
......@@ -2153,10 +2153,10 @@ Defines the IMS registration information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ----------- | ---------------------------- | ------------- |
| imsRegState | [ImsRegState](#imsregstate9) | IMS registration state.|
| imsRegTech | [ImsRegTech](#imsregtech9) | IMS registration technology.|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| imsRegState | [ImsRegState](#imsregstate9) | Yes | IMS registration state.|
| imsRegTech | [ImsRegTech](#imsregtech9) | Yes | IMS registration technology.|
## ImsServiceType<sup>9+</sup>
......
......@@ -2847,10 +2847,10 @@ Defines the lock status response.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| --------------- | ------ | ------------------ |
| result | number | Operation result. |
| remain?: number | number | Remaining attempts (can be null).|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| result | number | Yes | Operation result. |
| remain?: number | number | Yes | Remaining attempts (can be null).|
## LockInfo<sup>8+</sup>
......@@ -2860,11 +2860,11 @@ Defines the lock information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| -------- | ------------------------ | ------ |
| lockType | [LockType](#locktype8) | Lock type.|
| password | string | Password. |
| state | [LockState](#lockstate8) | Lock state.|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| lockType | [LockType](#locktype8) | Yes | Lock type.|
| password | string | Yes | Password. |
| state | [LockState](#lockstate8) | Yes | Lock state.|
## PersoLockInfo<sup>8+</sup>
......@@ -2874,10 +2874,10 @@ Defines the personalized lock information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| -------- | -------------------------------- | ------------ |
| lockType | [PersoLockType](#persolocktype8) | Personalized lock type.|
| password | string | Password. |
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| lockType | [PersoLockType](#persolocktype8) | Yes | Personalized lock type.|
| password | string | Yes | Password. |
## IccAccountInfo<sup>7+</sup>
......@@ -2887,15 +2887,15 @@ Defines the ICC account information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ---------- | ------- | ---------------- |
| simId | number | SIM card ID. |
| slotIndex | number | Card slot ID. |
| isEsim | boolean | Whether the SIM card is an eSim card.|
| isActive | boolean | Whether the card is activated. |
| iccId | string | ICCID number. |
| showName | string | SIM card display name. |
| showNumber | string | SIM card display number. |
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| simId | number | Yes | SIM card ID. |
| slotIndex | number | Yes | Card slot ID. |
| isEsim | boolean | Yes | Whether the SIM card is an eSim card.|
| isActive | boolean | Yes | Whether the card is activated. |
| iccId | string | Yes | ICCID number. |
| showName | string | Yes | SIM card display name. |
| showNumber | string | Yes | SIM card display number. |
## OperatorConfig<sup>8+</sup>
......@@ -2905,10 +2905,10 @@ Defines the carrier configuration.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description|
| ----- | ------ | ---- |
| field | string | Field|
| value | string | Value |
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| field | string | Yes | Field. |
| value | string | Yes | Value. |
## DiallingNumbersInfo<sup>8+</sup>
......@@ -2918,12 +2918,12 @@ Defines the contact number information.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ------------ | ------ | -------- |
| alphaTag | string | Alpha tag. |
| number | string | Contact number. |
| recordNumber | number | Record number.|
| pin2 | string | PIN 2.|
| Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- |
| alphaTag | string | Yes | Alpha tag. |
| number | string | Yes | Contact number. |
| recordNumber | number | Yes | Record number.|
| pin2 | string | Yes | PIN 2.|
## ContactType<sup>8+</sup>
......
......@@ -70,7 +70,7 @@ import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput
| toolHeight | number | Yes| No| Height of the tool area.|
| rawX | number | Yes| No| X coordinate of the input device.|
| rawY | number | Yes| No| Y coordinate of the input device.|
| toolType | number | Yes| No| Tool type.|
| toolType | ToolType | Yes| No| Tool type.|
## TouchEvent
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册