提交 ba1a731a 编写于 作者: D donglin

merge

Signed-off-by: Ndonglin <donglin9@huawei.com>
Change-Id: Ib0363b5f11dcfd4c083e1b6892fd233757154d8d
......@@ -32,7 +32,7 @@ Registers the continuation management service and obtains a token. This API does
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -73,7 +73,7 @@ Registers the continuation management service and obtains a token. This API uses
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -123,7 +123,7 @@ Registers the continuation management service and obtains a token. This API uses
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -167,7 +167,7 @@ Registers the continuation management service and obtains a token. This API does
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -212,7 +212,7 @@ Registers the continuation management service and obtains a token. This API uses
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -265,7 +265,7 @@ Registers the continuation management service and obtains a token. This API uses
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -314,7 +314,7 @@ Subscribes to device connection events. This API uses an asynchronous callback t
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -353,7 +353,7 @@ Subscribes to device disconnection events. This API uses an asynchronous callbac
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -390,7 +390,7 @@ Unsubscribes from device connection events. This API uses an asynchronous callba
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -429,7 +429,7 @@ Unsubscribes from device disconnection events. This API uses an asynchronous cal
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -467,7 +467,7 @@ Subscribes to device connection events. This API uses an asynchronous callback t
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -514,7 +514,7 @@ Subscribes to device disconnection events. This API uses an asynchronous callbac
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -561,7 +561,7 @@ Unsubscribes from device connection events.
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -600,7 +600,7 @@ Unsubscribes from device disconnection events.
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -639,7 +639,7 @@ Starts the device selection module to show the list of available devices on the
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -683,7 +683,7 @@ Starts the device selection module to show the list of available devices on the
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -735,7 +735,7 @@ Starts the device selection module to show the list of available devices on the
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -781,7 +781,7 @@ Starts the device selection module to show the list of available devices on the
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -826,7 +826,7 @@ Starts the device selection module to show the list of available devices on the
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -879,7 +879,7 @@ Starts the device selection module to show the list of available devices on the
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -928,7 +928,7 @@ Instructs the device selection module to update the device connection state. Thi
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -979,7 +979,7 @@ Instructs the device selection module to update the device connection state. Thi
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -1025,7 +1025,7 @@ Instructs the device selection module to update the device connection state. Thi
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -1077,7 +1077,7 @@ Instructs the device selection module to update the device connection state. Thi
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -1123,7 +1123,7 @@ Deregisters the continuation management service. This API uses an asynchronous c
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -1168,7 +1168,7 @@ Deregisters the continuation management service. This API uses a promise to retu
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -1208,7 +1208,7 @@ Deregisters the continuation management service. This API uses an asynchronous c
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......@@ -1257,7 +1257,7 @@ Deregisters the continuation management service. This API uses a promise to retu
**Error codes**
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errcode-DistributedSchedule.md).
For details about the error codes, see [Distributed Scheduler Error Codes](../errorcodes/errorcode-DistributedSchedule.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
......
......@@ -102,7 +102,7 @@ Starts screen hopping. This API uses an asynchronous callback to return the resu
**Error codes**
For details about the error codes, see [Screen Hopping Error Codes](../errorcodes/errorcodes-multimodalinput.md).
For details about the error codes, see [Screen Hopping Error Codes](../errorcodes/errorcode-multimodalinput.md).
| ID| Error Message|
| -------- | ---------------------------------------- |
......@@ -150,7 +150,7 @@ Starts screen hopping. This API uses a promise to return the result.
**Error codes**
For details about the error codes, see [Screen Hopping Error Codes](../errorcodes/errorcodes-multimodalinput.md).
For details about the error codes, see [Screen Hopping Error Codes](../errorcodes/errorcode-multimodalinput.md).
| ID| Error Message|
| -------- | ---------------------------------------- |
......
......@@ -713,9 +713,11 @@ for (var value of searchParams.values()) {
### [Symbol.iterator]<sup>(deprecated)</sup>
> **NOTE**
>
> This API is deprecated since API version 9. You are advised to use [URLParams<sup>9+</sup>.[Symbol.iterator]<sup>9+</sup>](#symbol.iterator9) instead.
> This API is deprecated since API version 9. You are advised to use [[Symbol.iterator]<sup>9+</sup>](#symboliterator9) instead.
[Symbol.iterator]\(): IterableIterator&lt;[string, string]&gt;
......
......@@ -661,7 +661,7 @@ let rationalNumber = new util.RationalNumber();
rationalNumber.parseRationalNumber(1,2)
```
### constructor<sup>8+(deprecated)</sup>
### constructor<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -846,7 +846,7 @@ let rationalNumber = new util.RationalNumber(1,2);
let result = util.RationalNumber.getCommonFactor(4,6);
```
### getCommonDivisor<sup>8+(deprecated)</sup>
### getCommonDivisor<sup>(deprecated)</sup>
> **NOTE**
>
> This API is deprecated since API version 9. You are advised to use [getCommonFactor9+](#getcommonfactor9) instead.
......@@ -1541,7 +1541,7 @@ pro.put(2,10);
let result = pro[Symbol.iterator]();
```
## LruBuffer<sup>8+(deprecated)</sup>
## LruBuffer<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1563,7 +1563,7 @@ let result = pro[Symbol.iterator]();
let result = pro.length;
```
### constructor<sup>8+(deprecated)</sup>
### constructor<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1586,7 +1586,7 @@ A constructor used to create a **LruBuffer** instance. The default capacity of t
let lrubuffer= new util.LruBuffer();
```
### updateCapacity<sup>8+(deprecated)</sup>
### updateCapacity<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1610,7 +1610,7 @@ Changes the **LruBuffer** capacity. If the new capacity is less than or equal to
let result = pro.updateCapacity(100);
```
### toString<sup>8+(deprecated)</sup>
### toString<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1637,7 +1637,7 @@ Obtains the string representation of this **LruBuffer** object.
let result = pro.toString();
```
### getCapacity<sup>8+(deprecated)</sup>
### getCapacity<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1661,7 +1661,7 @@ Obtains the capacity of this buffer.
let result = pro.getCapacity();
```
### clear<sup>8+(deprecated)</sup>
### clear<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1681,7 +1681,7 @@ Clears key-value pairs from this buffer. The **afterRemoval()** method will be c
pro.clear();
```
### getCreateCount<sup>8+(deprecated)</sup>
### getCreateCount<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1706,7 +1706,7 @@ Obtains the number of return values for **createDefault()**.
let result = pro.getCreateCount();
```
### getMissCount<sup>8+(deprecated)</sup>
### getMissCount<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1732,7 +1732,7 @@ Obtains the number of times that the queried values are mismatched.
let result = pro.getMissCount();
```
### getRemovalCount<sup>8+(deprecated)</sup>
### getRemovalCount<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1759,7 +1759,7 @@ Obtains the number of removals from this buffer.
let result = pro.getRemovalCount();
```
### getMatchCount<sup>8+(deprecated)</sup>
### getMatchCount<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1785,7 +1785,7 @@ Obtains the number of times that the queried values are matched.
let result = pro.getMatchCount();
```
### getPutCount<sup>8+(deprecated)</sup>
### getPutCount<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1810,7 +1810,7 @@ Obtains the number of additions to this buffer.
let result = pro.getPutCount();
```
### isEmpty<sup>8+(deprecated)</sup>
### isEmpty<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1835,7 +1835,7 @@ Checks whether this buffer is empty.
let result = pro.isEmpty();
```
### get<sup>8+(deprecated)</sup>
### get<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1866,7 +1866,7 @@ Obtains the value of the specified key.
let result = pro.get(2);
```
### put<sup>8+(deprecated)</sup>
### put<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1897,7 +1897,7 @@ Adds a key-value pair to this buffer.
let result = pro.put(2,10);
```
### values<sup>8+(deprecated)</sup>
### values<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1924,7 +1924,7 @@ Obtains all values in this buffer, listed from the most to the least recently ac
let result = pro.values();
```
### keys<sup>8+(deprecated)</sup>
### keys<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1949,7 +1949,7 @@ Obtains all keys in this buffer, listed from the most to the least recently acce
let result = pro.keys();
```
### remove<sup>8+(deprecated)</sup>
### remove<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -1980,7 +1980,7 @@ Removes the specified key and its value from this buffer.
let result = pro.remove(20);
```
### afterRemoval<sup>8+(deprecated)</sup>
### afterRemoval<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2022,7 +2022,7 @@ Performs subsequent operations after a value is removed.
lru.afterRemoval(false,10,30,null);
```
### contains<sup>8+(deprecated)</sup>
### contains<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2053,7 +2053,7 @@ Checks whether this buffer contains the specified key.
let result = pro.contains(20);
```
### createDefault<sup>8+(deprecated)</sup>
### createDefault<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2083,7 +2083,7 @@ Creates a value if the value of the specified key is not available.
let result = pro.createDefault(50);
```
### entries<sup>8+(deprecated)</sup>
### entries<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2108,11 +2108,11 @@ Obtains a new iterator object that contains all key-value pairs in this object.
let result = pro.entries();
```
### [Symbol.iterator]<sup>8+(deprecated)</sup>
### [Symbol.iterator]<sup>(deprecated)</sup>
> **NOTE**
>
> This API is deprecated since API version 9. You are advised to use [Symbol.iterator9+](#symboliterator9) instead.
> This API is deprecated since API version 9. You are advised to use [Symbol.iterator<sup>9+</sup>](#symboliterator9) instead.
[Symbol.iterator]\(): IterableIterator&lt;[K, V]&gt;
......@@ -2524,13 +2524,13 @@ let range = new util.ScopeHelper(tempLower, tempUpper);
let result = range.clamp(tempMiDF);
```
## Scope<sup>8+(deprecated)</sup>
## Scope<sup>(deprecated)</sup>
> **NOTE**
>
> This class is deprecated since API version 9. You are advised to use [ScopeHelper9+](#scopehelper9) instead.
### constructor<sup>8+(deprecated)</sup>
### constructor<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2556,7 +2556,7 @@ A constructor used to create a **Scope** object with the specified upper and low
let range = new util.Scope(tempLower, tempUpper);
```
### toString<sup>8+(deprecated)</sup>
### toString<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2582,7 +2582,7 @@ Obtains a string representation that contains this **Scope**.
let result = range.toString();
```
### intersect<sup>8+(deprecated)</sup>
### intersect<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2598,13 +2598,13 @@ Obtains the intersection of this **Scope** and the given **Scope**.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| range | [Scope](#scope8) | Yes| **Scope** specified.|
| range | [Scope](#scopedeprecated) | Yes| **Scope** specified.|
**Return value**
| Type| Description|
| -------- | -------- |
| [Scope](#scope8) | Intersection of this **Scope** and the given **Scope**.|
| [Scope](#scopedeprecated) | Intersection of this **Scope** and the given **Scope**.|
**Example**
......@@ -2618,7 +2618,7 @@ Obtains the intersection of this **Scope** and the given **Scope**.
range.intersect(rangeFir );
```
### intersect<sup>8+(deprecated)</sup>
### intersect<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2641,7 +2641,7 @@ Obtains the intersection of this **Scope** and the given lower and upper limits.
| Type| Description|
| -------- | -------- |
| [Scope](#scope8) | Intersection of this **Scope** and the given lower and upper limits.|
| [Scope](#scopedeprecated) | Intersection of this **Scope** and the given lower and upper limits.|
**Example**
```js
......@@ -2653,7 +2653,7 @@ Obtains the intersection of this **Scope** and the given lower and upper limits.
let result = range.intersect(tempMiDF, tempMidS);
```
### getUpper<sup>8+(deprecated)</sup>
### getUpper<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2679,7 +2679,7 @@ Obtains the upper limit of this **Scope**.
let result = range.getUpper();
```
### getLower<sup>8+(deprecated)</sup>
### getLower<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2705,7 +2705,7 @@ Obtains the lower limit of this **Scope**.
let result = range.getLower();
```
### expand<sup>8+(deprecated)</sup>
### expand<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2728,7 +2728,7 @@ Obtains the union set of this **Scope** and the given lower and upper limits.
| Type| Description|
| -------- | -------- |
| [Scope](#scope8) | Union set of this **Scope** and the given lower and upper limits.|
| [Scope](#scopedeprecated) | Union set of this **Scope** and the given lower and upper limits.|
**Example**
......@@ -2741,7 +2741,7 @@ Obtains the union set of this **Scope** and the given lower and upper limits.
let result = range.expand(tempMiDF, tempMidS);
```
### expand<sup>8+(deprecated)</sup>
### expand<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2757,13 +2757,13 @@ Obtains the union set of this **Scope** and the given **Scope**.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| range | [Scope](#scope8) | Yes| **Scope** specified.|
| range | [Scope](#scopedeprecated) | Yes| **Scope** specified.|
**Return value**
| Type| Description|
| -------- | -------- |
| [Scope](#scope8) | Union set of this **Scope** and the given **Scope**.|
| [Scope](#scopedeprecated) | Union set of this **Scope** and the given **Scope**.|
**Example**
```js
......@@ -2776,7 +2776,7 @@ Obtains the union set of this **Scope** and the given **Scope**.
let result = range.expand(rangeFir);
```
### expand<sup>8+(deprecated)</sup>
### expand<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2798,7 +2798,7 @@ Obtains the union set of this **Scope** and the given value.
| Type| Description|
| -------- | -------- |
| [Scope](#scope8) | Union set of this **Scope** and the given value.|
| [Scope](#scopedeprecated) | Union set of this **Scope** and the given value.|
**Example**
```js
......@@ -2809,7 +2809,7 @@ Obtains the union set of this **Scope** and the given value.
let result = range.expand(tempMiDF);
```
### contains<sup>8+(deprecated)</sup>
### contains<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2842,7 +2842,7 @@ Checks whether a value is within this **Scope**.
range.contains(tempMiDF);
```
### contains<sup>8+(deprecated)</sup>
### contains<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -2858,7 +2858,7 @@ Checks whether a range is within this **Scope**.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| range | [Scope](#scope8) | Yes| **Scope** specified.|
| range | [Scope](#scopedeprecated) | Yes| **Scope** specified.|
**Return value**
......@@ -2878,7 +2878,7 @@ Checks whether a range is within this **Scope**.
let result = range.contains(rangeSec);
```
### clamp<sup>8+(deprecated)</sup>
### clamp<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -3113,13 +3113,13 @@ that.decode(array).then(val=>{
```
## Base64<sup>8+(deprecated)</sup>
## Base64<sup>(deprecated)</sup>
> **NOTE**
>
> This class is deprecated since API version 9. You are advised to use [Base64Helper9+](#base64helper9) instead.
### constructor<sup>8+(deprecated)</sup>
### constructor<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -3136,7 +3136,7 @@ A constructor used to create a **Base64** object.
let base64 = new util.Base64();
```
### encodeSync<sup>8+(deprecated)</sup>
### encodeSync<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -3168,7 +3168,7 @@ Encodes the input content.
let result = that.encodeSync(array);
```
### encodeToStringSync<sup>8+(deprecated)</sup>
### encodeToStringSync<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -3199,7 +3199,7 @@ Encodes the input content.
let result = that.encodeToStringSync(array);
```
### decodeSync<sup>8+(deprecated)</sup>
### decodeSync<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -3230,7 +3230,7 @@ Decodes the input content.
let result = that.decodeSync(buff);
```
### encode<sup>8+(deprecated)</sup>
### encode<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -3266,7 +3266,7 @@ Encodes the input content asynchronously.
})
```
### encodeToString<sup>8+(deprecated)</sup>
### encodeToString<sup>(deprecated)</sup>
> **NOTE**
>
......@@ -3299,7 +3299,7 @@ Encodes the input content asynchronously.
})
```
### decode<sup>8+(deprecated)</sup>
### decode<sup>(deprecated)</sup>
> **NOTE**
>
......
......@@ -4,9 +4,9 @@ The **\<svg>** component is a basic container. It can be used as the root node o
> **NOTE**
> - This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
>
> - The width and height must be defined for the **\<svg>** parent component or **\<svg>** component. Otherwise, the component is not drawn.
> - This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
>
> - The width and height must be defined for the **\<svg>** parent component or **\<svg>** component. Otherwise, the component is not drawn.
## Required Permissions
......@@ -15,21 +15,21 @@ None
## Child Components
The following are supported: [\<svg>](js-components-svg.md), [\<rect>](js-components-svg-rect.md), [\<circle>](js-components-svg-circle.md), [\<ellipse>](../arkui-js/js-components-svg-ellipse.md), [\<path>](js-components-svg-path.md), [\<line](../arkui-js/js-components-svg-line.md), [\<polygon>](../arkui-js/js-components-svg-polygon.md), [\<polyline>](js-components-svg-polyline.md), [\<text>](js-components-svg-text.md), [\<animate>](js-components-svg-animate.md), and [\<animateTransform>](js-components-svg-animateTransform.md).
The following are supported: [\<svg>](js-components-svg.md), [\<rect>](js-components-svg-rect.md), [\<circle>](js-components-svg-circle.md), [\<ellipse>](../arkui-js/js-components-svg-ellipse.md), [\<path>](js-components-svg-path.md), [\<line](../arkui-js/js-components-svg-line.md), [\<polygon>](../arkui-js/js-components-svg-polygon.md), [\<polyline>](js-components-svg-polyline.md), [\<text>](js-components-svg-text.md), [\<animate>](js-components-svg-animate.md), and [\<animateTransform>](js-components-svg-animatetransform.md).
## Attributes
The [universal attributes](../arkui-js/js-components-svg-common-attributes.md) and the attributes listed below are supported. The configured universal attributes are passed to the child components.
| Name| Type| Default Value| Mandatory| Description|
| -------- | -------- | -------- | -------- | -------- |
| id | string | - | No| Unique ID of the component.|
| width | &lt;length&gt;\|&lt;percentage&gt; | - | No| Component width.|
| height | &lt;length&gt;\|&lt;percentage&gt; | - | No| Component height.|
| x | &lt;length&gt;\|&lt;percentage&gt; | - | No| X-coordinate of the current **\<svg>** component. The settings do not work for the root **\<svg>** node. |
| y | &lt;length&gt;\|&lt;percentage&gt; | | No| Y-coordinate of the current **\<svg>** component. The settings do not work for the root **\<svg>** node. |
| viewBox | string | - | No| View box of the current **\<svg>** component. The supported format is \<number number number number>. The four parameters indicate **min-x**, **min-y**, **width**, and **height**, respectively. The width and height of the view box are different from those of the **\<svg>** component. The view box is scaled in center-aligned mode. |
| Name | Type | Default Value | Mandatory | Description |
| ------- | ---------------------------------- | ------------- | --------- | ---------------------------------------- |
| id | string | - | No | Unique ID of the component. |
| width | &lt;length&gt;\|&lt;percentage&gt; | - | No | Component width. |
| height | &lt;length&gt;\|&lt;percentage&gt; | - | No | Component height. |
| x | &lt;length&gt;\|&lt;percentage&gt; | - | No | X-coordinate of the current **\<svg>** component. The settings do not work for the root **\<svg>** node. |
| y | &lt;length&gt;\|&lt;percentage&gt; | | No | Y-coordinate of the current **\<svg>** component. The settings do not work for the root **\<svg>** node. |
| viewBox | string | - | No | View box of the current **\<svg>** component. The supported format is \<number number number number>. The four parameters indicate **min-x**, **min-y**, **width**, and **height**, respectively. The width and height of the view box are different from those of the **\<svg>** component. The view box is scaled in center-aligned mode. |
## Example
......
......@@ -28,7 +28,7 @@
- [使用显式Want启动Ability](ability-startup-with-explicit-want.md)
- [使用隐式Want打开网址](ability-startup-with-implicit-want.md)
- [应用间使用Want分享数据](data-share-via-want.md)
- [组件启动规则](component-startup-rules.md)
- [组件启动规则(Stage模型)](component-startup-rules.md)
- 应用组件跨设备交互(流转)
- [流转概述](inter-device-interaction-hop-overview.md)
- [跨端迁移(仅对系统应用开放)](hop-cross-device-migration.md)
......@@ -84,6 +84,7 @@
- [服务卡片开发指导](widget-development-fa.md)
- [FA模型的Context](application-context-fa.md)
- [信息传递载体Want](want-fa.md)
- [组件启动规则(FA模型)](component-startup-rules-fa.md)
- 进程间通信
- [进程模型](process-model-fa.md)
- [公共事件](common-event-fa.md)
......
# 组件启动规则(FA模型)
启动组件是指一切启动或连接应用组件的行为:
- 启动PageAbility、ServiceAbility,如使用startAbility()等相关接口。
- 连接ServiceAbility、DataAbility,如使用connectAbility()、acquireDataAbilityHelper()等相关接口。
在OpenHarmony中,为了保证用户具有更好的使用体验,对以下几种易影响用户体验与系统安全的行为做了限制:
- 后台应用任意弹框,如各种广告弹窗,影响用户使用。
- 后台应用相互唤醒,不合理的占用系统资源,导致系统功耗增加或系统卡顿。
- 前台应用任意跳转至其他应用,如随意跳转到其他应用的支付页面,存在安全风险。
鉴于此,OpenHarmony制订了一套组件启动规则,主要包括:
- **跨应用启动组件,需校验目标组件Visible**
- 只针对跨应用场景
- 若目标组件visible字段配置为false,则需校验`ohos.permission.START_INVISIBLE_ABILITY`权限
- [组件visible配置参考](../quick-start/module-configuration-file.md#abilities标签)
- **位于后台的应用,启动组件需校验BACKGROUND权限**
- 应用前后台判断标准:若应用进程获焦或所属的UIAbility位于前台则判定为前台应用,否则为后台应用
- 需校验`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限
- **跨应用启动FA模型的ServiceAbility组件或DataAbility组件,对端应用需配置关联启动**
- 只针对跨应用场景
- 只针对目标组件为ServiceAbility与DataAbility生效
- 目标应用的AssociateWakeUp为**ture**,其提供的ServiceAbility与DataAbility才允许被其他应用访问
- 只有系统预置应用才允许配置AssociateWakeUp字段,其余应用AssociateWakeUp默认为**false**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 1. 组件启动管控自OpenHarmony v3.2 Release版本开始落地。
>
> 2. 与原本的启动规则不同,新的组件启动规则较为严格,开发者需熟知启动规则,避免业务功能异常。
启动组件的具体校验流程见下文。
## 同设备组件启动规则
设备内启动组件,不同场景下的规则不同,可分为如下两种场景:
- 启动PageAbility。
- 启动ServiceAbility或DataAbility。
![startup-rule](figures/component-startup-inner-fa.png)
## 分布式跨设备组件启动规则
跨设备启动组件,不同场景下的规则不同,可分为如下两种场景:
- 启动PageAbility。
- 启动ServiceAbility。
![component-startup-rules](figures/component-startup-inter-fa.png)
# 组件启动规则
# 组件启动规则(Stage模型)
启动组件是指一切启动或连接Ability的行为:
启动组件是指一切启动或连接应用组件的行为:
- 启动Ability,如使用startAbility()、startServiceExtensionAbility()、startAbilityByCall()等相关接口。
- 启动UIAbility、ServiceExtensionAbility、DataShareExtensionAbility,如使用startAbility()、startServiceExtensionAbility()、startAbilityByCall()等相关接口。
- 连接Ability,如使用connectAbility()、connectServiceExtensionAbility()、acquireDataAbilityHelper()、createDataShareHelper()等相关接口。
- 连接ServiceExtensionAbility、DataShareExtensionAbility,如使用connectServiceExtensionAbility()、createDataShareHelper()等相关接口。
在OpenHarmony中,为了保证用户具有更好的使用体验,对以下几种易影响用户体验与系统安全的行为做了限制:
......@@ -16,19 +16,22 @@
- 后台应用相互唤醒,不合理的占用系统资源,导致系统功耗增加或系统卡顿。
- 前台应用任意跳转至其他应用,如随意跳转到其他应用的支付Ability,存在安全风险。
- 前台应用任意跳转至其他应用,如随意跳转到其他应用的支付页面,存在安全风险。
鉴于此,OpenHarmony制订了一套组件启动规则,主要包括:
- 应用位于后台时,启动组件需鉴权。
- **跨应用启动组件,需校验目标组件Visible**
- 若目标组件visible字段配置为false,则需校验`ohos.permission.START_INVISIBLE_ABILITY`权限
- [组件visible配置参考](../quick-start/module-configuration-file.md#abilities标签)
- 跨应用启动visible为false的组件,需鉴权。
- **位于后台的应用,启动组件需校验BACKGROUND权限**
- 应用前后台判断标准:若应用进程获焦或所属的UIAbility位于前台则判定为前台应用,否则为后台应用
- 需校验`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限
- 跨应用启动FA模型的ServiceAbility组件或DataAbility组件,对端应用需配置关联启动。
- 使用startAbilityByCall接口,需鉴权(使用方式参考:[Call调用开发指南](hop-multi-device-collaboration.md#通过跨设备call调用实现多端协同)
- **使用startAbilityByCall接口,需校验CALL权限**(使用方式参考:[Call调用开发指南(同设备)](uiability-intra-device-interaction.md#通过call调用实现uiability交互仅对系统应用开放)[Call调用开发指南(跨设备)](hop-multi-device-collaboration.md#通过跨设备call调用实现多端协同)
- 需校验`ohos.permission.ABILITY_BACKGROUND_COMMUNICATION`权限
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
......@@ -36,87 +39,26 @@
>
> 2. 与原本的启动规则不同,新的组件启动规则较为严格,开发者需熟知启动规则,避免业务功能异常。
## 相关概念说明
为方便开发者理解管控规则,此处对所涉及的相关概念进行解释。
- **应用APL(Ability Privilege Level)**,表示应用的权限申请优先级的定义,不同APL等级的应用所能申请的权限不同,APL分为3个等级:
- 操作系统核心能力APL="system_core" (APL = 3)
- 系统基础服务APL="system_basic" (APL = 2)
- 三方应用程序APL="normal" (APL = 1)
- **注:三方应用默认都是APL="normal"**
- **BACKGROUND校验**
- 对发起端应用进程的状态进行判断,若应用进程获焦或所属的Ability位于前台则判定为前台应用,否则为后台应用
- 若发起端为后台应用,则需校验START_ABILITIES_FROM_BACKGROUND权限
- **VISIBLE校验**
- 只针对跨应用启动的场景
- 若目标组件visible配置为false,则需校验START_INVISIBLE_ABILITY权限
- **CALL校验**
- 只针对startAbilityByCall接口
- 需校验ABILITY_BACKGROUND_COMMUNICATION权限
- **关联启动(AssociateWakeUp)**
- 只有系统预置应用才允许配置AssociateWakeUp字段,其余应用AssociateWakeUp默认为**false**
- 只针对跨应用场景
- 只针对目标组件为**FA**模型的**ServiceAbility****DataAbility**生效
- 目标应用的AssociateWakeUp为**ture**,其提供的ServiceAbility与DataAbility才允许被其他应用访问
- **相关权限**
```json
{
"name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND",
"grantMode": "system_grant",
"availableLevel": "system_basic", // APL等级至少为system_basic才可申请
"since": 9,
"deprecated": "",
"provisionEnable": true, // 支持ACL方式申请权限
"distributedSceneEnable": false
},
{
"name": "ohos.permission.START_INVISIBLE_ABILITY",
"grantMode": "system_grant",
"availableLevel": "system_core", // APL等级至少为system_core才可申请
"since": 9,
"deprecated": "",
"provisionEnable": true, // 支持ACL方式申请权限
"distributedSceneEnable": false
},
{
"name": "ohos.permission.ABILITY_BACKGROUND_COMMUNICATION",
"grantMode": "system_grant",
"availableLevel": "system_basic", // APL等级至少为system_basic才可申请
"since": 9,
"deprecated": "",
"provisionEnable": true, // 支持ACL方式申请权限
"distributedSceneEnable": false
}
```
启动组件的具体校验流程见下文。
## 同设备组件启动管控
## 同设备组件启动规则
不同场景下的管控规则不同,可分为如下三种场景:
- 启动一般组件:(FA模型)PageAbility,(Stage模型)UIAbility、ServiceExtensionAbility、DataShareExtensionAbility。
设备内启动组件,不同场景下的规则不同,可分为如下两种场景:
- 启动FA模型的ServiceAbility或DataAbility。
- 启动或连接组件:UIAbility、ServiceExtensionAbility、DataShareExtensionAbility。
- 通过startAbilityByCall接口启动(Stage模型)UIAbility。
- 通过startAbilityByCall接口启动UIAbility。
![startup-rule](figures/startup-rule.png)
![startup-rule](figures/component-startup-inner-stage.png)
## 分布式跨设备组件启动管控
## 分布式跨设备组件启动规则
不同场景下的管控规则不同,可分为如下三种场景:
- 启动一般组件:(FA模型)PageAbility,(Stage模型)UIAbility、ServiceExtensionAbility。
跨设备启动组件,不同场景下的规则不同,可分为如下两种场景:
- 启动FA模型的ServiceAbility。
- 启动或连接组件:UIAbility、ServiceExtensionAbility、DataShareExtensionAbility。
- 通过startAbilityByCall接口启动(Stage模型)UIAbility。
- 通过startAbilityByCall接口启动UIAbility。
![component-startup-rules](figures/component-startup-rules.jpg)
![component-startup-rules](figures/component-startup-inter-stage.png)
......@@ -15,8 +15,8 @@
| distro对象中的moduleType | 标识当前HAP的类型,包括两种类型:entry和feature。另外,如果表示HAR包类型,请设置为har | type | 标签变更。 |
| distro对象中的installationFree | 标识当前HAP是否支持免安装特性 | installationFree | 标签变更。 |
| distro对象中的deliveryWithInstall | 标识当前HAP是否支持随应用安装 | deliveryWithInstall | 标签变更。 |
| metaData | 标识HAP的元信息 | metadata | 具体差异如[表2](#表2 FA模型metaData和Stage中metadata对比)。 |
| abilities | 标识当前模块内的所有Ability | abilities | 具体差异如[表5](#表5 FA模型和Stage中abilities差异对比)。 |
| metaData | 标识HAP的元信息 | metadata | 具体差异如[表2](#表2-fa模型metadata和stage中metadata对比)。 |
| abilities | 标识当前模块内的所有Ability | abilities | 具体差异如[表5](#表5-fa模型和stage中abilities差异对比)。 |
| js | 标识基于ArkUI框架开发的JS模块集合,其中的每个元素代表一个JS模块的信息 | pages | Stage模型在module标签下保留该对象中的pages,window配置与pages的下一级。 |
| shortcuts | 标识应用的快捷方式信息 | shortcut_config.json文件 | 在开发视图的resources/base/profile下面定义配置文件shortcut_config.json。 |
| reqPermissions | 标识应用运行时向系统申请的权限 | requestPermissions | 标签名称变更。 |
......@@ -33,7 +33,7 @@
| -------- | -------- | -------- | -------- |
| parameters | 标识调用Ability时所有调用参数的元信息 | / | Stage模型不支持。 |
| results | 标识Ability返回值的元信息 | / | Stage模型不支持。 |
| customizeData | 该标签标识父级组件的自定义元信息,Parameters和results在application不可配 | metadata | 具体差异见[表3](#表3 FA模型metaData的customizeData和Stage中metadata对比)。 |
| customizeData | 该标签标识父级组件的自定义元信息,Parameters和results在application不可配 | metadata | 具体差异见[表3](#表3-fa模型metadata的customizedata和stage中metadata对比)。 |
### 表3 FA模型metaData的customizeData和Stage中metadata对比
......@@ -41,7 +41,7 @@
| -------- | -------- | -------- | -------- |
| name | 标识数据项的键名称。字符串最大长度为255字节 | name | 无。 |
| value | 标识数据项的值。字符串最大长度为255字节。 | value | 无。 |
| extra | 标识当前custom数据的格式,取值为表示extra的资源值。 | resource | 标签变更。具体实例见[表4](#表4 FA模型metaData和Stage中metadata示例)。 |
| extra | 标识当前custom数据的格式,取值为表示extra的资源值。 | resource | 标签变更。具体实例见[表4](#表4-fa模型metadata和stage中metadata示例)。 |
### 表4 FA模型metaData和Stage中metadata示例
......@@ -58,7 +58,7 @@
| process | 运行应用程序或Ability的进程名称 | / | Stage模型不支持abilities中配置,在module标签下配置process |
| uri | 标识Ability的统一资源标识符 | / | Stage模型不支持 |
| deviceCapability | 标识Ability运行时要求设备具有的能力,采用字符串数组的格式表示 | / | Stage模型不支持 |
| metaData | 该标签标识ability的元信息。 | metadata | 具体差异如[表2](#表2 FA模型metaData和Stage中metadata对比) |
| metaData | 该标签标识ability的元信息。 | metadata | 具体差异如[表2](#表2-fa模型metadata和stage中metadata对比) |
| type | 标识Ability的类型 | / | Stage模型不支持 |
| grantPermission | 指定是否可以向Ability内任何数据授予权限 | / | abilities内不支持; |
| readPermission | 标识读取Ability的数据所需的权限。该标签仅适用于data类型的Ability | / | abilities内不支持;在extensionAbilities标签中支持 |
......
......@@ -367,7 +367,7 @@ export default class FuncAbility extends UIAbility {
经常还会遇到一类场景,当应用A已经启动且处于主页面时,回到桌面,打开应用B,并从应用B再次启动应用A,且需要跳转到应用A的指定页面。例如联系人应用和短信应用配合使用的场景。打开短信应用主页,回到桌面,此时短信应用处于已打开状态且当前处于短信应用的主页。再打开联系人应用主页,进入联系人用户A查看详情,点击短信图标,准备给用户A发送短信,此时会再次拉起短信应用且当前处于短信应用的发送页面。
![uiability_not_first_started](figures/uiability_not_first_started.png)
![uiability_not_first_started](figures/uiability_not_first_started.png)
针对以上场景,即当应用A的UIAbility实例已创建,并且处于该UIAbility实例对应的主页面中,此时,从应用B中需要再次启动应用A的该UIAbility,并且需要跳转到不同的页面,这种情况下要如何实现呢?
......@@ -432,12 +432,12 @@ Call调用的使用场景主要包括:
**表1** Call调用相关名词解释
| 名词 | 描述 |
| 名词 | 描述 |
| -------- | -------- |
| CallerAbility | 进行Call调用的UIAbility(调用方)。 |
| CalleeAbility | 被Call调用的UIAbility(被调用方)。 |
| Caller | 实际对象,由startAbilityByCall接口返回,CallerAbility可使用Caller与CalleeAbility进行通信。 |
| Callee | 实际对象,被CalleeAbility持有,可与Caller进行通信。 |
| CallerAbility | 进行Call调用的UIAbility(调用方)。 |
| CalleeAbility | 被Call调用的UIAbility(被调用方)。 |
| Caller | 实际对象,由startAbilityByCall接口返回,CallerAbility可使用Caller与CalleeAbility进行通信。 |
| Callee | 实际对象,被CalleeAbility持有,可与Caller进行通信。 |
Call调用示意图如下所示。
......@@ -462,15 +462,15 @@ Call功能主要接口如下表所示。具体的API详见[接口文档](../refe
**表2** Call功能主要接口
| 接口名 | 描述 |
| 接口名 | 描述 |
| -------- | -------- |
| startAbilityByCall(want:&nbsp;Want):&nbsp;Promise&lt;Caller&gt; | 启动指定UIAbility并获取其Caller通信接口,默认为后台启动,通过配置want可实现前台启动,详见[接口文档](../reference/apis/js-apis-ability-context.md#abilitycontextstartabilitybycall)。AbilityContext与ServiceExtensionContext均支持该接口。 |
| on(method:&nbsp;string,&nbsp;callback:&nbsp;CalleeCallBack):&nbsp;void | 通用组件Callee注册method对应的callback方法。 |
| off(method:&nbsp;string):&nbsp;void | 通用组件Callee解注册method的callback方法。 |
| call(method:&nbsp;string,&nbsp;data:&nbsp;rpc.Sequenceable):&nbsp;Promise&lt;void&gt; | 向通用组件Callee发送约定序列化数据。 |
| callWithResult(method:&nbsp;string,&nbsp;data:&nbsp;rpc.Sequenceable):&nbsp;Promise&lt;rpc.MessageParcel&gt; | 向通用组件Callee发送约定序列化数据,&nbsp;并将Callee返回的约定序列化数据带回。 |
| release():&nbsp;void | 释放通用组件的Caller通信接口。 |
| on(type:&nbsp;"release",&nbsp;callback:&nbsp;OnReleaseCallback):&nbsp;void | 注册通用组件通信断开监听通知。 |
| startAbilityByCall(want:&nbsp;Want):&nbsp;Promise&lt;Caller&gt; | 启动指定UIAbility并获取其Caller通信接口,默认为后台启动,通过配置want可实现前台启动,详见[接口文档](../reference/apis/js-apis-ability-context.md#abilitycontextstartabilitybycall)。AbilityContext与ServiceExtensionContext均支持该接口。 |
| on(method:&nbsp;string,&nbsp;callback:&nbsp;CalleeCallBack):&nbsp;void | 通用组件Callee注册method对应的callback方法。 |
| off(method:&nbsp;string):&nbsp;void | 通用组件Callee解注册method的callback方法。 |
| call(method:&nbsp;string,&nbsp;data:&nbsp;rpc.Sequenceable):&nbsp;Promise&lt;void&gt; | 向通用组件Callee发送约定序列化数据。 |
| callWithResult(method:&nbsp;string,&nbsp;data:&nbsp;rpc.Sequenceable):&nbsp;Promise&lt;rpc.MessageParcel&gt; | 向通用组件Callee发送约定序列化数据,&nbsp;并将Callee返回的约定序列化数据带回。 |
| release():&nbsp;void | 释放通用组件的Caller通信接口。 |
| on(type:&nbsp;"release",&nbsp;callback:&nbsp;OnReleaseCallback):&nbsp;void | 注册通用组件通信断开监听通知。 |
设备内通过Call调用实现UIAbility交互,涉及如下两部分开发:
......@@ -486,9 +486,9 @@ Call功能主要接口如下表所示。具体的API详见[接口文档](../refe
1. 配置Ability的启动模式。
配置module.json5,将CalleeAbility配置为单实例"singleton"。
| Json字段 | 字段说明 |
| Json字段 | 字段说明 |
| -------- | -------- |
| "launchType" | Ability的启动模式,设置为"singleton"类型。 |
| "launchType" | Ability的启动模式,设置为"singleton"类型。 |
Ability配置标签示例如下:
......
......@@ -60,7 +60,7 @@ build() {
Ability配置中缺少startWindowIcon属性配置,需要在module.json5中abilities中配置startWindowIcon。
参考文档:[Stage模型应用程序包结构](../quick-start/application-package-structure-stage.md)
参考文档:[Stage模型应用程序包结构](../quick-start/module-configuration-file.md)
示例:
......@@ -95,7 +95,7 @@ Ability配置中缺少startWindowIcon属性配置,需要在module.json5中abil
## 如何在应用A中去获取应用B的Hap包的安装路径
适用于:OpenHarmony SDK 3..0以上版本, API9 Stage模型
适用于:OpenHarmony SDK 3.0以上版本, API9 Stage模型
首先需要申请系统权限,具体参看文档:[自动化签名](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-auto-configuring-signature-information-0000001271659465)。导入bundle模块,通过调用bundle.getApplicationInfo()接口,通过包名获取应用信息。然后通过application.moduleSourceDirs获取应用存储路径。
......
......@@ -34,7 +34,7 @@ for(let cameraIndex = 0; cameraIndex < this.cameraArray.length; cameraIndex++) {
break
}
}
cameraInput = await this.cameraManager.createCameraInput(cameraId)熊文帅
cameraInput = await this.cameraManager.createCameraInput(cameraId)
```
## 如何进行图片剪切
......
# FA模型应用程序包结构
基于[FA模型](application-configuration-file-overview-fa.md)开发的应用,其应用程序包结构如[应用程序包结构(FA模型)](figures/FA_3.png)所示。开发者需要熟悉应用程序包结构相关的基本概念。
基于[FA模型](application-configuration-file-overview-fa.md)开发的应用,其应用程序包结构如下图**应用程序包结构(FA模型)**所示。开发者需要熟悉应用程序包结构相关的基本概念。
FA模型与Stage模型不同之处在于HAP内部文件存放位置不同,FA模型将所有的资源文件、库文件和代码文件都放在assets文件夹中,在文件夹内部进一步区分。
......@@ -11,7 +11,7 @@ FA模型与Stage模型不同之处在于HAP内部文件存放位置不同,FA
- assets是HAP所有的资源文件、库文件和代码文件的集合,内部可以分为entry和js文件夹。entry文件夹中存放的是resources目录和resources.index文件。
- resources目录用于存放应用的资源文件(字符串、图片等),便于开发者使用和维护,详见[资源文件的使用](../key-features/multi-device-app-dev/resource-usage.md/)
- resources目录用于存放应用的资源文件(字符串、图片等),便于开发者使用和维护,详见[资源文件的使用](../key-features/multi-device-app-dev/resource-usage.md)
- resources.index是资源索引表,由IDE调用SDK工具生成。
......@@ -19,6 +19,5 @@ FA模型与Stage模型不同之处在于HAP内部文件存放位置不同,FA
- pack.info是Bundle中用于描述每个HAP属性的文件,例如app中的bundleName和versionCode信息、module中的name、type和abilities等信息,由IDE工具生成Bundle包时自动生成。
**图1** 应用程序包结构(FA模型)  
![FA_3](figures/FA_3.png)
**图1** 应用程序包结构(FA模型)
![app-pack-fa](figures/app-pack-fa.png)
\ No newline at end of file
# Stage模型应用程序包结构
基于[Stage模型](application-configuration-file-overview-stage.md)开发的应用,经编译打包后,其应用程序包结构如[应用程序包结构(Stage模型)](figures/Stage-.png)所示。开发者需要熟悉应用程序包结构相关的基本概念。
基于[Stage模型](application-configuration-file-overview-stage.md)开发的应用,经编译打包后,其应用程序包结构如下图**应用程序包结构(Stage模型)**所示。开发者需要熟悉应用程序包结构相关的基本概念。
- 在开发态,一个应用包含一个或者多个Module,可以在[DevEco Studio](https://developer.harmonyos.com/cn/develop/deveco-studio/)工程中[创建一个或者多个Module](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/ohos-adding-deleting-module-0000001218760594-V3)。Module是OpenHarmony应用/服务的基本功能单元,包含了源代码、资源文件、第三方库及应用/服务配置文件,每一个Module都可以独立进行编译和运行。Module分为“Ability”和“Library”两种类型,“Ability”类型的Module对应于编译后的HAP(Harmony Ability Package);“Library”类型的Module对应于[HAR](har-structure.md)(Harmony Ability Resources)包,即编译后的.tgz文件。
一个Module可以包含一个或多个[UIAbility](../application-models/uiability-overview.md)组件,如[Module与UIAbility组件关系示意图](figures/ability-and-module.png)所示。
**图1** Module与UIAbility组件关系示意图  
**图1** Module与UIAbility组件关系示意图
![ability-and-module](figures/ability-and-module.png)
全文中介绍到的Module默认指的是“Ability”类型的Module。
......@@ -21,10 +21,10 @@
- 打包后的HAP包结构包括ets、libs、resources等文件夹和resources.index、module.json、pack.info等文件。
- ets目录用于存放应用代码编译后的字节码文件。
- libs目录用于存放库文件。库文件是OpenHarmony应用依赖的第三方代码(例如.so、.jar、.bin、.har等二进制文件)。
- resources目录用于存放应用的资源文件(字符串、图片等),便于开发者使用和维护,详见[资源文件的使用](../key-features/multi-device-app-dev/resource-usage.md/)
- resources目录用于存放应用的资源文件(字符串、图片等),便于开发者使用和维护,详见[资源文件的使用](../key-features/multi-device-app-dev/resource-usage.md)
- resources.index是资源索引表,由IDE编译工程时生成。
- module.json是HAP的配置文件,内容由工程配置中的module.json5和app.json5组成,该文件是HAP中必不可少的文件。IDE会自动生成一部分默认配置,开发者按需修改其中的配置。详细字段请参见[应用配置文件](application-configuration-file-overview-stage.md)
- pack.info是Bundle中用于描述每个HAP属性的文件,例如app中的bundleName和versionCode信息、module中的name、type和abilities等信息,由IDE工具生成Bundle包时自动生成。
**图2** 应用程序包结构(Stage模型)  
![Stage-](figures/Stage-.png)
**图2** 应用程序包结构(Stage模型)
![app-pack-stage](figures/app-pack-stage.png)
......@@ -40,7 +40,7 @@
- **src &gt; main &gt; ets &gt; MainAbility &gt; pages &gt; index.ets**:pages列表中的第一个页面,即应用的首页入口。
- **src &gt; main &gt; ets &gt; MainAbility &gt; app.ets**:承载Ability生命周期。
- **src &gt; main &gt; resources**:用于存放应用/服务所用到的资源文件,如图形、多媒体、字符串、布局文件等。关于资源文件,详见[资源文件的分类](resource-categories-and-access.md#资源分类)
- **src &gt; main &gt; config.json**:模块配置文件。主要包含HAP包的配置信息、应用/服务在具体设备上的配置信息以及应用/服务的全局配置信息。具体的配置文件说明,详见[FA模型应用程序包结构](application-package-structure-fa.md)
- **src &gt; main &gt; config.json**:模块配置文件。主要包含HAP包的配置信息、应用/服务在具体设备上的配置信息以及应用/服务的全局配置信息。具体的配置文件说明,详见[应用配置文件(FA模型)](application-configuration-file-overview-fa.md)
- **build-profile.json5**:当前的模块信息 、编译信息配置项,包括buildOption、targets配置等。
- **hvigorfile.ts**:模块级编译构建任务脚本,开发者可以自定义相关任务和代码实现。
......
......@@ -38,7 +38,7 @@
- **src &gt; main &gt; ets &gt; entryability**:应用/服务的入口。
- **src &gt; main &gt; ets &gt; pages**:应用/服务包含的页面。
- **src &gt; main &gt; resources**:用于存放应用/服务所用到的资源文件,如图形、多媒体、字符串、布局文件等。关于资源文件,详见[资源文件的分类](resource-categories-and-access.md#资源分类)
- **src &gt; main &gt; module.json5**:模块配置文件。主要包含HAP包的配置信息、应用/服务在具体设备上的配置信息以及应用/服务的全局配置信息。具体的配置文件说明,详见[Stage模型应用程序包结构](application-package-structure-stage.md)
- **src &gt; main &gt; module.json5**:模块配置文件。主要包含HAP包的配置信息、应用/服务在具体设备上的配置信息以及应用/服务的全局配置信息。具体的配置文件说明,详见[module.json5配置文件](module-configuration-file.md)
- **build-profile.json5**:当前的模块信息 、编译信息配置项,包括buildOption、targets配置等。
- **hvigorfile.ts**:模块级编译构建任务脚本,开发者可以自定义相关任务和代码实现。
......
......@@ -39,7 +39,7 @@
- **src &gt; main &gt; js &gt; MainAbility &gt; app.js**:承载Ability生命周期。
- **src &gt; main &gt; resources**:用于存放应用/服务所用到的资源文件,如图形、多媒体、字符串、布局文件等。关于资源文件,详见[资源限定与访问](../ui/js-framework-resource-restriction.md)
- **src &gt; main &gt; config.json**:模块配置文件。主要包含HAP包的配置信息、应用/服务在具体设备上的配置信息以及应用/服务的全局配置信息。具体的配置文件说明,详见[FA模型应用程序包结构](application-package-structure-fa.md)
- **src &gt; main &gt; config.json**:模块配置文件。主要包含HAP包的配置信息、应用/服务在具体设备上的配置信息以及应用/服务的全局配置信息。具体的配置文件说明,详见[应用配置文件(FA模型)](application-configuration-file-overview-fa.md)
- **build-profile.json5**:当前的模块信息 、编译信息配置项,包括buildOption、targets配置等。
- **hvigorfile.ts**:模块级编译构建任务脚本,开发者可以自定义相关任务和代码实现。
......
# Want
Want是对象间信息传递的载体, 可以用于应用组件间的信息传递。 Want的使用场景之一是作为startAbility的参数, 其包含了指定的启动目标, 以及启动时需携带的相关数据, 如bundleName和abilityName字段分别指明目标Ability所在应用的包名以及对应包内的Ability名称。当Ability A需要启动Ability B并传入一些数据时, 可使用Want作为载体将这些数据传递给Ability B。
> **说明:**
>
> 本模块首批接口从API version 6开始支持,从API version 9废弃,替换模块为[Want (Want)](js-apis-app-ability-Want.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import Want from '@ohos.application.Want'
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase
| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 |
| ----------- | -------- |-------- | -------------------- | ---- | ------------------------------------------------------------ |
| deviceId | 是 | 否 | string | 否 | 表示运行指定Ability的设备ID。 |
| bundleName | 是 | 否 | string | 否 | 表示包名。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 |
| abilityName | 是 | 否 | string | 否 | 表示待启动的Ability名称。如果在Want中该字段同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。AbilityName需要在一个应用的范围内保证唯一。 |
| uri | 是 | 否 | string | 否 | 表示Uri。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 |
| type | 是 | 否 | string | 否 | 表示MIME type类型,打开文件的类型,主要用于文管打开文件。比如:"text/xml" 、 "image/*"等,MIME定义参考:https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com。 |
| flags | 是 | 否 | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](js-apis-featureAbility.md#flags说明)。 |
| action | 是 | 否 | string | 否 | 表示要执行的通用操作(如:查看、分享、应用详情)。在隐式Want中,您可以定义该字段,配合uri或parameters来表示对数据要执行的操作。 |
| parameters | 是 | 否 | {[key: string]: any} | 否 | 表示WantParams,由开发者自行决定传入的键值对。默认会携带以下key值:<br>ohos.aafwk.callerPid 表示拉起方的pid。<br>ohos.aafwk.param.callerToken 表示拉起方的token。<br>ohos.aafwk.param.callerUid 表示[bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo-1)中的uid,应用包里应用程序的uid。 |
| entities | 是 | 否 | Array\<string> | 否 | 表示目标Ability额外的类别信息(如:浏览器、视频播放器),在隐式Want中是对action字段的补充。在隐式Want中,您可以定义该字段,来过滤匹配Ability类型。 |
| moduleName<sup>9+</sup> | 是 | 否 | string | 否 | 表示待启动的Ability所属的模块(module)。 |
具体字段描述参考ability/want.d.ts文件
**示例:**
- 基础用法
``` ts
var want = {
"deviceId": "", // deviceId为空表示本设备
"bundleName": "com.extreme.test",
"abilityName": "MainAbility",
"moduleName": "entry" // moduleName非必选
};
this.context.startAbility(want, (error) => {
// 显式拉起Ability,通过bundleName、abilityName和moduleName可以唯一确定一个Ability
console.log("error.code = " + error.code)
})
```
- 传递FD数据,FD表示文件描述符(FileDescriptor)
``` ts
import fileio from '@ohos.fileio';
var fd;
try {
fd = fileio.openSync("/data/storage/el2/base/haps/pic.png");
} catch(e) {
console.log("openSync fail:" + JSON.stringify(e));
}
var want = {
"deviceId": "", // deviceId为空表示本设备
"bundleName": "com.extreme.test",
"abilityName": "MainAbility",
"moduleName": "entry", // moduleName非必选
"parameters": {
"keyFd":{"type":"FD", "value":fd}
}
};
this.context.startAbility(want, (error) => {
// 显式拉起Ability,通过bundleName、abilityName和moduleName可以唯一确定一个Ability
console.log("error.code = " + error.code)
})
```
<!--no_check-->
......@@ -15,24 +15,25 @@ import ability from '@ohos.ability.ability'
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase
| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 |
| ----------- | -------- |-------- | -------------------- | ---- | ------------------------------------------------------------ |
| DataAbilityHelper | 是 | 否 | number | 否 | DataAbilityHelper二级模块。 |
| PacMap | 是 | 否 | Want | 否 | PacMap二级模块。 |
| DataAbilityOperation | 是 | 否 | Want | 否 | DataAbilityOperation二级模块。 |
| DataAbilityResult | 是 | 否 | Want | 否 | DataAbilityResult二级模块。 |
| AbilityResult | 是 | 否 | Want | 否 | AbilityResult二级模块。 |
| ConnectOptions | 是 | 否 | Want | 否 | ConnectOptions二级模块。 |
| StartAbilityParameter | 是 | 否 | Want | 否 | StartAbilityParameter二级模块。 |
| 名称 | 类型 | 必填 | 描述 |
| ----------- | -------------------- | ---- | ------------------------------------------------------------ |
| DataAbilityHelper | [DataAbilityHelper](js-apis-inner-ability-dataAbilityHelper.md) | 否 | DataAbilityHelper二级模块。 |
| PacMap | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#PacMap) | 否 | PacMap二级模块。 |
| DataAbilityOperation | [DataAbilityOperation](js-apis-inner-ability-dataAbilityOperation.md) | 否 | DataAbilityOperation二级模块。 |
| DataAbilityResult | [DataAbilityResult](js-apis-inner-ability-dataAbilityResult.md) | 否 | DataAbilityResult二级模块。 |
| AbilityResult | [AbilityResult](js-apis-inner-ability-abilityResult.md) | 否 | AbilityResult二级模块。 |
| ConnectOptions | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | 否 | ConnectOptions二级模块。 |
| StartAbilityParameter | [StartAbilityParameter](js-apis-inner-ability-startAbilityParameter.md) | 否 | StartAbilityParameter二级模块。 |
**示例:**
```ts
let dataAbilityHelper: ability.DataAbilityHelper;
let pacMap: ability.PacMap;
let dataAbilityOperation: ability.DataAbilityOperation;
let dataAbilityResult: ability.DataAbilityResult;
let abilityResult: ability.AbilityResult;
let connectOptions: ability.ConnectOptions;
let startAbilityParameter: ability.StartAbilityParameter;
```
\ No newline at end of file
```ts
import ability from '@ohos.ability.ability';
let dataAbilityHelper: ability.DataAbilityHelper;
let pacMap: ability.PacMap;
let dataAbilityOperation: ability.DataAbilityOperation;
let dataAbilityResult: ability.DataAbilityResult;
let abilityResult: ability.AbilityResult;
let connectOptions: ability.ConnectOptions;
let startAbilityParameter: ability.StartAbilityParameter;
```
\ No newline at end of file
......@@ -8,7 +8,7 @@ DataUriUtils模块提供用于处理使用DataAbilityHelper方案的对象的实
## 导入模块
```js
```ts
import dataUriUtils from '@ohos.ability.dataUriUtils';
```
......@@ -34,7 +34,7 @@ getId(uri: string): number
**示例:**
```js
```ts
dataUriUtils.getId("com.example.dataUriUtils/1221")
```
......@@ -63,7 +63,7 @@ attachId(uri: string, id: number): string
**示例:**
```js
```ts
var idint = 1122;
dataUriUtils.attachId(
"com.example.dataUriUtils",
......@@ -95,7 +95,7 @@ deleteId(uri: string): string
**示例:**
```js
```ts
dataUriUtils.deleteId("com.example.dataUriUtils/1221")
```
......@@ -124,7 +124,7 @@ updateId(uri: string, id: number): string
**示例:**
```js
```ts
var idint = 1122;
dataUriUtils.updateId(
"com.example.dataUriUtils",
......
......@@ -10,7 +10,7 @@ ErrorCode是定义启动功能时使用的错误代码。
## 导入模块
```
```ts
import errorCode from '@ohos.ability.errorCode'
```
......@@ -24,5 +24,5 @@ import errorCode from '@ohos.ability.errorCode'
| ------------------------------ | ---- | ---------------------------------------- |
| NO_ERROR | 0 | 没有错误。 |
| INVALID_PARAMETER | -1 | 无效的参数。 |
| ABILITY_NOT_FOUND | -2 | 找不到能力。 |
| ABILITY_NOT_FOUND | -2 | 找不到ABILITY。 |
| PERMISSION_DENY | -3 | 拒绝许可。 |
\ No newline at end of file
......@@ -8,7 +8,7 @@ wantConstant模块提供want中操作want常数和解释Flags说明的能力。
## 导入模块
```js
```ts
import wantConstant from '@ohos.ability.wantConstant';
```
......
# Ability
Ability模块提供对Ability生命周期、上下文环境等调用管理的能力,包括Ability创建、销毁、转储客户端信息等。
> **说明:**
>
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
## 导入模块
```ts
import Ability from '@ohos.app.ability.Ability';
```
## Ability.onConfigurationUpdate
onConfigurationUpdate(config: Configuration): void;
当系统配置更新时调用。
**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| config | [Configuration](js-apis-app-ability-configuration.md) | 是 | 表示需要更新的配置信息。 |
**示例:**
```ts
class myAbility extends Ability {
onConfigurationUpdate(config) {
console.log('onConfigurationUpdate, config:' + JSON.stringify(config));
}
}
```
## Ability.onMemoryLevel
onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
当系统已决定调整内存时调用。例如,当该功能在后台运行时,没有足够的内存来运行尽可能多的后台进程时可以使用。
**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| level | [AbilityConstant.MemoryLevel](js-apis-app-ability-abilityConstant.md#abilityconstantmemorylevel) | 是 | 回调返回内存微调级别,显示当前内存使用状态。|
**示例:**
```ts
class myAbility extends Ability {
onMemoryLevel(level) {
console.log('onMemoryLevel, level:' + JSON.stringify(level));
}
}
```
......@@ -11,7 +11,7 @@ AbilityConstant提供启动参数的接口的能力,包括设置初次开始
## 导入模块
```js
```ts
import AbilityConstant from '@ohos.app.ability.AbilityConstant';
```
......
# AbilityDelegatorRegistry
AbilityDelegatorRegistry模块提供用于存储已注册的AbilityDelegator和AbilityDelegatorArgs对象的全局寄存器的能力,包括获取应用程序的AbilityDelegator对象、获取单元测试参数AbilityDelegatorArgs对象。
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'
```
## AbilityLifecycleState
Ability生命周期状态。
**系统能力** :以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 值 | 说明 |
| ------------- | ---- | --------------------------- |
| UNINITIALIZED | 0 | 表示无效状态。 |
| CREATE | 1 | 表示Ability处于已创建状态。 |
| FOREGROUND | 2 | 表示Ability处于前台状态。 |
| BACKGROUND | 3 | 表示Ability处于后台状态。 |
| DESTROY | 4 | 表示Ability处于已销毁状态。 |
## AbilityDelegatorRegistry.getAbilityDelegator
getAbilityDelegator(): AbilityDelegator
获取应用程序的AbilityDelegator对象
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
| 类型 | 说明 |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| [AbilityDelegator](js-apis-inner-application-abilityDelegator.md#AbilityDelegator) | [AbilityDelegator](js-apis-inner-application-abilityDelegator.md#AbilityDelegator)对象。可以用来调度测试框架相关功能。 |
**示例:**
```ts
var abilityDelegator;
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
```
## AbilityDelegatorRegistry.getArguments
getArguments(): AbilityDelegatorArgs
获取单元测试参数AbilityDelegatorArgs对象
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
| 类型 | 说明 |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| [AbilityDelegatorArgs](js-apis-inner-application-abilityDelegatorArgs.md) | [AbilityDelegatorArgs](js-apis-inner-application-abilityDelegatorArgs.md)对象。可以用来获取测试参数。 |
**示例:**
```ts
var args = AbilityDelegatorRegistry.getArguments();
console.info("getArguments bundleName:" + args.bundleName);
console.info("getArguments testCaseNames:" + args.testCaseNames);
console.info("getArguments testRunnerClassName:" + args.testRunnerClassName);
```
......@@ -10,7 +10,7 @@ AbilityLifecycleCallback模块提供应用上下文ApplicationContext的生命
## 导入模块
```js
```ts
import AbilityLifecycleCallback from "@ohos.app.ability.AbilityLifecycleCallback";
```
......@@ -156,7 +156,7 @@ onAbilityContinue(ability: UIAbility): void;
**示例:**
```js
```ts
import UIAbility from "@ohos.app.ability.UIAbility";
export default class MyAbility extends UIAbility {
......
......@@ -9,7 +9,7 @@ AbilityManager模块提供对Ability相关信息和状态信息进行获取、
## 导入模块
```js
```ts
import AbilityManager from '@ohos.app.ability.abilityManager'
```
......@@ -48,7 +48,7 @@ updateConfiguration(config: Configuration, callback: AsyncCallback\<void>): void
**示例**
```js
```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
var config = {
......@@ -89,7 +89,7 @@ updateConfiguration(config: Configuration): Promise\<void>
**示例**
```js
```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
var config = {
......@@ -126,7 +126,7 @@ getAbilityRunningInfos(callback: AsyncCallback\<Array\<AbilityRunningInfo>>): vo
**示例**
```js
```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
try {
......@@ -157,7 +157,7 @@ getAbilityRunningInfos(): Promise\<Array\<AbilityRunningInfo>>
**示例**
```js
```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
try {
......@@ -191,7 +191,7 @@ getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\<Array\<Ext
**示例**
```js
```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
var upperLimit = 0;
......@@ -230,7 +230,7 @@ getExtensionRunningInfos(upperLimit: number): Promise\<Array\<ExtensionRunningIn
**示例**
```js
```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
var upperLimit = 0;
......@@ -263,7 +263,7 @@ getTopAbility(callback: AsyncCallback\<ElementName>): void;
**示例**
```js
```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
try {
......@@ -292,7 +292,7 @@ getTopAbility(): Promise\<ElementName>;
**示例**
```js
```ts
import abilitymanager from '@ohos.app.ability.abilityManager';
try {
......
......@@ -17,7 +17,7 @@ import Configuration from '@ohos.app.ability.Configuration'
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| language | string | 是 | 是 | 表示应用程序的当前语言。 |
| colorMode | [ColorMode](js-apis-app-ability-configurationconstant.md#configurationconstantcolormode) | 是 | 是 | 表示深浅色模式,取值范围:浅色模式(COLOR_MODE_LIGHT),深色模式(COLOR_MODE_DARK)。默认为浅色。 |
| colorMode | [ColorMode](js-apis-app-ability-configurationConstant.md#configurationconstantcolormode) | 是 | 是 | 表示深浅色模式,取值范围:浅色模式(COLOR_MODE_LIGHT),深色模式(COLOR_MODE_DARK)。默认为浅色。 |
| direction | Direction | 是 | 否 | 表示屏幕方向,取值范围:水平方向(DIRECTION_HORIZONTAL),垂直方向(DIRECTION_VERTICAL)。 |
| screenDensity | ScreenDensity | 是 | 否 | 表示屏幕分辨率,取值范围:SCREEN_DENSITY_SDPI(120)、SCREEN_DENSITY_MDPI(160)、SCREEN_DENSITY_LDPI(240)、SCREEN_DENSITY_XLDPI(320)、SCREEN_DENSITY_XXLDPI(480)、SCREEN_DENSITY_XXXLDPI(640)。 |
| displayId | number | 是 | 否 | 表示应用所在的物理屏幕Id。 |
......
......@@ -9,15 +9,16 @@ StartOptions模块对系统的基本通信组件进行查询和设置的能力
## 导入模块
```
```ts
import StartOptions from '@ohos.app.ability.StartOptions';
```
## 属性
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| [windowMode](js-apis-window.md#windowmodesup7sup) | number | 否 | 窗口模式。 |
| [windowMode](js-apis-application-abilityConstant.md#abilityconstantwindowmode) | number | 否 | 窗口模式。 |
| displayId | number | 否 | 显示ID。 |
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册