未验证 提交 55eea9bc 编写于 作者: O openharmony_ci 提交者: Gitee

!15391 翻译完成:14354+14786 3.2 Beta5 RN + website+readme更新

Merge pull request !15391 from wusongqing/TR14354
......@@ -18,7 +18,7 @@ This repository stores device and application development documents provided by
- master: the latest version.
- OpenHarmony 3.2 Beta3. [Learn more](en/release-notes/OpenHarmony-v3.2-beta3.md)
- OpenHarmony 3.2 Beta5. [Learn more](en/release-notes/OpenHarmony-v3.2-beta5.md)
- OpenHarmony 3.1 Release. [Learn more](en/release-notes/OpenHarmony-v3.1-release.md)
......@@ -34,7 +34,7 @@ This repository stores device and application development documents provided by
### Historical Stable Versions
OpenHarmony_v1.x_release: OpenHarmony v1.1.5 LTS. [Learn more](en/release-notes/OpenHarmony-v1.1.5-LTS.md)
OpenHarmony_v1.x_release: OpenHarmony 1.1.5 LTS. [Learn more](en/release-notes/OpenHarmony-v1.1.5-LTS.md)
[More versions](en/release-notes/)
......@@ -51,6 +51,6 @@ You can evaluate available documents, make simple modifications, provide feedbac
Excellent contributors will be awarded and the contributions will be publicized in the developer community.
- Mail list: docs@openharmony.io
- Mailing list: docs@openharmony.io
- Zulip group: documentation_sig
\ No newline at end of file
......@@ -4,9 +4,7 @@
- [USB Service Overview](usb-overview.md)
- [USB Service Development](usb-guidelines.md)
- Location
- [Location Overview](device-location-overview.md)
- [Obtaining Device Location Information](device-location-info.md)
- [Geocoding and Reverse Geocoding Capabilities](device-location-geocoding.md)
- [Location Service Development](location-guidelines.md)
- Sensor
- [Sensor Overview](sensor-overview.md)
- [Sensor Development](sensor-guidelines.md)
......
# Geocoding and Reverse Geocoding Capabilities
## When to Use
Describing a location using coordinates is accurate, but neither intuitive nor user-friendly. With the geocoding and reverse geocoding capabilities, you will be able to convert geographic description into specific coordinates and vice versa.
The geographic description helps users understand a location easily by providing several key attributes, for example, country, administrative region, street, house number, and address.
## Available APIs
The following table describes APIs available for mutual conversion between coordinates and location information.
**Table1** APIs for geocoding and reverse geocoding
| API | Description |
| -------- | -------- |
| isGeoServiceAvailable(callback: AsyncCallback<boolean>) : void | Checks whether the (reverse) geocoding service is available. This function uses an asynchronous callback to return the result. |
| isGeoServiceAvailable() : Promise<boolean> | Checks whether the (reverse) geocoding service is available. This function uses a promise to return the result. |
| getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>) : void | Converts coordinates into geographic description through reverse geocoding. This function uses an asynchronous callback to return the result. |
| getAddressesFromLocation(request: ReverseGeoCodeRequest) : Promise<Array<GeoAddress>>; | Converts coordinates into geographic description through reverse geocoding. This function uses a promise to return the result. |
| getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>) : void | Converts geographic description into coordinates through geocoding. This function uses an asynchronous callback to return the result. |
| getAddressesFromLocationName(request: GeoCodeRequest) : Promise<Array<GeoAddress>> | Converts geographic description into coordinates through geocoding. This function uses a promise to return the result. |
## How to Develop
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> The **GeoConvert** instance needs to access backend services to obtain information. Therefore, before performing the following steps, ensure that your device is connected to the network.
1. Import the **geolocation** module by which you can implement all APIs related to the geocoding and reverse geocoding conversion capabilities.
```
import geolocation from '@ohos.geolocation';
```
2. Query whether geocoder service is available.
- Call **isGeoServiceAvailable** to query whether the geocoder service is available. If the service is available, continue with step 3.
```
geolocation.isGeoServiceAvailable((err, data) => {
if (err) {
console.log('isGeoServiceAvailable err: ' + JSON.stringify(err));
} else {
console.log('isGeoServiceAvailable data: ' + JSON.stringify(data));
}
});
```
3. Obtain the conversion result.
- Call **getAddressesFromLocation** to convert coordinates into geographical location information.
```
var reverseGeocodeRequest = {"latitude": 31.12, "longitude": 121.11, "maxItems": 1};
geolocation.getAddressesFromLocation(reverseGeocodeRequest, (err, data) => {
if (err) {
console.log('getAddressesFromLocation err: ' + JSON.stringify(err));
} else {
console.log('getAddressesFromLocation data: ' + JSON.stringify(data));
}
});
```
Your application can obtain the **GeoAddress** list that matches the specified coordinates and then read location information from it. For details, see [Geolocation](../reference/apis/js-apis-geolocation.md).
- Call **getAddressesFromLocationName** to convert geographic description into coordinates.
```
var geocodeRequest = {"description": "No. xx, xx Road, Pudong District, Shanghai", "maxItems": 1};
geolocation.getAddressesFromLocationName(geocodeRequest, (err, data) => {
if (err) {
console.log('getAddressesFromLocationName err: ' + JSON.stringify(err));
} else {
console.log('getAddressesFromLocationName data: ' + JSON.stringify(data));
}
});
```
Your application can obtain the **GeoAddress** list that matches the specified location information and read coordinates from it. For details, see [Geolocation](../reference/apis/js-apis-geolocation.md).
To improve the accuracy of location results, you can set the longitude and latitude ranges in **GeoCodeRequest**.
# Obtaining Device Location Information
## When to Use
You can call location-related APIs in OpenHarmony to obtain the real-time location or last known location of a mobile device.
Real-time location of the device is recommended for location-sensitive services. If you want to lower power consumption when the real-time location of the device is not needed, you may consider obtaining the last known location of the device.
## Available APIs
The following table describes APIs available for obtaining device location information.
**Table 1** APIs for obtaining device location information
| API | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>) : void | Registers a listener for location changes with a location request initiated. |
| off(type: 'locationChange', callback?: Callback<Location>) : void | Unregisters the listener for location changes with the corresponding location request deleted. |
| on(type: 'locationServiceState', callback: Callback<boolean>) : void | Registers a listener for location service status change events. |
| off(type: 'locationServiceState', callback: Callback<boolean>) : void | Unregisters the listener for location service status change events. |
| on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>) : void; | Registers a listener for cached GNSS location reports. |
| off(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>) : void; | Unregisters the listener for cached GNSS location reports. |
| on(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>) : void; | Registers a listener for satellite status change events. |
| off(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>) : void; | Unregisters the listener for satellite status change events. |
| on(type: 'nmeaMessageChange', callback: Callback<string>) : void; | Registers a listener for GNSS NMEA message change events. |
| off(type: 'nmeaMessageChange', callback?: Callback<string>) : void; | Unregisters the listener for GNSS NMEA message change events. |
| on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Registers a listener for status change events of the specified geofence. |
| off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Unregisters the listener for status change events of the specified geofence. |
| getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>) : void | Obtains the current location. This API uses an asynchronous callback to return the result. |
| getCurrentLocation(request?: CurrentLocationRequest) : Promise<Location> | Obtains the current location. This API uses a promise to return the result. |
| getLastLocation(callback: AsyncCallback<Location>) : void | Obtains the previous location. This API uses an asynchronous callback to return the result. |
| getLastLocation() : Promise<Location> | Obtains the previous location. This API uses a promise to return the result. |
| isLocationEnabled(callback: AsyncCallback<boolean>) : void | Checks whether the location service is enabled. This API uses an asynchronous callback to return the result. |
| isLocationEnabled() : Promise<boolean> | Checks whether the location service is enabled. This API uses a promise to return the result. |
| requestEnableLocation(callback: AsyncCallback<boolean>) : void | Requests to enable the location service. This API uses an asynchronous callback to return the result. |
| requestEnableLocation() : Promise<boolean> | Requests to enable the location service. This API uses a promise to return the result. |
| enableLocation(callback: AsyncCallback<boolean>) : void | Enables the location service. This API uses an asynchronous callback to return the result. |
| enableLocation() : Promise<boolean> | Enables the location service. This API uses a promise to return the result. |
| disableLocation(callback: AsyncCallback<boolean>) : void | Disables the location service. This API uses an asynchronous callback to return the result. |
| disableLocation() : Promise<boolean> | Disables the location service. This API uses a promise to return the result. |
| getCachedGnssLocationsSize(callback: AsyncCallback<number>) : void; | Obtains the number of cached GNSS locations. This API uses an asynchronous callback to return the result. |
| getCachedGnssLocationsSize() : Promise<number>; | Obtains the number of cached GNSS locations. This API uses a promise to return the result. |
| flushCachedGnssLocations(callback: AsyncCallback<boolean>) : void; | Obtains all cached GNSS locations and clears the GNSS cache queue. This API uses an asynchronous callback to return the result.|
| flushCachedGnssLocations() : Promise<boolean>; | Obtains all cached GNSS locations and clears the GNSS cache queue. This API uses a promise to return the result.|
| sendCommand(command: LocationCommand, callback: AsyncCallback<boolean>) : void; | Sends extended commands to the location subsystem. This API uses an asynchronous callback to return the result.|
| sendCommand(command: LocationCommand) : Promise<boolean>; | Sends extended commands to the location subsystem. This API uses a promise to return the result. |
| isLocationPrivacyConfirmed(type : LocationPrivacyType, callback: AsyncCallback<boolean>) : void; | Checks whether a user agrees with the privacy statement of the location service. This API uses an asynchronous callback to return the result.|
| isLocationPrivacyConfirmed(type : LocationPrivacyType,) : Promise<boolean>; | Checks whether a user agrees with the privacy statement of the location service. This API uses a promise to return the result.|
| setLocationPrivacyConfirmStatus(type : LocationPrivacyType, isConfirmed : boolean, callback: AsyncCallback<boolean>) : void; | Sets the user confirmation status for the privacy statement of the location service. This API uses an asynchronous callback to return the result.|
| setLocationPrivacyConfirmStatus(type : LocationPrivacyType, isConfirmed : boolean) : Promise<boolean>; | Sets the user confirmation status for the privacy statement of the location service. This API uses a promise to return the result.|
## How to Develop
To learn more about the APIs for obtaining device location information, see [Geolocation](../reference/apis/js-apis-geolocation.md).
1. Before using basic location capabilities, check whether your application has been granted the permission to access the device location information. If not, your application needs to obtain the permission from the user as described below.
The system provides the following location permissions:
- ohos.permission.LOCATION
- ohos.permission.LOCATION_IN_BACKGROUND
The **ohos.permission.LOCATION** permission is a must if your application needs to access the device location information.
If your application needs to access the device location information when running on the background, it must be configured to be able to run on the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background.
You can declare the required permission in your application's configuration file. For details, see [Access Control (Permission) Development](../security/accesstoken-guidelines.md).
2. Import the **geolocation** module by which you can implement all APIs related to the basic location capabilities.
```
import geolocation from '@ohos.geolocation';
```
3. Instantiate the **LocationRequest** object. This object provides APIs to notify the system of the location service type and the interval of reporting location information.<br>
**Method 1:**
To better serve your needs for using APIs, the system has categorized APIs into different packages to match your common use cases of the location function. In this way, you can directly use the APIs specific to a certain use case, making application development much easier. The following table lists the use cases currently supported.
```
export enum LocationRequestScenario {
UNSET = 0x300,
NAVIGATION,
TRAJECTORY_TRACKING,
CAR_HAILING,
DAILY_LIFE_SERVICE,
NO_POWER,
}
```
**Table 2** Common use cases of the location function
| Use Case | Constant | Description |
| ------------ | ------------------- | ------------------------------------------------------------ |
| Navigation | NAVIGATION | Applicable when your application needs to obtain the real-time location of a mobile device outdoors, such as navigation for driving or walking. In this scenario, the GNSS positioning technology is mainly used to ensure the location accuracy. However, due to its limitations, the technology may be unable to provide the location service when navigation is just started or when the user moves into a shielded environment such as indoors or a garage. To resolve this issue, the system uses the network positioning technology as an alternative to provide the location service for your application until the GNSS can provide stable location results. This helps achieve a smooth navigation experience for users.<br>By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
| Trajectory tracking| TRAJECTORY_TRACKING | Applicable when your application needs to record user trajectories, for example, the track recording function of sports applications. In this scenario, the GNSS positioning technology is mainly used to ensure the location accuracy.<br>By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
| Ride hailing| CAR_HAILING | Applicable when your application needs to obtain the current location of a user who is hailing a taxi.<br>By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
| Life service| DAILY_LIFE_SERVICE | Applicable when your application only needs the approximate user location for recommendations and push notifications in scenarios such as when the user is browsing news, shopping online, and ordering food.<br>By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
| Power efficiency | NO_POWER | Applicable when your application does not proactively start the location service for a higher battery efficiency. When responding to another application requesting the same location service, the system marks a copy of the location result to your application. In this way, your application will not consume extra power for obtaining the user location.<br>By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
Sample code for initializing **requestInfo** for navigation:
```
var requestInfo = {'scenario': geolocation.LocationRequestScenario.NAVIGATION, 'timeInterval': 0, 'distanceInterval': 0, 'maxAccuracy': 0};
```
**Method 2:**
If the predefined use cases do not meet your needs, you can also use the basic location priority policies provided by the system.
```
export enum LocationRequestPriority {
UNSET = 0x200,
ACCURACY,
LOW_POWER,
FIRST_FIX,
}
```
**Table 3** Location priority policies
| Policy | Constant | Description |
| ------------------ | -------------- | ------------------------------------------------------------ |
| Location accuracy priority | ACCURACY | This policy mainly uses the GNSS positioning technology. In an open area, the technology can achieve the meter-level location accuracy, depending on the hardware performance of the device. However, in a shielded environment, the location accuracy may significantly decrease.<br>To use this policy, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
| Fast location priority | FAST_FIRST_FIX | This policy uses the GNSS positioning, base station positioning, WLAN positioning, and Bluetooth positioning technologies simultaneously to obtain the device location in both the indoor and outdoor scenarios. When all positioning technologies provide a location result, the system provides the most accurate location result for your application. This policy can lead to significant hardware resource consumption and power consumption.<br>To use this policy, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.|
| Power efficiency priority| LOW_POWER | This policy mainly uses the base station positioning, WLAN positioning, and Bluetooth positioning technologies to obtain device location in both indoor and outdoor scenarios. The location accuracy depends on the distribution of surrounding base stations, visible WLANs, and Bluetooth devices and therefore may fluctuate greatly. This policy is recommended and can reduce power consumption when your application does not require high location accuracy or when base stations, visible WLANs, and Bluetooth devices are densely distributed.<br>To use this policy, you must declare at least the **ohos.permission.LOCATION** permission and obtain users' authorization.|
Sample code for initializing **requestInfo** for the location accuracy priority policy:
```
var requestInfo = {'priority': geolocation.LocationRequestPriority.ACCURACY, 'timeInterval': 0, 'distanceInterval': 0, 'maxAccuracy': 0};
```
4. Instantiate the **Callback** object for the system to report location results.
Your application needs to implement the callback defined by the system. When the system successfully obtains the real-time location of a device, it will report the location result to your application through the callback interface. Your application can implement the callback interface in such a way to complete your own service logic.
```
var locationChange = (location) => {
console.log('locationChanger: data: ' + JSON.stringify(location));
};
```
5. Start device location.
```
geolocation.on('locationChange', requestInfo, locationChange);
```
6. (Optional) Stop device location.
```
geolocation.off('locationChange', locationChange);
```
If your application does not need the real-time device location, it can use the last known device location cached in the system instead.
```
geolocation.getLastLocation((err, data) => {
if (err) {
console.log('getLastLocation: err: ' + JSON.stringify(err));
} else {
console.log('getLastLocation: data: ' + JSON.stringify(data));
}
});
```
To call this method, your application needs to request the **ohos.permission.LOCATION** permission from the user.
# Location Overview
People take their mobile devices wherever they go. Mobile devices have become a necessity in people's daily routines, whether it be for looking at the weather forecast, browsing news, hailing a taxi, navigating, or recording data from a workout. All these activities are so much associated with the location services on mobile devices.
With the location awareness capability offered by , mobile devices will be able to obtain real-time, accurate location data. Building location awareness into your application can also lead to a better contextual experience for application users.
Your application can call location-specific APIs to obtain the location information of a mobile device for offering location-based services such as drive navigation and motion track recording.
## Basic Concepts
Location awareness helps determine where a mobile device locates. The system identifies the location of a mobile device with its coordinates, and uses location technologies such as Global Navigation Satellite System (GNSS) and network positioning (for example, base station positioning or WLAN/Bluetooth positioning) to provide diverse location-based services. These advanced location technologies make it possible to obtain the accurate location of the mobile device, regardless of whether it is indoors or outdoors.
- **Coordinate**
A coordinate describes a location on the earth using the longitude and latitude in reference to the World Geodetic Coordinate System 1984.
- **GNSS positioning**
GNSS positioning locates a mobile device by using the location algorithm offered by the device chip to compute the location information provided by the Global Navigation Satellite System, for example, GPS, GLONASS, BeiDou, and Galileo. Whichever positioning system will be used during the location process depends on a hardware capability of the device.
- **Base station positioning**
Base station positioning estimates the current location of a mobile device based on the location of the resident base station in reference to the neighboring base stations. This technology provides only a low accuracy and requires access to the cellular network.
- **WLAN or Bluetooth positioning**
WLAN or Bluetooth positioning estimates the current location of a mobile device based on the locations of WLANs and Bluetooth devices that can be discovered by the device. The location accuracy of this technology depends on the distribution of fixed WLAN access points (APs) and Bluetooth devices around the device. A high density of WLAN APs and Bluetooth devices can produce a more accurate location result than base station positioning. This technology also requires access to the network.
## Working Principles
Location awareness is offered by the system as a basic service for applications. Depending on the service scenario, an application needs to initiate a location request to the system and stop the location request when the service scenario ends. In this process, the system reports the location information to the application on a real-time basis.
## Limitations and Constraints
Your application can use the location function only after the user has granted the permission and turned on the function. If the location function is off, the system will not provide the location service for any application.
Since the location information is considered sensitive, your application still needs to obtain the location access permission from the user even if the user has turned on the location function. The system will provide the location service for your application only after it has been granted the permission to access the device location information.
## Samples
The following sample is provided to help you better understand how to develop location services:
-[`Location`: Location (eTS) (API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/device/Location)
# Location Service Development
## Overview
People take their mobile devices wherever they go. Mobile devices have become a necessity in people's daily routines, whether it be for looking at the weather forecast, browsing news, hailing a taxi, navigating, or recording data from a workout. All these activities are so much associated with the location services on mobile devices.
With the location awareness capability offered by OpenHarmony, mobile devices will be able to obtain real-time, accurate location data. Building location awareness into your application can also lead to a better contextual experience for application users.
Your application can call location-specific APIs to obtain the location information of a mobile device for offering location-based services such as drive navigation and motion track recording.
### Service Introduction
Location awareness helps determine where a mobile device locates. The location subsystem identifies the location of a mobile device with its coordinates, and uses location technologies such as Global Navigation Satellite System (GNSS) and network positioning (for example, base station positioning or WLAN/Bluetooth positioning) to provide diverse location-based services.
These advanced location technologies make it possible to obtain the accurate location of the mobile device, regardless of whether it is indoors or outdoors.
- **Coordinate**
A coordinate describes a location on the earth using the longitude and latitude in reference to the World Geodetic Coordinate System 1984.
- **GNSS positioning**
GNSS positioning locates a mobile device by using the location algorithm offered by the device chip to compute the location information provided by the Global Navigation Satellite System, for example, GPS, GLONASS, BeiDou, and Galileo. Whichever positioning system will be used during the location process depends on a hardware capability of the device.
- **Base station positioning**
Base station positioning estimates the current location of a mobile device based on the location of the resident base station in reference to the neighboring base stations. This technology provides only a low accuracy and requires access to the cellular network.
- **WLAN or Bluetooth positioning**
WLAN or Bluetooth positioning estimates the current location of a mobile device based on the locations of WLANs and Bluetooth devices that can be discovered by the device. The location accuracy of this technology depends on the distribution of fixed WLAN access points (APs) and Bluetooth devices around the device. A high density of WLAN APs and Bluetooth devices can produce a more accurate location result than base station positioning. This technology also requires access to the network.
### Working Principles
Location awareness is offered by the system as a basic service for applications. Depending on the service scenario, an application needs to initiate a location request to the system and stop the location request when the service scenario ends. In this process, the system reports the location information to the application on a real-time basis.
### Constraints
Your application can use the location function only after the user has granted the required permission and turned on the location function. If the location function is off, the system will not provide the location service for any application.
Since the location information is considered sensitive, your application still needs to obtain the location access permission from the user even if the user has turned on the location function. The system will provide the location service for your application only after it has been granted the permission to access the device location information.
## Applying for Location Permissions
### When to Use
Before using system basic location capabilities, check whether your application has been granted the permission to access the device location information. If not, your application needs to obtain the permission from the user.
The system provides the following location permissions:
- ohos.permission.LOCATION: used to obtain location accurate to meters.
- ohos.permission.APPROXIMATELY\_LOCATION: used to obtain location accurate to 5 kilometers.
- ohos.permission.LOCATION\_IN\_BACKGROUND: used to obtain location while the application is running at the background.
If your application needs to access the device location information, it must first apply for required permissions.
**Table 1** Ways to apply for location permissions
| Target API Level| Location Permission| Permission Application Result| Location Accuracy|
| -------- | -------- | -------- | -------- |
| Earlier than 9| ohos.permission.LOCATION | Successful| Location accurate to meters.|
| 9 and later| ohos.permission.LOCATION | Failed| No location obtained.|
| 9 and later| ohos.permission.APPROXIMATELY_LOCATION | Successful| Location accurate to 5 kilometers.|
| 9 and later| ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.LOCATION| Successful| Location accurate to meters.|
If your application needs to access the device location information when running in the background, it must be configured to be able to run in the background and be granted the **ohos.permission.LOCATION_IN_BACKGROUND** permission. In this way, the system continues to report device location information after your application moves to the background.
You can declare the required permission in your application's configuration file. For details, see [Access Control (Permission) Development](../security/accesstoken-guidelines.md).
For details about the permissions required for each API of the location service, see [Geolocation Manager](../reference/apis/js-apis-geoLocationManager.md).
### How to Develop
You can declare the required permission in your application's configuration file. For details, see [Access Control (Permission) Development](../security/accesstoken-guidelines.md).
## Obtaining Device Location Information
### When to Use
You can call location-related APIs in OpenHarmony to obtain the real-time location or last known location of a mobile device.
Real-time location of the device is recommended for location-sensitive services. If you want to lower power consumption when the real-time location of the device is not needed, you may consider obtaining the last known location of the device.
### Available APIs
The following table lists the APIs used to obtain the device location information. For details, see [Geolocation Manager](../reference/apis/js-apis-geoLocationManager.md).
**Table 2** APIs for obtaining device location information
| API| Description|
| -------- | -------- |
| on(type: 'locationChange', request: LocationRequest, callback: Callback&lt;Location&gt;): void | Registers a listener for location changes with a location request initiated.|
| off(type: 'locationChange', callback?: Callback&lt;Location&gt;): void | Unregisters the listener for location changes with the corresponding location request deleted.|
| getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback&lt;Location&gt;): void | Obtains the current location. This API uses an asynchronous callback to return the result. |
| getCurrentLocation(request?: CurrentLocationRequest): Promise&lt;Location&gt; | Obtains the current location. This API uses a promise to return the result. |
| getLastLocation(): Location | Obtains the last known device location.|
### How to Develop
1. Before using basic location capabilities, check whether your application has been granted the permission to access device location information. If not, your application first needs to apply for the required permission. For details, see [Applying for Location Permissions](#applying-for-location-permissions).
2. Import the **geoLocationManager** module by which you can implement all APIs related to the basic location capabilities.
```ts
import geoLocationManager from '@ohos.geoLocationManager';
```
3. Instantiate the **LocationRequest** object. This object provides APIs to notify the system of the location service type and the interval of reporting location information.<br>
**Method 1:**
To better serve your needs for using APIs, the system has categorized APIs into different packages to match your common use cases of the location function. In this way, you can directly use the APIs specific to a certain use case, making application development much easier. The location service scenarios currently supported are described as follows.
**Location service scenarios**
- NAVIGATION<br>
Applicable when your application needs to obtain the real-time location of a mobile device outdoors, such as navigation for driving or walking. <br>In this scenario, the GNSS positioning technology is mainly used to ensure the location accuracy. However, due to its limitations, the technology may be unable to provide the location service when navigation is just started or when the user moves into a shielded environment such as indoors or a garage. <br>To resolve this issue, the system uses the network positioning technology as an alternative to provide the location service for your application until the GNSS can provide stable location results. This helps achieve a smooth navigation experience for users. <br>By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.
- TRAJECTORY\_TRACKING<br>
Applicable when your application needs to record user trajectories, for example, the track recording function of sports applications. In this scenario, the GNSS positioning technology is mainly used to ensure the location accuracy. <br>By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.
- CAR\_HAILING<br>
Applicable when your application needs to obtain the current location of a user who is hailing a taxi. <br>By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.
- DAILY\_LIFE\_SERVICE<br>
Applicable when your application only needs the approximate user location for recommendations and push notifications in scenarios such as when the user is browsing news, shopping online, and ordering food. <br>By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.
- NO\_POWER<br>
Applicable when your application does not proactively start the location service for a higher battery efficiency. When responding to another application requesting the same location service, the system marks a copy of the location result to your application. In this way, your application will not consume extra power for obtaining the user location. <br>By default, the system reports location results at a minimal interval of 1s. To adopt this use case, you must declare the **ohos.permission.LOCATION** permission and obtain users' authorization.
```ts
export enum LocationRequestScenario {
UNSET = 0x300,
NAVIGATION,
TRAJECTORY_TRACKING,
CAR_HAILING,
DAILY_LIFE_SERVICE,
NO_POWER,
}
```
Sample code for initializing **requestInfo** for navigation:
```ts
let requestInfo = {'scenario': geoLocationManager.LocationRequestScenario.NAVIGATION, 'timeInterval': 0, 'distanceInterval': 0, 'maxAccuracy': 0};
```
**Method 2:**
If the predefined use cases do not meet your needs, you can also use the basic location priority policies provided by the system.
**Location priority policies**
- ACCURACY<br>
This policy mainly uses the GNSS positioning technology. In an open area, the technology can achieve the meter-level location accuracy, depending on the hardware performance of the device. However, in a shielded environment, the location accuracy may significantly decrease.
- FIRST\_FIX<br>
This policy uses the GNSS positioning, base station positioning, WLAN positioning, and Bluetooth positioning technologies simultaneously to obtain the device location in both the indoor and outdoor scenarios. When all positioning technologies provide a location result, the system provides the most accurate location result for your application. This policy can lead to significant hardware resource consumption and power consumption.
- LOW\_POWER<br>
This policy mainly uses the base station positioning, WLAN positioning, and Bluetooth positioning technologies to obtain device location in both indoor and outdoor scenarios. The location accuracy depends on the distribution of surrounding base stations, visible WLANs, and Bluetooth devices and therefore may fluctuate greatly. This policy is recommended and can reduce power consumption when your application does not require high location accuracy or when base stations, visible WLANs, and Bluetooth devices are densely distributed.
```ts
export enum LocationRequestPriority {
UNSET = 0x200,
ACCURACY,
LOW_POWER,
FIRST_FIX,
}
```
Sample code for initializing **requestInfo** for the location accuracy priority policy:
```ts
let requestInfo = {'priority': geoLocationManager.LocationRequestPriority.ACCURACY, 'timeInterval': 0, 'distanceInterval': 0, 'maxAccuracy': 0};
```
4. Instantiate the **Callback** object for the system to report location results.
Your application needs to implement the callback defined by the system. When the system successfully obtains the real-time location of a device, it will report the location result to your application through the callback interface. Your application can implement the callback interface in such a way to complete your own service logic.
```ts
let locationChange = (location) => {
console.log('locationChanger: data: ' + JSON.stringify(location));
};
```
5. Start obtaining the device location.
```ts
geoLocationManager.on('locationChange', requestInfo, locationChange);
```
6. (Optional) Stop obtaining the device location.
If your application no longer needs the device location, stop obtaining the device location to avoid high power consumption.
```ts
geoLocationManager.off('locationChange', locationChange);
```
If your application does not need the real-time device location, it can use the last known device location cached in the system instead.
```ts
import geoLocationManager from '@ohos.geoLocationManager';
try {
let location = geoLocationManager.getLastLocation();
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
## Geocoding and Reverse Geocoding
### When to Use
Describing a location using coordinates is accurate, but neither intuitive nor user-friendly. To address this issue, the system provides your application the geocoding and reverse geocoding capabilities:
- Geocoding: converts geographic descriptions into specific coordinates.
- Reverse geocoding: converts coordinates into geographic descriptions.
The geocoding information describes a location using several attributes, including the country, administrative region, street, house number, and address, etc.
### Available APIs
The following table lists the APIs used for mutual conversion between coordinates and geographic descriptions. For details, see [Geolocation Manager](../reference/apis/js-apis-geoLocationManager.md).
**Table 3** APIs for geocoding and reverse geocoding conversion
| API| Description|
| -------- | -------- |
| isGeocoderAvailable(): boolean; | Obtains the (reverse) geocoding service status.|
| getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback&lt;Array&lt;GeoAddress&gt;&gt;): void | Converts coordinates into geographic descriptions through reverse geocoding. This API uses an asynchronous callback to return the result. |
| getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise&lt;Array&lt;GeoAddress&gt;&gt; | Converts coordinates into geographic descriptions through reverse geocoding. This API uses a promise to return the result. |
| getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback&lt;Array&lt;GeoAddress&gt;&gt;): void | Converts geographic descriptions into coordinates through geocoding. This API uses an asynchronous callback to return the result. |
| getAddressesFromLocationName(request: GeoCodeRequest): Promise&lt;Array&lt;GeoAddress&gt;&gt; | Converts geographic descriptions into coordinates through geocoding. This API uses a promise to return the result. |
### How to Develop
> **NOTE**
> The **GeoConvert** instance needs to access backend services to obtain information. Therefore, before performing the following steps, ensure that your device is connected to the network.
1. Import the **geoLocationManager** module by which you can implement all APIs related to the geocoding and reverse geocoding conversion capabilities.
```ts
import geoLocationManager from '@ohos.geoLocationManager';
```
2. Check whether the **geoCoder** service is available.
- Call **isGeoServiceAvailable** to check whether the **geoCoder** service is available. If the service is available, go to step 3.
```ts
import geoLocationManager from '@ohos.geoLocationManager';
try {
let isAvailable = geoLocationManager.isGeocoderAvailable();
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
3. Obtain the geocoding conversion result.
- Call **getAddressesFromLocation** to convert coordinates into geographical location information.
```ts
let reverseGeocodeRequest = {"latitude": 31.12, "longitude": 121.11, "maxItems": 1};
try {
geoLocationManager.getAddressesFromLocation(reverseGeocodeRequest, (err, data) => {
if (err) {
console.log('getAddressesFromLocation err: ' + JSON.stringify(err));
} else {
console.log('getAddressesFromLocation data: ' + JSON.stringify(data));
}
});
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
The application can access the **GeoAddress** list that matches the specified coordinates for the corresponding geographic descriptions. For details, see [Geolocation Manager](../reference/apis/js-apis-geoLocationManager.md).
- Call **getAddressesFromLocationName** to convert geographic descriptions into coordinates.
```ts
let geocodeRequest = {"description": "No. xx, xx Road, Pudong District, Shanghai", "maxItems": 1};
try {
geoLocationManager.getAddressesFromLocationName(geocodeRequest, (err, data) => {
if (err) {
console.log('getAddressesFromLocationName err: ' + JSON.stringify(err));
} else {
console.log('getAddressesFromLocationName data: ' + JSON.stringify(data));
}
});
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
```
The application can access the **GeoAddress** list that matches the specified geographic descriptions for the corresponding coordinates. For details, see [Geolocation Manager](../reference/apis/js-apis-geoLocationManager.md).
To improve the accuracy of location results, you can set the longitude and latitude ranges in **GeoCodeRequest**.
## Geofencing
### When to Use
A geofence is a group of virtual bounds defining an area on the map. When a user device enters or leaves a geofence, or stays in a geofence, your app on the user device can automatically receive notifications and alarms.
Currently, only circular geofences are supported, and the geofencing function of the GNSS chip is required.
A typical application of geofencing is to create a geofence around an enterprise for targeted advertising. In different areas, you can provide differentiated promotions for mobile devices.
### Available APIs
The following table lists the APIs used for geofencing. For details, see [Geolocation Manager](../reference/apis/js-apis-geoLocationManager.md).
**Table 4** Geofencing APIs
| API| Description|
| -------- | -------- |
| on(type: 'gnssFenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Registers a listener for status change events of the specified geofence.|
| off(type: 'gnssFenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | Unregisters the listener for status change events of the specified geofence.|
### How to Develop
1. Declare the **ohos.permission.APPROXIMATELY_LOCATION** permission. For details, see [Applying for Location Permissions](#applying-for-location-permissions).
2. Import the [geoLocationManager](../reference/apis/js-apis-geoLocationManager.md) and [wantAgent](../reference/apis/js-apis-app-ability-wantAgent.md) modules.
```ts
import geoLocationManager from '@ohos.geoLocationManager';
import wantAgent from '@ohos.app.ability.wantAgent';
```
3. Create a [WantAgentInfo](../reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md) object.
Scenario 1: Create a **WantAgentInfo** object for starting an ability.
```ts
let wantAgentObj = null; // Save the created WantAgent object for completing the trigger operations at a later time.
// Set the operation type through operationType of the WantAgentInfo object.
let wantAgentInfo = {
wants: [
{
deviceId: '',
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility',
action: '',
entities: [],
uri: '',
parameters: {}
}
],
operationType: wantAgent.OperationType.START_ABILITY,
requestCode: 0,
wantAgentFlags:[wantAgent.WantAgentFlags.CONSTANT_FLAG]
};
```
Scenario 2: Create a **WantAgentInfo** object for publishing [common events](../application-models/common-event-overview.md).
```ts
let wantAgentObj = null; // Save the created WantAgent object for completing the trigger operations at a later time.
// Set the operation type through operationType of the WantAgentInfo object.
let wantAgentInfo = {
wants: [
{
action: "event_name", // Set the event name.
parameters: {},
}
],
operationType: wantAgent.OperationType.SEND_COMMON_EVENT,
requestCode: 0,
wantAgentFlags: [wantAgent.WantAgentFlags.CONSTANT_FLAG],
}
```
4. Call [getWantAgent()](../reference/apis/js-apis-app-ability-wantAgent.md#wantagentgetwantagent) to create a **WantAgent** object.
After obtaining the **WantAgent** object, call the geofencing API to add a geofence.
```ts
// Create a WantAgent object.
wantAgent.getWantAgent(wantAgentInfo, (err, data) => {
if (err) {
console.error('getWantAgent err=' + JSON.stringify(err));
return;
}
console.info('getWantAgent success');
wantAgentObj = data;
let requestInfo = {'priority': 0x201, 'scenario': 0x301, "geofence": {"latitude": 121, "longitude": 26, "radius": 100, "expiration": 10000}};
try {
geoLocationManager.on('gnssFenceStatusChange', requestInfo, wantAgentObj);
} catch (err) {
console.error("errCode:" + err.code + ",errMessage:" + err.message);
}
});
```
5. Have the system automatically trigger the action defined for the **WantAgent** object when a device enters or exits the geofence.
# Media
- Audio
- Audio and Video
- [Audio Overview](audio-overview.md)
- [Audio Playback Development](audio-playback.md)
- [Audio Recording Development](audio-recorder.md)
- [Audio Rendering Development](audio-renderer.md)
- [Audio Stream Management Development](audio-stream-manager.md)
- [Audio Capture Development](audio-capturer.md)
......@@ -12,8 +10,10 @@
- [Audio Interruption Mode Development](audio-interruptmode.md)
- [Volume Management Development](audio-volume-manager.md)
- [Audio Routing and Device Management Development](audio-routing-manager.md)
- Video
- [AVPlayer Development (Recommended)](avplayer-playback.md)
- [AVRecorder Development (Recommended)](avrecorder.md)
- [Audio Playback Development](audio-playback.md)
- [Audio Recording Development](audio-recorder.md)
- [Video Playback Development](video-playback.md)
- [Video Recording Development](video-recorder.md)
......
# AbilityContext
The **AbilityContext** module, inherited from **Context**, implements the context for abilities.
This module provides APIs for accessing ability-specific resources. You can use the APIs to start and terminate an ability, obtain the caller interface, and request permissions from users by displaying a dialog box.
> **NOTE**
>
> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module can be used only in the stage model.
## Usage
Before using the **AbilityContext** module, you must define a child class that inherits from **Ability**.
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
let context = undefined;
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
context = this.context;
}
}
```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
| abilityInfo | [AbilityInfo](js-apis-bundleManager-abilityInfo.md) | Yes| No| Ability information.|
| currentHapModuleInfo | [HapModuleInfo](js-apis-bundleManager-hapModuleInfo.md) | Yes| No| Information about the current HAP.|
| config | [Configuration](js-apis-application-configuration.md) | Yes| No| Configuration information.|
## AbilityContext.startAbility
startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void;
Starts an ability. This API uses an asynchronous callback to return the result.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
bundleName: "com.example.myapplication",
abilityName: "MyAbility"
};
try {
this.context.startAbility(want, (error) => {
if (error.code) {
// Process service logic errors.
console.log('startAbility failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('startAbility succeed');
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbility
startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&gt;): void;
Starts an ability with the start options specified. This API uses an asynchronous callback to return the result.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| options | [StartOptions](js-apis-application-startOptions.md) | Yes| Parameters used for starting the ability.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var options = {
windowMode: 0
};
try {
this.context.startAbility(want, options, (error) => {
if (error.code) {
// Process service logic errors.
console.log('startAbility failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('startAbility succeed');
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbility
startAbility(want: Want, options?: StartOptions): Promise&lt;void&gt;;
Starts an ability. This API uses a promise to return the result.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| options | [StartOptions](js-apis-application-startOptions.md) | No| Parameters used for starting the ability.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
bundleName: "com.example.myapplication",
abilityName: "MyAbility"
};
var options = {
windowMode: 0,
};
try {
this.context.startAbility(want, options)
.then((data) => {
// Carry out normal service processing.
console.log('startAbility succeed');
})
.catch((error) => {
// Process service logic errors.
console.log('startAbility failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbilityForResult
startAbilityForResult(want: Want, callback: AsyncCallback&lt;AbilityResult&gt;): void;
Starts an ability. After the ability is started, you can call [terminateSelfWithResult](#abilitycontextterminateselfwithresult) to terminate the ability and return the result to the caller. If an exception occurs, for example, the ability is killed, exception information is returned to the caller. This API uses an asynchronous callback to return the result.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want |[Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| callback | AsyncCallback&lt;[AbilityResult](js-apis-inner-ability-abilityResult.md)&gt; | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
try {
this.context.startAbilityForResult(want, (error, result) => {
if (error.code) {
// Process service logic errors.
console.log('startAbilityForResult failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log("startAbilityForResult succeed, result.resultCode = " +
result.resultCode)
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbilityForResult
startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback&lt;AbilityResult&gt;): void;
Starts an ability with the start options specified. After the ability is started, you can call [terminateSelfWithResult](#abilitycontextterminateselfwithresult) to terminate the ability and return the result to the caller. If an exception occurs, for example, the ability is killed, exception information is returned to the caller. This API uses an asynchronous callback to return the result.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want |[Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| options | [StartOptions](js-apis-application-startOptions.md) | Yes| Parameters used for starting the ability.|
| callback | AsyncCallback&lt;[AbilityResult](js-apis-inner-ability-abilityResult.md)&gt; | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var options = {
windowMode: 0,
};
try {
this.context.startAbilityForResult(want, options, (error, result) => {
if (error.code) {
// Process service logic errors.
console.log('startAbilityForResult failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log("startAbilityForResult succeed, result.resultCode = " +
result.resultCode)
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbilityForResult
startAbilityForResult(want: Want, options?: StartOptions): Promise&lt;AbilityResult&gt;;
Starts an ability. After the ability is started, you can call [terminateSelfWithResult](#abilitycontextterminateselfwithresult) to terminate the ability and return the result to the caller. If an exception occurs, for example, the ability is killed, exception information is returned to the caller. This API uses a promise to return the result.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| options | [StartOptions](js-apis-application-startOptions.md) | No| Parameters used for starting the ability.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;[AbilityResult](js-apis-inner-ability-abilityResult.md)&gt; | Promise used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
bundleName: "com.example.myapplication",
abilityName: "MyAbility"
};
var options = {
windowMode: 0,
};
try {
this.context.startAbilityForResult(want, options)
.then((result) => {
// Carry out normal service processing.
console.log("startAbilityForResult succeed, result.resultCode = " + result.resultCode);
})
.catch((error) => {
// Process service logic errors.
console.log('startAbilityForResult failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbilityForResultWithAccount
startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback\<AbilityResult>): void;
Starts an ability with the account ID specified. This API uses an asynchronous callback to return the result when the ability is terminated.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| callback | AsyncCallback\<[AbilityResult](js-apis-inner-ability-abilityResult.md)\> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
try {
this.context.startAbilityForResultWithAccount(want, accountId, (error, result) => {
if (error.code) {
// Process service logic errors.
console.log('startAbilityForResultWithAccount failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log("startAbilityForResultWithAccount succeed, result.resultCode = " +
result.resultCode)
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbilityForResultWithAccount
startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\<void\>): void;
Starts an ability with the start options and account ID specified. This API uses an asynchronous callback to return the result when the ability is terminated.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| options | [StartOptions](js-apis-application-startOptions.md) | Yes| Parameters used for starting the ability.|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
var options = {
windowMode: 0
};
try {
this.context.startAbilityForResultWithAccount(want, accountId, options, (error, result) => {
if (error.code) {
// Process service logic errors.
console.log('startAbilityForResultWithAccount failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log("startAbilityForResultWithAccount succeed, result.resultCode = " +
result.resultCode)
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbilityForResultWithAccount
startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\<AbilityResult\>;
Starts an ability with the account ID specified. This API uses a promise to return the result when the ability is terminated.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| options | [StartOptions](js-apis-application-startOptions.md) | No| Parameters used for starting the ability.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;[AbilityResult](js-apis-inner-ability-abilityResult.md)&gt; | Promise used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
var options = {
windowMode: 0
};
try {
this.context.startAbilityForResultWithAccount(want, accountId, options)
.then((result) => {
// Carry out normal service processing.
console.log("startAbilityForResultWithAccount succeed, result.resultCode = " +
result.resultCode)
})
.catch((error) => {
// Process service logic errors.
console.log('startAbilityForResultWithAccount failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startServiceExtensionAbility
startServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
Starts a ServiceExtensionAbility. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
try {
this.context.startServiceExtensionAbility(want, (error) => {
if (error.code) {
// Process service logic errors.
console.log('startServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('startServiceExtensionAbility succeed');
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startServiceExtensionAbility
startServiceExtensionAbility(want: Want): Promise\<void>;
Starts a ServiceExtensionAbility. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
try {
this.context.startServiceExtensionAbility(want)
.then((data) => {
// Carry out normal service processing.
console.log('startServiceExtensionAbility succeed');
})
.catch((error) => {
// Process service logic errors.
console.log('startServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startServiceExtensionAbilityWithAccount
startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<void>): void;
Starts a ServiceExtensionAbility with the account ID specified. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
try {
this.context.startServiceExtensionAbilityWithAccount(want, accountId, (error) => {
if (error.code) {
// Process service logic errors.
console.log('startServiceExtensionAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('startServiceExtensionAbilityWithAccount succeed');
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startServiceExtensionAbilityWithAccount
startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<void>;
Starts a ServiceExtensionAbility with the account ID specified. This API uses a promise to return the result.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
try {
this.context.startServiceExtensionAbilityWithAccount(want, accountId)
.then((data) => {
// Carry out normal service processing.
console.log('startServiceExtensionAbilityWithAccount succeed');
})
.catch((error) => {
// Process service logic errors.
console.log('startServiceExtensionAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.stopServiceExtensionAbility
stopServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
Stops a ServiceExtensionAbility in the same application. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
try {
this.context.startAbility(want, (error) => {
if (error.code != 0) {
console.log("start ability fail, err: " + JSON.stringify(err));
}
})
this.context.stopServiceExtensionAbility(want, (error) => {
if (error.code != 0) {
// Process service logic errors.
console.log('stopServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('stopServiceExtensionAbility succeed');
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.stopServiceExtensionAbility
stopServiceExtensionAbility(want: Want): Promise\<void>;
Stops a ServiceExtensionAbility in the same application. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
try {
this.context.startAbility(want, (error) => {
if (error.code != 0) {
console.log("start ability fail, err: " + JSON.stringify(err));
}
})
this.context.stopServiceExtensionAbility(want)
.then((data) => {
// Carry out normal service processing.
console.log('stopServiceExtensionAbility succeed');
})
.catch((error) => {
// Process service logic errors.
console.log('stopServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.stopServiceExtensionAbilityWithAccount
stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<void>): void;
Stops a ServiceExtensionAbility in the same application with the account ID specified. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
try {
this.context.startAbilityWithAccount(want, accountId, (error) => {
if (error.code != 0) {
console.log("start ability fail, err: " + JSON.stringify(err));
}
})
this.context.stopServiceExtensionAbilityWithAccount(want, accountId, (error) => {
if (error.code) {
// Process service logic errors.
console.log('stopServiceExtensionAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('stopServiceExtensionAbilityWithAccount succeed');
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.stopServiceExtensionAbilityWithAccount
stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<void>;
Stops a ServiceExtensionAbility in the same application with the account ID specified. This API uses a promise to return the result.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
try {
this.context.startAbilityWithAccount(want, accountId, (error) => {
if (error.code != 0) {
console.log("start ability fail, err: " + JSON.stringify(err));
}
})
this.context.stopServiceExtensionAbilityWithAccount(want, accountId)
.then((data) => {
// Carry out normal service processing.
console.log('stopServiceExtensionAbilityWithAccount succeed');
})
.catch((error) => {
// Process service logic errors.
console.log('stopServiceExtensionAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.terminateSelf
terminateSelf(callback: AsyncCallback&lt;void&gt;): void;
Terminates this ability. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
this.context.terminateSelf((error) => {
if (error.code) {
// Process service logic errors.
console.log('terminateSelf failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('terminateSelf succeed');
});
```
## AbilityContext.terminateSelf
terminateSelf(): Promise&lt;void&gt;;
Terminates this ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
this.context.terminateSelf().then((data) => {
// Carry out normal service processing.
console.log('terminateSelf succeed');
}).catch((error) => {
// Process service logic errors.
console.log('terminateSelf failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
```
## AbilityContext.terminateSelfWithResult
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback&lt;void&gt;): void;
Terminates this ability. If the ability is started by calling [startAbilityForResult](#abilitycontextstartabilityforresult), the result is returned to the caller in the form of a callback when **terminateSelfWithResult** is called. Otherwise, no result is returned to the caller when **terminateSelfWithResult** is called.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| parameter | [AbilityResult](js-apis-inner-ability-abilityResult.md) | Yes| Information returned to the caller.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
bundleName: "com.extreme.myapplication",
abilityName: "SecondAbility"
}
var resultCode = 100;
// AbilityResult information returned to the caller.
var abilityResult = {
want,
resultCode
}
try {
this.context.terminateSelfWithResult(abilityResult, (error) => {
if (error.code) {
// Process service logic errors.
console.log('terminateSelfWithResult failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('terminateSelfWithResult succeed');
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.terminateSelfWithResult
terminateSelfWithResult(parameter: AbilityResult): Promise&lt;void&gt;;
Terminates this ability. If the ability is started by calling [startAbilityForResult](#abilitycontextstartabilityforresult), the result is returned to the caller in the form of a promise when **terminateSelfWithResult** is called. Otherwise, no result is returned to the caller when **terminateSelfWithResult** is called.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| parameter | [AbilityResult](js-apis-inner-ability-abilityResult.md) | Yes| Information returned to the caller.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
bundleName: "com.extreme.myapplication",
abilityName: "SecondAbility"
}
var resultCode = 100;
// AbilityResult information returned to the caller.
var abilityResult = {
want,
resultCode
}
try {
this.context.terminateSelfWithResult(abilityResult)
.then((data) => {
// Carry out normal service processing.
console.log('terminateSelfWithResult succeed');
})
.catch((error) => {
// Process service logic errors.
console.log('terminateSelfWithResult failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.connectServiceExtensionAbility
connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to another ability.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| options | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | Yes| Parameters for the connection.|
**Return value**
| Type| Description|
| -------- | -------- |
| number | Result code of the ability connection.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var options = {
onConnect(elementName, remote) { console.log('----------- onConnect -----------') },
onDisconnect(elementName) { console.log('----------- onDisconnect -----------') },
onFailed(code) { console.log('----------- onFailed -----------') }
}
var connection = null;
try {
connection = this.context.connectServiceExtensionAbility(want, options);
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.connectServiceExtensionAbilityWithAccount
connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number;
Uses the **AbilityInfo.AbilityType.SERVICE** template to connect this ability to another ability with the account ID specified.
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| options | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | Yes| Parameters for the connection.|
**Return value**
| Type| Description|
| -------- | -------- |
| number | Result code of the ability connection.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
var options = {
onConnect(elementName, remote) { console.log('----------- onConnect -----------') },
onDisconnect(elementName) { console.log('----------- onDisconnect -----------') },
onFailed(code) { console.log('----------- onFailed -----------') }
}
var connection = null;
try {
connection = this.context.connectServiceExtensionAbilityWithAccount(want, accountId, options);
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.disconnectServiceExtensionAbility
disconnectServiceExtensionAbility(connection: number): Promise\<void>;
Disconnects a connection. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| connection | number | Yes| Result code of the ability connection.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise\<void> | Promise used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
// connection is the return value of connectServiceExtensionAbility.
var connection = 1;
try {
this.context.disconnectServiceExtensionAbility(connection)
.then((data) => {
// Carry out normal service processing.
console.log('disconnectServiceExtensionAbility succeed');
})
.catch((error) => {
// Process service logic errors.
console.log('disconnectServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.disconnectServiceExtensionAbility
disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback\<void>): void;
Disconnects a connection. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| connection | number | Yes| Result code of the ability connection.|
| callback | AsyncCallback\<void> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
// connection is the return value of connectServiceExtensionAbility.
var connection = 1;
try {
this.context.disconnectServiceExtensionAbility(connection, (error) => {
if (error.code) {
// Process service logic errors.
console.log('disconnectServiceExtensionAbility failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('disconnectServiceExtensionAbility succeed');
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbilityByCall
startAbilityByCall(want: Want): Promise&lt;Caller&gt;;
Starts an ability in the foreground or background and obtains the caller object for communicating with the ability.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- The rules for using this API in the same-device and cross-device scenarios are different. For details, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Information about the ability to start, including **abilityName**, **moduleName**, **bundleName**, **deviceId** (optional), and **parameters** (optional). If **deviceId** is left blank or null, the local ability is started. If **parameters** is left blank or null, the ability is started in the background.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;Caller&gt; | Promise used to return the caller object to communicate with.|
**Example**
Start an ability in the background.
```ts
var caller = undefined;
// Start an ability in the background by not passing parameters.
var wantBackground = {
bundleName: "com.example.myservice",
moduleName: "entry",
abilityName: "EntryAbility",
deviceId: ""
};
try {
this.context.startAbilityByCall(wantBackground)
.then((obj) => {
// Carry out normal service processing.
caller = obj;
console.log('startAbilityByCall succeed');
}).catch((error) => {
// Process service logic errors.
console.log('startAbilityByCall failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
Start an ability in the foreground.
```ts
var caller = undefined;
// Start an ability in the foreground with ohos.aafwk.param.callAbilityToForeground in parameters set to true.
var wantForeground = {
bundleName: "com.example.myservice",
moduleName: "entry",
abilityName: "EntryAbility",
deviceId: "",
parameters: {
"ohos.aafwk.param.callAbilityToForeground": true
}
};
try {
this.context.startAbilityByCall(wantForeground)
.then((obj) => {
// Carry out normal service processing.
caller = obj;
console.log('startAbilityByCall succeed');
}).catch((error) => {
// Process service logic errors.
console.log('startAbilityByCall failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbilityWithAccount
startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<void\>): void;
Starts an ability with the account ID specified. This API uses an asynchronous callback to return the result.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
try {
this.context.startAbilityWithAccount(want, accountId, (error) => {
if (error.code) {
// Process service logic errors.
console.log('startAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('startAbilityWithAccount succeed');
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbilityWithAccount
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\<void\>): void;
Starts an ability with the account ID and start options specified. This API uses an asynchronous callback to return the result.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| options | [StartOptions](js-apis-application-startOptions.md) | Yes| Parameters used for starting the ability.|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
var options = {
windowMode: 0
};
try {
this.context.startAbilityWithAccount(want, accountId, options, (error) => {
if (error.code) {
// Process service logic errors.
console.log('startAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
return;
}
// Carry out normal service processing.
console.log('startAbilityWithAccount succeed');
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.startAbilityWithAccount
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\<void\>;
Starts an ability with the account ID specified. This API uses a promise to return the result.
Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information about the target ability.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| options | [StartOptions](js-apis-application-startOptions.md) | No| Parameters used for starting the ability.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | If the input parameter is not valid parameter. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example**
```ts
var want = {
deviceId: "",
bundleName: "com.example.myapplication",
abilityName: "EntryAbility"
};
var accountId = 100;
var options = {
windowMode: 0
};
try {
this.context.startAbilityWithAccount(want, accountId, options)
.then((data) => {
// Carry out normal service processing.
console.log('startAbilityWithAccount succeed');
})
.catch((error) => {
// Process service logic errors.
console.log('startAbilityWithAccount failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
});
} catch (paramError) {
// Process input parameter errors.
console.log('error.code: ' + JSON.stringify(paramError.code) +
' error.message: ' + JSON.stringify(paramError.message));
}
```
## AbilityContext.setMissionLabel
setMissionLabel(label: string, callback:AsyncCallback&lt;void&gt;): void;
Sets a label for this ability in the mission. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| label | string | Yes| Label of the ability to set.|
| callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Example**
```ts
this.context.setMissionLabel("test",(result) => {
console.log('setMissionLabel result:' + JSON.stringify(result));
});
```
## AbilityContext.setMissionLabel
setMissionLabel(label: string): Promise&lt;void&gt;;
Sets a label for this ability in the mission. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| label | string | Yes| Label of the ability to set.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
```ts
this.context.setMissionLabel("test").then(() => {
console.log('success');
}).catch((error) => {
console.log('failed:' + JSON.stringify(error));
});
```
## AbilityContext.setMissionIcon
setMissionIcon(icon: image.PixelMap, callback:AsyncCallback\<void>): void;
Sets an icon for this ability in the mission. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| icon | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes| Icon of the ability to set.|
| callback | AsyncCallback\<void> | Yes| Callback used to return the result.|
**Example**
```ts
import image from '@ohos.multimedia.image';
var imagePixelMap;
var color = new ArrayBuffer(0);
var initializationOptions = {
size: {
height: 100,
width: 100
}
};
image.createPixelMap(color, initializationOptions)
.then((data) => {
imagePixelMap = data;
})
.catch((err) => {
console.log('--------- createPixelMap fail, err: ---------', err)
});
this.context.setMissionIcon(imagePixelMap, (err) => {
console.log('---------- setMissionIcon fail, err: -----------', err);
})
```
## AbilityContext.setMissionIcon
setMissionIcon(icon: image.PixelMap): Promise\<void>;
Sets an icon for this ability in the mission. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| icon | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes| Icon of the ability to set.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
```ts
import image from '@ohos.multimedia.image';
var imagePixelMap;
var color = new ArrayBuffer(0);
var initializationOptions = {
size: {
height: 100,
width: 100
}
};
image.createPixelMap(color, initializationOptions)
.then((data) => {
imagePixelMap = data;
})
.catch((err) => {
console.log('--------- createPixelMap fail, err: ---------', err)
});
this.context.setMissionIcon(imagePixelMap)
.then(() => {
console.log('-------------- setMissionIcon success -------------');
})
.catch((err) => {
console.log('-------------- setMissionIcon fail, err: -------------', err);
});
```
## AbilityContext.restoreWindowStage
restoreWindowStage(localStorage: LocalStorage) : void;
Restores the window stage data for this ability.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| localStorage | LocalStorage | Yes| Storage used to store the restored window stage.|
**Example**
```ts
var storage = new LocalStorage();
this.context.restoreWindowStage(storage);
```
## AbilityContext.isTerminating
isTerminating(): boolean;
Checks whether this ability is in the terminating state.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Return value**
| Type| Description|
| -------- | -------- |
| boolean| The value **true** means that the ability is in the terminating state, and **false** means the opposite.|
**Example**
```ts
var isTerminating = this.context.isTerminating();
console.log('ability state :' + isTerminating);
```
# @ohos.application.Ability (Ability)
The **Ability** module manages the ability lifecycle and context, such as creating and destroying an ability, and dumping client information.
This module provides the following common ability-related functions:
- [Caller](#caller): implements sending of sequenceable data to the target ability when an ability (caller ability) invokes the target ability (callee ability).
- [Callee](#callee): implements callbacks for registration and deregistration of caller notifications.
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module can be used only in the stage model.
## Modules to Import
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
| context | [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md) | Yes| No| Context of an ability.|
| launchWant | [Want](js-apis-app-ability-want.md) | Yes| No| Parameters for starting the ability.|
| lastRequestWant | [Want](js-apis-app-ability-want.md) | Yes| No| Parameters used when the ability was started last time.|
| callee | [Callee](#callee) | Yes| No| Object that invokes the stub service.|
## Ability.onCreate
onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
Called to initialize the service logic when an ability is created.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-app-ability-want.md) | Yes| Information related to this ability, including the ability name and bundle name.|
| param | AbilityConstant.LaunchParam | Yes| Parameters for starting the ability, and the reason for the last abnormal exit.|
**Example**
```ts
export default class EntryAbility extends UIAbility {
onCreate(want, param) {
console.log('onCreate, want:' + want.abilityName);
}
}
```
## Ability.onWindowStageCreate
onWindowStageCreate(windowStage: window.WindowStage): void
Called when a **WindowStage** is created for this ability.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** information.|
**Example**
```ts
class myAbility extends Ability {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
}
}
```
## Ability.onWindowStageDestroy
onWindowStageDestroy(): void
Called when the **WindowStage** is destroyed for this ability.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Example**
```ts
class myAbility extends Ability {
onWindowStageDestroy() {
console.log('onWindowStageDestroy');
}
}
```
## Ability.onWindowStageRestore
onWindowStageRestore(windowStage: window.WindowStage): void
Called when the **WindowStage** is restored during the migration of this ability, which is a multi-instance ability.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** information.|
**Example**
```ts
class myAbility extends Ability {
onWindowStageRestore(windowStage) {
console.log('onWindowStageRestore');
}
}
```
## Ability.onDestroy
onDestroy(): void;
Called when this ability is destroyed to clear resources.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Example**
```ts
class myAbility extends Ability {
onDestroy() {
console.log('onDestroy');
}
}
```
## Ability.onForeground
onForeground(): void;
Called when this ability is switched from the background to the foreground.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Example**
```ts
class myAbility extends Ability {
onForeground() {
console.log('onForeground');
}
}
```
## Ability.onBackground
onBackground(): void;
Called when this ability is switched from the foreground to the background.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Example**
```ts
class myAbility extends Ability {
onBackground() {
console.log('onBackground');
}
}
```
## Ability.onContinue
onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult;
Called to save data during the ability migration preparation process.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| wantParam | {[key:&nbsp;string]:&nbsp;any} | Yes| **want** parameter.|
**Return value**
| Type| Description|
| -------- | -------- |
| AbilityConstant.OnContinueResult | Continuation result.|
**Example**
```ts
import AbilityConstant from "@ohos.application.AbilityConstant"
class myAbility extends Ability {
onContinue(wantParams) {
console.log('onContinue');
wantParams["myData"] = "my1234567";
return AbilityConstant.OnContinueResult.AGREE;
}
}
```
## Ability.onNewWant
onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void;
Called when a new Want is passed in and this UIAbility is started again.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | Yes| Want information, such as the ability name and bundle name.|
| launchParams | AbilityConstant.LaunchParam | Yes| Reason for the ability startup and the last abnormal exit.|
**Example**
```ts
class myAbility extends Ability {
onNewWant(want, launchParams) {
console.log('onNewWant, want:' + want.abilityName);
console.log('onNewWant, launchParams:' + JSON.stringify(launchParams));
}
}
```
## Ability.onConfigurationUpdated
onConfigurationUpdated(config: Configuration): void;
Called when the global configuration is updated.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| config | [Configuration](js-apis-application-configuration.md) | Yes| Callback invoked when the global configuration is updated. The global configuration indicates the configuration of the environment where the application is running and includes the language and color mode.|
**Example**
```ts
class myAbility extends Ability {
onConfigurationUpdated(config) {
console.log('onConfigurationUpdated, language:' + config.language);
}
}
```
## Ability.dump
dump(params: Array\<string>): Array\<string>;
Dumps client information.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| params | Array\<string> | Yes| Parameters in the form of a command.|
**Example**
```ts
class myAbility extends Ability {
dump(params) {
console.log('dump, params:' + JSON.stringify(params));
return ["params"]
}
}
```
## Ability.onMemoryLevel
onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
Called when the system has decided to adjust the memory level. For example, this API can be used when there is not enough memory to run as many background processes as possible.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| level | [AbilityConstant.MemoryLevel](js-apis-application-abilityConstant.md#abilityconstantmemorylevel) | Yes| Memory level that indicates the memory usage status. When the specified memory level is reached, a callback will be invoked and the system will start adjustment.|
**Example**
```ts
class myAbility extends Ability {
onMemoryLevel(level) {
console.log('onMemoryLevel, level:' + JSON.stringify(level));
}
}
```
## Ability.onSaveState
onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}): AbilityConstant.OnSaveResult;
Called when the framework automatically saves the ability state in the case of an application fault. This API is used together with [appRecovery](js-apis-app-ability-appRecovery.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| reason | [AbilityConstant.StateType](js-apis-application-abilityConstant.md#abilityconstantstatetype) | Yes| Reason for triggering the callback to save the ability state.|
| wantParam | {[key:&nbsp;string]:&nbsp;any} | Yes| **want** parameter.|
**Return value**
| Type| Description|
| -------- | -------- |
| AbilityConstant.OnSaveResult | Whether the ability state is saved.|
**Example**
```ts
import AbilityConstant from '@ohos.application.AbilityConstant'
class myAbility extends Ability {
onSaveState(reason, wantParam) {
console.log('onSaveState');
wantParam["myData"] = "my1234567";
return AbilityConstant.OnSaveResult.RECOVERY_AGREE;
}
}
```
## Caller
Implements sending of sequenceable data to the target ability when an ability (caller ability) invokes the target ability (callee ability).
## Caller.call
call(method: string, data: rpc.Sequenceable): Promise&lt;void&gt;;
Sends sequenceable data to the target ability.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| method | string | Yes| Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data.|
| data | rpc.Sequenceable | Yes| Sequenceable data. You need to customize the data.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;void&gt; | Promise used to return a response.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. |
| 401 | Invalid input parameter. |
| 16200001 | Caller released. The caller has been released. |
| 16200002 | Callee invalid. The callee does not exist. |
| 16000050 | Internal Error. |
**Example**
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
class MyMessageAble{ // Custom sequenceable data structure.
name:""
str:""
num: 1
constructor(name, str) {
this.name = name;
this.str = str;
}
marshalling(messageParcel) {
messageParcel.writeInt(this.num);
messageParcel.writeString(this.str);
console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']');
return true;
}
unmarshalling(messageParcel) {
this.num = messageParcel.readInt();
this.str = messageParcel.readString();
console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']');
return true;
}
};
var method = 'call_Function'; // Notification message string negotiated by the two abilities
var caller;
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({
bundleName: "com.example.myservice",
abilityName: "EntryAbility",
deviceId: ""
}).then((obj) => {
caller = obj;
let msg = new MyMessageAble("msg", "world"); // See the definition of Sequenceable.
caller.call(method, msg)
.then(() => {
console.log('Caller call() called');
})
.catch((callErr) => {
console.log('Caller.call catch error, error.code: ' + JSON.stringify(callErr.code) +
' error.message: ' + JSON.stringify(callErr.message));
});
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) +
' error.message: ' + JSON.stringify(err.message));
});
}
}
```
## Caller.callWithResult
callWithResult(method: string, data: rpc.Sequenceable): Promise&lt;rpc.MessageParcel&gt;;
Sends sequenceable data to the target ability and obtains the sequenceable data returned by the target ability.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| method | string | Yes| Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data.|
| data | rpc.Sequenceable | Yes| Sequenceable data. You need to customize the data.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;rpc.MessageParcel&gt; | Promise used to return the sequenceable data from the target ability.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. |
| 401 | Invalid input parameter. |
| 16200001 | Caller released. The caller has been released. |
| 16200002 | Callee invalid. The callee does not exist. |
| 16000050 | Internal Error. |
**Example**
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
class MyMessageAble{
name:""
str:""
num: 1
constructor(name, str) {
this.name = name;
this.str = str;
}
marshalling(messageParcel) {
messageParcel.writeInt(this.num);
messageParcel.writeString(this.str);
console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']');
return true;
}
unmarshalling(messageParcel) {
this.num = messageParcel.readInt();
this.str = messageParcel.readString();
console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']');
return true;
}
};
var method = 'call_Function';
var caller;
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({
bundleName: "com.example.myservice",
abilityName: "EntryAbility",
deviceId: ""
}).then((obj) => {
caller = obj;
let msg = new MyMessageAble(1, "world");
caller.callWithResult(method, msg)
.then((data) => {
console.log('Caller callWithResult() called');
let retmsg = new MyMessageAble(0, "");
data.readSequenceable(retmsg);
})
.catch((callErr) => {
console.log('Caller.callWithResult catch error, error.code: ' + JSON.stringify(callErr.code) +
' error.message: ' + JSON.stringify(callErr.message));
});
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) +
' error.message: ' + JSON.stringify(err.message));
});
}
}
```
## Caller.release
release(): void;
Releases the caller interface of the target ability.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 16200001 | Caller released. The caller has been released. |
| 16200002 | Callee invalid. The callee does not exist. |
| 16000050 | Internal Error. |
**Example**
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
var caller;
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({
bundleName: "com.example.myservice",
abilityName: "EntryAbility",
deviceId: ""
}).then((obj) => {
caller = obj;
try {
caller.release();
} catch (releaseErr) {
console.log('Caller.release catch error, error.code: ' + JSON.stringify(releaseErr.code) +
' error.message: ' + JSON.stringify(releaseErr.message));
}
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) +
' error.message: ' + JSON.stringify(err.message));
});
}
}
```
## Caller.onRelease
onRelease(callback: OnReleaseCallBack): void;
Registers a callback that is invoked when the stub on the target ability is disconnected.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | OnReleaseCallBack | Yes| Callback used for the **onRelease** API.|
**Example**
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
var caller;
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({
bundleName: "com.example.myservice",
abilityName: "EntryAbility",
deviceId: ""
}).then((obj) => {
caller = obj;
try {
caller.onRelease((str) => {
console.log(' Caller OnRelease CallBack is called ' + str);
});
} catch (error) {
console.log('Caller.on catch error, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
}
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) +
' error.message: ' + JSON.stringify(err.message));
});
}
}
```
## Callee
Implements callbacks for caller notification registration and deregistration.
## Callee.on
on(method: string, callback: CalleeCallBack): void;
Registers a caller notification callback, which is invoked when the target ability registers a function.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| method | string | Yes| Notification message string negotiated between the two abilities.|
| callback | CalleeCallBack | Yes| JS notification synchronization callback of the **rpc.MessageParcel** type. The callback must return at least one empty **rpc.Sequenceable** object. Otherwise, the function execution fails.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 16200004 | Method registered. The method has registered. |
| 16000050 | Internal Error. |
**Example**
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
class MyMessageAble{
name:""
str:""
num: 1
constructor(name, str) {
this.name = name;
this.str = str;
}
marshalling(messageParcel) {
messageParcel.writeInt(this.num);
messageParcel.writeString(this.str);
console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']');
return true;
}
unmarshalling(messageParcel) {
this.num = messageParcel.readInt();
this.str = messageParcel.readString();
console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']');
return true;
}
};
var method = 'call_Function';
function funcCallBack(pdata) {
console.log('Callee funcCallBack is called ' + pdata);
let msg = new MyMessageAble("test", "");
pdata.readSequenceable(msg);
return new MyMessageAble("test1", "Callee test");
}
export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) {
console.log('Callee onCreate is called');
try {
this.callee.on(method, funcCallBack);
} catch (error) {
console.log('Callee.on catch error, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
}
}
}
```
## Callee.off
off(method: string): void;
Deregisters a caller notification callback, which is invoked when the target ability registers a function.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| method | string | Yes| Registered notification message string.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 16200005 | Method not registered. The method has not registered. |
| 16000050 | Internal Error. |
**Example**
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
var method = 'call_Function';
export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) {
console.log('Callee onCreate is called');
try {
this.callee.off(method);
} catch (error) {
console.log('Callee.off catch error, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
}
}
}
```
## OnReleaseCallBack
(msg: string): void;
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
| (msg: string) | function | Yes| No| Prototype of the listener function registered by the caller.|
## CalleeCallBack
(indata: rpc.MessageParcel): rpc.Sequenceable;
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
| (indata: rpc.MessageParcel) | rpc.Sequenceable | Yes| No| Prototype of the listener function registered by the callee.|
# @ohos.application.AbilityLifecycleCallback (AbilityLifecycleCallback)
The **AbilityLifecycleCallback** module provides callbacks, such as **onAbilityCreate**, **onWindowStageCreate**, and **onWindowStageDestroy**, to receive lifecycle state changes in the application context. These callbacks can be used as an input parameter of [registerAbilityLifecycleCallback](js-apis-inner-application-applicationContext.md#applicationcontextregisterabilitylifecyclecallback).
> **NOTE**
>
> The APIs of this module are supported since API version 9 and are deprecated in versions later than API version 9. You are advised to use [@ohos.app.ability.AbilityLifecycleCallback](js-apis-app-ability-abilityLifecycleCallback.md) instead. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module can be used only in the stage model.
## Modules to Import
```ts
import AbilityLifecycleCallback from "@ohos.application.AbilityLifecycleCallback";
```
## AbilityLifecycleCallback.onAbilityCreate
onAbilityCreate(ability: Ability): void;
Called when an ability is created.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.|
## AbilityLifecycleCallback.onWindowStageCreate
onWindowStageCreate(ability: Ability, windowStage: window.WindowStage): void;
Called when the window stage of an ability is created.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.|
| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** object.|
## AbilityLifecycleCallback.onWindowStageActive
onWindowStageActive(ability: Ability, windowStage: window.WindowStage): void;
Called when the window stage of an ability gains focus.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.|
| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** object.|
## AbilityLifecycleCallback.onWindowStageInactive
onWindowStageInactive(ability: Ability, windowStage: window.WindowStage): void;
Called when the window stage of an ability loses focus.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.|
| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** object.|
## AbilityLifecycleCallback.onWindowStageDestroy
onWindowStageDestroy(ability: Ability, windowStage: window.WindowStage): void;
Called when the window stage of an ability is destroyed.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.|
| windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | Yes| **WindowStage** object.|
## AbilityLifecycleCallback.onAbilityDestroy
onAbilityDestroy(ability: Ability): void;
Called when an ability is destroyed.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.|
## AbilityLifecycleCallback.onAbilityForeground
onAbilityForeground(ability: Ability): void;
Called when an ability is switched from the background to the foreground.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.|
## AbilityLifecycleCallback.onAbilityBackground
onAbilityBackground(ability: Ability): void;
Called when an ability is switched from the foreground to the background.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.|
## AbilityLifecycleCallback.onAbilityContinue
onAbilityContinue(ability: Ability): void;
Called when an ability is continued on another device.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.|
**Example**
```ts
import AbilityStage from "@ohos.application.AbilityStage";
var lifecycleId;
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("MyAbilityStage onCreate")
let AbilityLifecycleCallback = {
onAbilityCreate(ability) {
console.log("onAbilityCreate ability:" + JSON.stringify(ability));
},
onWindowStageCreate(ability, windowStage) {
console.log("onWindowStageCreate ability:" + JSON.stringify(ability));
console.log("onWindowStageCreate windowStage:" + JSON.stringify(windowStage));
},
onWindowStageActive(ability, windowStage) {
console.log("onWindowStageActive ability:" + JSON.stringify(ability));
console.log("onWindowStageActive windowStage:" + JSON.stringify(windowStage));
},
onWindowStageInactive(ability, windowStage) {
console.log("onWindowStageInactive ability:" + JSON.stringify(ability));
console.log("onWindowStageInactive windowStage:" + JSON.stringify(windowStage));
},
onWindowStageDestroy(ability, windowStage) {
console.log("onWindowStageDestroy ability:" + JSON.stringify(ability));
console.log("onWindowStageDestroy windowStage:" + JSON.stringify(windowStage));
},
onAbilityDestroy(ability) {
console.log("onAbilityDestroy ability:" + JSON.stringify(ability));
},
onAbilityForeground(ability) {
console.log("onAbilityForeground ability:" + JSON.stringify(ability));
},
onAbilityBackground(ability) {
console.log("onAbilityBackground ability:" + JSON.stringify(ability));
},
onAbilityContinue(ability) {
console.log("onAbilityContinue ability:" + JSON.stringify(ability));
}
}
// 1. Obtain applicationContext through the context attribute.
let applicationContext = this.context.getApplicationContext();
// 2. Use applicationContext to register a listener for the ability lifecycle in the application.
lifecycleId = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback);
console.log("registerAbilityLifecycleCallback number: " + JSON.stringify(lifecycleId));
}
onDestroy() {
let applicationContext = this.context.getApplicationContext();
applicationContext.unregisterAbilityLifecycleCallback(lifecycleId, (error, data) => {
console.log("unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error));
});
}
}
```
# @ohos.application.errorManager (ErrorManager)
The **ErrorManager** module provides APIs for registering and deregistering error observers.
> **NOTE**
>
> The APIs of this module are supported since API version 9 and are deprecated in versions later than API version 9. You are advised to use [@ohos.app.ability.errorManager](js-apis-app-ability-errorManager.md) instead. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
```ts
import errorManager from '@ohos.application.errorManager'
```
## ErrorManager.registerErrorObserver
registerErrorObserver(observer: ErrorObserver): number;
Registers an error observer.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| observer | [ErrorObserver](js-apis-inner-application-errorObserver.md) | Yes| Numeric code of the observer.|
**Example**
```ts
var observer = {
onUnhandledException(errorMsg) {
console.log('onUnhandledException, errorMsg: ', errorMsg)
}
}
errorManager.registerErrorObserver(observer)
```
## ErrorManager.unregisterErrorObserver
unregisterErrorObserver(observerId: number, callback: AsyncCallback\<void>): void;
Deregisters an error observer. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| observerId | number | Yes| Numeric code of the observer.|
| callback | AsyncCallback\<void> | Yes| Callback used to return the result.|
**Example**
```ts
var observerId = 100;
function unregisterErrorObserverCallback(err) {
if (err) {
console.log('------------ unregisterErrorObserverCallback ------------', err);
}
}
errorManager.unregisterErrorObserver(observerId, unregisterErrorObserverCallback);
```
## ErrorManager.unregisterErrorObserver
unregisterErrorObserver(observerId: number): Promise\<void>;
Deregisters an error observer. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| observerId | number | Yes| Numeric code of the observer.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise\<void> | Promise used to return the result.|
**Example**
```ts
var observerId = 100;
errorManager.unregisterErrorObserver(observerId)
.then((data) => {
console.log('----------- unregisterErrorObserver success ----------', data);
})
.catch((err) => {
console.log('----------- unregisterErrorObserver fail ----------', err);
})
```
......@@ -72,7 +72,7 @@
- [Using Explicit Want to Start an Ability](application-models/ability-startup-with-explicit-want.md)
- [Using Implicit Want to Open a Website](application-models/ability-startup-with-implicit-want.md)
- [Using Want to Share Data Between Applications](application-models/data-share-via-want.md)
- [Component Startup Rules](application-models/component-startup-rules.md)
- [Component Startup Rules (Stage Model)](application-models/component-startup-rules.md)
- Inter-Device Application Component Interaction (Continuation)
- [Continuation Overview](application-models/inter-device-interaction-hop-overview.md)
- [Cross-Device Migration](application-models/hop-cross-device-migration.md)
......@@ -128,6 +128,7 @@
- [Widget Development](application-models/widget-development-fa.md)
- [Context](application-models/application-context-fa.md)
- [Want](application-models/want-fa.md)
- [Component Startup Rules (FA Model)](application-models/component-startup-rules-fa.md)
- IPC
- [Process Model](application-models/process-model-fa.md)
- [Common Events](application-models/common-event-fa.md)
......@@ -286,10 +287,8 @@
- [WebGL Overview](webgl/webgl-overview.md)
- [WebGL Development](webgl/webgl-guidelines.md)
- Media
- Audio
- Audio and Video
- [Audio Overview](media/audio-overview.md)
- [Audio Playback Development](media/audio-playback.md)
- [Audio Recording Development](media/audio-recorder.md)
- [Audio Rendering Development](media/audio-renderer.md)
- [Audio Stream Management Development](media/audio-stream-manager.md)
- [Audio Capture Development](media/audio-capturer.md)
......@@ -298,7 +297,10 @@
- [Audio Interruption Mode Development](media/audio-interruptmode.md)
- [Volume Management Development](media/audio-volume-manager.md)
- [Audio Routing and Device Management Development](media/audio-routing-manager.md)
- Video
- [AVPlayer Development (Recommended)](media/avplayer-playback.md)
- [AVRecorder Development (Recommended)](media/avrecorder.md)
- [Audio Playback Development](media/audio-playback.md)
- [Audio Recording Development](media/audio-recorder.md)
- [Video Playback Development](media/video-playback.md)
- [Video Recording Development](media/video-recorder.md)
- AVSession
......@@ -324,6 +326,9 @@
- Crypto Framework
- [Crypto Framework Overview](security/cryptoFramework-overview.md)
- [Crypto Framework Development](security/cryptoFramework-guidelines.md)
- Certificate
- [Certificate Overview](security/cert-overview.md)
- [Certificate Development](security/cert-guidelines.md)
- hapsigner
- [hapsigner Overview](security/hapsigntool-overview.md)
- [hapsigner Guide](security/hapsigntool-guidelines.md)
......@@ -366,12 +371,14 @@
- [Album Management](file-management/medialibrary-album-guidelines.md)
- File Access Framework
- [File Access Framework Overview](file-management/file-access-framework-overview.md)
- [FilePicker Guide](file-management/filepicker-guidelines.md)
- Task Management
- Background Task Management
- [Background Task Management Overview](task-management/background-task-overview.md)
- [Transient Task Development](task-management/transient-task-dev-guide.md)
- [Continuous Task Development](task-management/continuous-task-dev-guide.md)
- [Work Scheduler Development](task-management/work-scheduler-dev-guide.md)
- [WorkSchedulerExtensionAbility Development](task-management/workscheduler-extensionability.md)
- [Efficiency Resource Request Development](task-management/efficiency-resources-apply-dev-guide.md)
- Agent-Powered Reminder
- [Agent-Powered Reminder Overview](task-management/reminder-agent-overview.md)
......@@ -381,9 +388,7 @@
- [USB Service Overview](device/usb-overview.md)
- [USB Service Development](device/usb-guidelines.md)
- Location
- [Location Overview](device/device-location-overview.md)
- [Obtaining Device Location Information](device/device-location-info.md)
- [Geocoding and Reverse Geocoding Capabilities](device/device-location-geocoding.md)
- [Location Development](device/location-guidelines.md)
- Sensor
- [Sensor Overview](device/sensor-overview.md)
- [Sensor Development](device/sensor-guidelines.md)
......@@ -748,72 +753,70 @@
- [API Reference Document Description](reference/apis/development-intro.md)
- Ability Framework
- Stage Model (Recommended)
- [@ohos.app.ability.Ability](reference/apis/js-apis-app-ability-ability.md)
- [@ohos.app.ability.AbilityConstant](reference/apis/js-apis-app-ability-abilityConstant.md)
- [@ohos.app.ability.abilityLifecycleCallback](reference/apis/js-apis-app-ability-abilityLifecycleCallback.md)
- [@ohos.app.ability.AbilityStage](reference/apis/js-apis-app-ability-abilityStage.md)
- [@ohos.app.ability.common](reference/apis/js-apis-app-ability-common.md)
- [@ohos.app.ability.contextConstant](reference/apis/js-apis-app-ability-contextConstant.md)
- [@ohos.app.ability.EnvironmentCallback](reference/apis/js-apis-app-ability-environmentCallback.md)
- [@ohos.app.ability.ExtensionAbility](reference/apis/js-apis-app-ability-extensionAbility.md)
- [@ohos.app.ability.ServiceExtensionAbility](reference/apis/js-apis-app-ability-serviceExtensionAbility.md)
- [@ohos.app.ability.StartOptions](reference/apis/js-apis-app-ability-startOptions.md)
- [@ohos.app.ability.UIAbility](reference/apis/js-apis-app-ability-uiAbility.md)
- [@ohos.app.form.FormExtensionAbility](reference/apis/js-apis-app-form-formExtensionAbility.md)
- [@ohos.app.ability.Ability (Ability Base Class)](reference/apis/js-apis-app-ability-ability.md)
- [@ohos.app.ability.AbilityConstant (AbilityConstant)](reference/apis/js-apis-app-ability-abilityConstant.md)
- [@ohos.app.ability.abilityLifecycleCallback (AbilityLifecycleCallback)](reference/apis/js-apis-app-ability-abilityLifecycleCallback.md)
- [@ohos.app.ability.AbilityStage (AbilityStage)](reference/apis/js-apis-app-ability-abilityStage.md)
- [@ohos.app.ability.common (Context)](reference/apis/js-apis-app-ability-common.md)
- [@ohos.app.ability.contextConstant (ContextConstant)](reference/apis/js-apis-app-ability-contextConstant.md)
- [@ohos.app.ability.EnvironmentCallback (EnvironmentCallback)](reference/apis/js-apis-app-ability-environmentCallback.md)
- [@ohos.app.ability.ExtensionAbility (ExtensionAbility Base Class)](reference/apis/js-apis-app-ability-extensionAbility.md)
- [@ohos.app.ability.ServiceExtensionAbility (ServiceExtensionAbility)](reference/apis/js-apis-app-ability-serviceExtensionAbility.md)
- [@ohos.app.ability.StartOptions (StartOptions)](reference/apis/js-apis-app-ability-startOptions.md)
- [@ohos.app.ability.UIAbility (UIAbility)](reference/apis/js-apis-app-ability-uiAbility.md)
- [@ohos.app.form.FormExtensionAbility (FormExtensionAbility)](reference/apis/js-apis-app-form-formExtensionAbility.md)
- [@ohos.application.DataShareExtensionAbility (DataShare Extension Ability)](reference/apis/js-apis-application-dataShareExtensionAbility.md)
- [@ohos.application.StaticSubscriberExtensionAbility (StaticSubscriberExtensionAbility)](reference/apis/js-apis-application-staticSubscriberExtensionAbility.md)
- Stage Model (To Be Deprecated Soon)
- [@ohos.application.Ability](reference/apis/js-apis-application-ability.md)
- [@ohos.application.AbilityConstant](reference/apis/js-apis-application-abilityConstant.md)
- [@ohos.application.AbilityLifecycleCallback](reference/apis/js-apis-application-abilityLifecycleCallback.md)
- [@ohos.application.AbilityStage](reference/apis/js-apis-application-abilityStage.md)
- [@ohos.application.context](reference/apis/js-apis-application-context.md)
- [@ohos.application.DataShareExtensionAbility](reference/apis/js-apis-application-dataShareExtensionAbility.md)
- [@ohos.application.EnvironmentCallback](reference/apis/js-apis-application-environmentCallback.md)
- [@ohos.application.ExtensionAbility](reference/apis/js-apis-application-extensionAbility.md)
- [@ohos.application.FormExtension](reference/apis/js-apis-application-formExtension.md)
- [@ohos.application.ServiceExtensionAbility](reference/apis/js-apis-application-serviceExtensionAbility.md)
- [@ohos.application.StartOptions](reference/apis/js-apis-application-startOptions.md)
- [@ohos.application.StaticSubscriberExtensionAbility](reference/apis/js-apis-application-staticSubscriberExtensionAbility.md)
- [@ohos.application.Ability (Ability)](reference/apis/js-apis-application-ability.md)
- [@ohos.application.AbilityConstant (AbilityConstant)](reference/apis/js-apis-application-abilityConstant.md)
- [@ohos.application.AbilityLifecycleCallback (AbilityLifecycleCallback)](reference/apis/js-apis-application-abilityLifecycleCallback.md)
- [@ohos.application.AbilityStage (AbilityStage)](reference/apis/js-apis-application-abilityStage.md)
- [@ohos.application.context (Context)](reference/apis/js-apis-application-context.md)
- [@ohos.application.EnvironmentCallback (EnvironmentCallback)](reference/apis/js-apis-application-environmentCallback.md)
- [@ohos.application.ExtensionAbility (ExtensionAbility)](reference/apis/js-apis-application-extensionAbility.md)
- [@ohos.application.FormExtension (FormExtension)](reference/apis/js-apis-application-formExtension.md)
- [@ohos.application.ServiceExtensionAbility (ServiceExtensionAbility)](reference/apis/js-apis-application-serviceExtensionAbility.md)
- [@ohos.application.StartOptions (StartOptions)](reference/apis/js-apis-application-startOptions.md)
- FA Model
- [@ohos.ability.ability](reference/apis/js-apis-ability-ability.md)
- [@ohos.ability.featureAbility](reference/apis/js-apis-ability-featureAbility.md)
- [@ohos.ability.particleAbility](reference/apis/js-apis-ability-particleAbility.md)
- [@ohos.ability.ability (Ability)](reference/apis/js-apis-ability-ability.md)
- [@ohos.ability.featureAbility (FeatureAbility)](reference/apis/js-apis-ability-featureAbility.md)
- [@ohos.ability.particleAbility (ParticleAbility)](reference/apis/js-apis-ability-particleAbility.md)
- Both Models (Recommended)
- [@ohos.app.ability.abilityDelegatorRegistry](reference/apis/js-apis-app-ability-abilityDelegatorRegistry.md)
- [@ohos.app.ability.abilityManager](reference/apis/js-apis-app-ability-abilityManager.md)
- [@ohos.app.ability.appManager](reference/apis/js-apis-app-ability-appManager.md)
- [@ohos.app.ability.appRecovery](reference/apis/js-apis-app-ability-appRecovery.md)
- [@ohos.app.ability.Configuration](reference/apis/js-apis-app-ability-configuration.md)
- [@ohos.app.ability.ConfigurationConstant](reference/apis/js-apis-app-ability-configurationConstant.md)
- [@ohos.app.ability.dataUriUtils](reference/apis/js-apis-app-ability-dataUriUtils.md)
- [@ohos.app.ability.errorManager](reference/apis/js-apis-app-ability-errorManager.md)
- [@ohos.app.ability.missionManager](reference/apis/js-apis-app-ability-missionManager.md)
- [@ohos.app.ability.quickFixManager](reference/apis/js-apis-app-ability-quickFixManager.md)
- [@ohos.app.ability.Want](reference/apis/js-apis-app-ability-want.md)
- [@ohos.app.ability.wantAgent](reference/apis/js-apis-app-ability-wantAgent.md)
- [@ohos.app.ability.wantConstant](reference/apis/js-apis-app-ability-wantConstant.md)
- [@ohos.app.form.formBindingData](reference/apis/js-apis-app-form-formBindingData.md)
- [@ohos.app.form.formHost](reference/apis/js-apis-app-form-formHost.md)
- [@ohos.app.form.formInfo](reference/apis/js-apis-app-form-formInfo.md)
- [@ohos.app.form.formProvider](reference/apis/js-apis-app-form-formProvider.md)
- [@ohos.distributedMissionManager](reference/apis/js-apis-distributedMissionManager.md)
- [@ohos.app.ability.abilityDelegatorRegistry (AbilityDelegatorRegistry)](reference/apis/js-apis-app-ability-abilityDelegatorRegistry.md)
- [@ohos.app.ability.abilityManager (AbilityManager)](reference/apis/js-apis-app-ability-abilityManager.md)
- [@ohos.app.ability.appManager (appManager)](reference/apis/js-apis-app-ability-appManager.md)
- [@ohos.app.ability.appRecovery (appRecovery)](reference/apis/js-apis-app-ability-appRecovery.md)
- [@ohos.app.ability.Configuration (Configuration)](reference/apis/js-apis-app-ability-configuration.md)
- [@ohos.app.ability.ConfigurationConstant (ConfigurationConstant)](reference/apis/js-apis-app-ability-configurationConstant.md)
- [@ohos.app.ability.errorManager (ErrorManager)](reference/apis/js-apis-app-ability-errorManager.md)
- [@ohos.app.ability.missionManager (missionManager)](reference/apis/js-apis-app-ability-missionManager.md)
- [@ohos.app.ability.quickFixManager (quickFixManager)](reference/apis/js-apis-app-ability-quickFixManager.md)
- [@ohos.app.ability.Want (Want)](reference/apis/js-apis-app-ability-want.md)
- [@ohos.app.ability.wantAgent (WantAgent)](reference/apis/js-apis-app-ability-wantAgent.md)
- [@ohos.app.ability.wantConstant (wantConstant)](reference/apis/js-apis-app-ability-wantConstant.md)
- [@ohos.app.form.formBindingData (formBindingData)](reference/apis/js-apis-app-form-formBindingData.md)
- [@ohos.app.form.formHost (FormHost)](reference/apis/js-apis-app-form-formHost.md)
- [@ohos.app.form.formInfo (FormInfo)](reference/apis/js-apis-app-form-formInfo.md)
- [@ohos.app.form.formProvider (FormProvider)](reference/apis/js-apis-app-form-formProvider.md)
- Both Models (To Be Deprecated Soon)
- [@ohos.ability.dataUriUtils](reference/apis/js-apis-ability-dataUriUtils.md)
- [@ohos.ability.errorCode](reference/apis/js-apis-ability-errorCode.md)
- [@ohos.ability.wantConstant](reference/apis/js-apis-ability-wantConstant.md)
- [@ohos.application.abilityDelegatorRegistry](reference/apis/js-apis-application-abilityDelegatorRegistry.md)
- [@ohos.application.abilityManager](reference/apis/js-apis-application-abilityManager.md)
- [@ohos.application.appManager](reference/apis/js-apis-application-appManager.md)
- [@ohos.application.Configuration](reference/apis/js-apis-application-configuration.md)
- [@ohos.application.ConfigurationConstant](reference/apis/js-apis-application-configurationConstant.md)
- [@ohos.application.errorManager](reference/apis/js-apis-application-errorManager.md)
- [@ohos.application.formBindingData](reference/apis/js-apis-application-formBindingData.md)
- [@ohos.application.formError](reference/apis/js-apis-application-formError.md)
- [@ohos.application.formHost](reference/apis/js-apis-application-formHost.md)
- [@ohos.application.formInfo](reference/apis/js-apis-application-formInfo.md)
- [@ohos.application.formProvider](reference/apis/js-apis-application-formProvider.md)
- [@ohos.application.missionManager](reference/apis/js-apis-application-missionManager.md)
- [@ohos.application.Want](reference/apis/js-apis-application-want.md)
- [@ohos.wantAgent](reference/apis/js-apis-wantAgent.md)
- [@ohos.ability.dataUriUtils (DataUriUtils)](reference/apis/js-apis-ability-dataUriUtils.md)
- [@ohos.ability.errorCode (ErrorCode)](reference/apis/js-apis-ability-errorCode.md)
- [@ohos.ability.wantConstant (wantConstant)](reference/apis/js-apis-ability-wantConstant.md)
- [@ohos.application.abilityDelegatorRegistry (AbilityDelegatorRegistry)](reference/apis/js-apis-application-abilityDelegatorRegistry.md)
- [@ohos.application.abilityManager (AbilityManager)](reference/apis/js-apis-application-abilityManager.md)
- [@ohos.application.appManager (appManager)](reference/apis/js-apis-application-appManager.md)
- [@ohos.application.Configuration (Configuration)](reference/apis/js-apis-application-configuration.md)
- [@ohos.application.ConfigurationConstant (ConfigurationConstant)](reference/apis/js-apis-application-configurationConstant.md)
- [@ohos.application.errorManager (ErrorManager)](reference/apis/js-apis-application-errorManager.md)
- [@ohos.application.formBindingData (formBindingData)](reference/apis/js-apis-application-formBindingData.md)
- [@ohos.application.formError (FormError)](reference/apis/js-apis-application-formError.md)
- [@ohos.application.formHost (FormHost)](reference/apis/js-apis-application-formHost.md)
- [@ohos.application.formInfo (FormInfo)](reference/apis/js-apis-application-formInfo.md)
- [@ohos.application.formProvider (FormProvider)](reference/apis/js-apis-application-formProvider.md)
- [@ohos.application.missionManager (missionManager)](reference/apis/js-apis-application-missionManager.md)
- [@ohos.application.Want (Want)](reference/apis/js-apis-application-want.md)
- [@ohos.wantAgent (WantAgent)](reference/apis/js-apis-wantAgent.md)
- Dependent Elements and Definitions
- ability
- [abilityResult](reference/apis/js-apis-inner-ability-abilityResult.md)
......@@ -853,7 +856,6 @@
- [MissionListener](reference/apis/js-apis-inner-application-missionListener.md)
- [MissionParameter](reference/apis/js-apis-inner-application-missionParameter.md)
- [MissionSnapshot](reference/apis/js-apis-inner-application-missionSnapshot.md)
- [PermissionRequestResult](reference/apis/js-apis-inner-application-permissionRequestResult.md)
- [ProcessData](reference/apis/js-apis-inner-application-processData.md)
- [ProcessRunningInfo](reference/apis/js-apis-inner-application-processRunningInfo.md)
- [ProcessRunningInformation](reference/apis/js-apis-inner-application-processRunningInformation.md)
......@@ -869,24 +871,24 @@
- [continuationExtraParams](reference/apis/js-apis-continuation-continuationExtraParams.md)
- [continuationResult](reference/apis/js-apis-continuation-continuationResult.md)
- Common Event and Notification
- [@ohos.commonEventManager](reference/apis/js-apis-commonEventManager.md)
- [@ohos.events.emitter](reference/apis/js-apis-emitter.md)
- [@ohos.notificationManager (Recommended)](reference/apis/js-apis-notificationManager.md)
- [@ohos.notificationSubscribe (Recommended)](reference/apis/js-apis-notificationSubscribe.md)
- [@ohos.commonEvent (To Be Deprecated Soon)](reference/apis/js-apis-commonEvent.md)
- [@ohos.notification](reference/apis/js-apis-notification.md)
- [@ohos.commonEventManager (Common Event) (Recommended)](reference/apis/js-apis-commonEventManager.md)
- [@ohos.events.emitter (Emitter)](reference/apis/js-apis-emitter.md)
- [@ohos.notificationManager (NotificationManager) (Recommended)](reference/apis/js-apis-notificationManager.md)
- [@ohos.notificationSubscribe (NotificationSubscribe) (Recommended)](reference/apis/js-apis-notificationSubscribe.md)
- [@ohos.commonEvent (Common Event) (To Be Deprecated Soon)](reference/apis/js-apis-commonEvent.md)
- [@ohos.notification (Notification) (To Be Deprecated Soon)](reference/apis/js-apis-notification.md)
- application
- [EventHub](reference/apis/js-apis-inner-application-eventHub.md)
- Bundle Management
- [@ohos.bundle.appControl](reference/apis/js-apis-appControl.md)
- [@ohos.bundle.bundleManager](reference/apis/js-apis-bundleManager.md)
- [@ohos.bundle.bundleMonitor](reference/apis/js-apis-bundleMonitor.md)
- [@ohos.bundle.defaultAppManager](reference/apis/js-apis-defaultAppManager.md)
- [@ohos.bundle.distributedBundle](reference/apis/js-apis-distributedBundle.md)
- [@ohos.bundle.freeInstall](reference/apis/js-apis-freeInstall.md)
- [@ohos.bundle.installer](reference/apis/js-apis-installer.md)
- [@ohos.bundle.launcherBundleManager](reference/apis/js-apis-launcherBundleManager.md)
- [@ohos.zlib](reference/apis/js-apis-zlib.md)
- [@ohos.bundle.appControl(appControl)](reference/apis/js-apis-appControl.md)
- [@ohos.bundle.bundleManager (bundleManager)](reference/apis/js-apis-bundleManager.md)
- [@ohos.bundle.bundleMonitor (bundleMonitor)](reference/apis/js-apis-bundleMonitor.md)
- [@ohos.bundle.defaultAppManager (Default Application Management)](reference/apis/js-apis-defaultAppManager.md)
- [@ohos.bundle.distributedBundle (distributedBundle)](reference/apis/js-apis-distributedBundle.md)
- [@ohos.bundle.freeInstall (freeInstall)](reference/apis/js-apis-freeInstall.md)
- [@ohos.bundle.installer (installer)](reference/apis/js-apis-installer.md)
- [@ohos.bundle.launcherBundleManager (launcherBundleManager)](reference/apis/js-apis-launcherBundleManager.md)
- [@ohos.zlib (Zip)](reference/apis/js-apis-zlib.md)
- bundleManager
- [abilityInfo](reference/apis/js-apis-bundleManager-abilityInfo.md)
- [applicationInfo](reference/apis/js-apis-bundleManager-applicationInfo.md)
......@@ -902,231 +904,239 @@
- [remoteAbilityInfo](reference/apis/js-apis-bundleManager-remoteAbilityInfo.md)
- [shortcutInfo](reference/apis/js-apis-bundleManager-shortcutInfo.md)
- UI Page
- [@ohos.animator](reference/apis/js-apis-animator.md)
- [@ohos.curves](reference/apis/js-apis-curve.md)
- [@ohos.matrix4](reference/apis/js-apis-matrix4.md)
- [@ohos.mediaquery](reference/apis/js-apis-mediaquery.md)
- [@ohos.promptAction](reference/apis/js-apis-promptAction.md)
- [@ohos.router](reference/apis/js-apis-router.md)
- [@ohos.animator (Animator)](reference/apis/js-apis-animator.md)
- [@ohos.curves (Interpolation Calculation)](reference/apis/js-apis-curve.md)
- [@ohos.matrix4 (Matrix Transformation)](reference/apis/js-apis-matrix4.md)
- [@ohos.mediaquery (Media Query)](reference/apis/js-apis-mediaquery.md)
- [@ohos.promptAction (Prompt)](reference/apis/js-apis-promptAction.md)
- [@ohos.router (Page Routing)](reference/apis/js-apis-router.md)
- Graphics
- [@ohos.animation.windowAnimationManager](reference/apis/js-apis-windowAnimationManager.md)
- [@ohos.application.WindowExtensionAbility](reference/apis/js-apis-application-windowExtensionAbility.md)
- [@ohos.display](reference/apis/js-apis-display.md)
- [@ohos.effectKit](reference/apis/js-apis-effectKit.md)
- [@ohos.graphics.colorSpaceManager](reference/apis/js-apis-colorSpaceManager.md)
- [@ohos.screen](reference/apis/js-apis-screen.md)
- [@ohos.screenshot](reference/apis/js-apis-screenshot.md)
- [@ohos.window](reference/apis/js-apis-window.md)
- [@ohos.animation.windowAnimationManager (Window Animation Management)](reference/apis/js-apis-windowAnimationManager.md)
- [@ohos.application.WindowExtensionAbility (WindowExtensionAbility)](reference/apis/js-apis-application-windowExtensionAbility.md)
- [@ohos.display (Display)](reference/apis/js-apis-display.md)
- [@ohos.effectKit (Image Effects)](reference/apis/js-apis-effectKit.md)
- [@ohos.graphics.colorSpaceManager (Color Space Management)](reference/apis/js-apis-colorSpaceManager.md)
- [@ohos.screen (Screen)](reference/apis/js-apis-screen.md)
- [@ohos.screenshot (Screenshot)](reference/apis/js-apis-screenshot.md)
- [@ohos.window (Window)](reference/apis/js-apis-window.md)
- webgl
- [webgl](reference/apis/js-apis-webgl.md)
- [webgl2](reference/apis/js-apis-webgl2.md)
- [WebGL](reference/apis/js-apis-webgl.md)
- [WebGL2](reference/apis/js-apis-webgl2.md)
- Media
- [@ohos.multimedia.audio](reference/apis/js-apis-audio.md)
- [@ohos.multimedia.avsession](reference/apis/js-apis-avsession.md)
- [@ohos.multimedia.camera](reference/apis/js-apis-camera.md)
- [@ohos.multimedia.image](reference/apis/js-apis-image.md)
- [@ohos.multimedia.media](reference/apis/js-apis-media.md)
- [@ohos.multimedia.audio (Audio Management)](reference/apis/js-apis-audio.md)
- [@ohos.multimedia.avsession (AVSession Management)](reference/apis/js-apis-avsession.md)
- [@ohos.multimedia.camera (Camera Management)](reference/apis/js-apis-camera.md)
- [@ohos.multimedia.image (Image Processing)](reference/apis/js-apis-image.md)
- [@ohos.multimedia.media (Media)](reference/apis/js-apis-media.md)
- Resource Management
- [@ohos.i18n](reference/apis/js-apis-i18n.md)
- [@ohos.intl](reference/apis/js-apis-intl.md)
- [@ohos.resourceManager](reference/apis/js-apis-resource-manager.md)
- [@ohos.i18n (Internationalization)](reference/apis/js-apis-i18n.md)
- [@ohos.intl (Internationalization)](reference/apis/js-apis-intl.md)
- [@ohos.resourceManager (Resource Manager)](reference/apis/js-apis-resource-manager.md)
- Resource Scheduling
- [@ohos.reminderAgentManager](reference/apis/js-apis-reminderAgentManager.md)
- [@ohos.resourceschedule.backgroundTaskManager](reference/apis/js-apis-resourceschedule-backgroundTaskManager.md)
- [@ohos.resourceschedule.workScheduler](reference/apis/js-apis-resourceschedule-workScheduler.md)
- [@ohos.WorkSchedulerExtensionAbility](reference/apis/js-apis-WorkSchedulerExtensionAbility.md)
- [@ohos.distributedMissionManager (Distributed Mission Management)](reference/apis/js-apis-distributedMissionManager.md)
- [@ohos.reminderAgentManager (Reminder Agent Management)](reference/apis/js-apis-reminderAgentManager.md)
- [@ohos.resourceschedule.backgroundTaskManager (Background Task Management)](reference/apis/js-apis-resourceschedule-backgroundTaskManager.md)
- [@ohos.resourceschedule.workScheduler (Work Scheduler)](reference/apis/js-apis-resourceschedule-workScheduler.md)
- [@ohos.resourceschedule.usageStatistics (Device Usage Statistics)](reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md)
- [@ohos.WorkSchedulerExtensionAbility (Work Scheduler Callbacks)](reference/apis/js-apis-WorkSchedulerExtensionAbility.md)
- Security
- [@ohos.abilityAccessCtrl](reference/apis/js-apis-abilityAccessCtrl.md)
- [@ohos.privacyManager](reference/apis/js-apis-privacyManager.md)
- [@ohos.security.cryptoFramework](reference/apis/js-apis-cryptoFramework.md)
- [@ohos.security.huks](reference/apis/js-apis-huks.md)
- [@ohos.userIAM.faceAuth](reference/apis/js-apis-useriam-faceauth.md)
- [@ohos.userIAM.userAuth](reference/apis/js-apis-useriam-userauth.md)
- [@system.cipher](reference/apis/js-apis-system-cipher.md)
- [@ohos.abilityAccessCtrl (Ability Access Control)](reference/apis/js-apis-abilityAccessCtrl.md)
- [@ohos.privacyManager (Privacy Management)](reference/apis/js-apis-privacyManager.md)
- [@ohos.security.cert (Certificate)](reference/apis/js-apis-cert.md)
- [@ohos.security.cryptoFramework (Crypto Framework)](reference/apis/js-apis-cryptoFramework.md)
- [@ohos.security.huks (HUKS)](reference/apis/js-apis-huks.md)
- [@ohos.userIAM.faceAuth (Facial Authentication)](reference/apis/js-apis-useriam-faceauth.md)
- [@ohos.userIAM.userAuth (User Authentication)](reference/apis/js-apis-useriam-userauth.md)
- [@system.cipher (Cipher Algorithm)](reference/apis/js-apis-system-cipher.md)
- security
- [PermissionRequestResult](reference/apis/js-apis-permissionrequestresult.md)
- Data Management
- [@ohos.data.dataAbility](reference/apis/js-apis-data-ability.md)
- [@ohos.data.dataShare](reference/apis/js-apis-data-dataShare.md)
- [@ohos.data.dataSharePredicates](reference/apis/js-apis-data-dataSharePredicates.md)
- [@ohos.data.dataShareResultSet](reference/apis/js-apis-data-DataShareResultSet.md)
- [@ohos.data.distributedDataObject](reference/apis/js-apis-data-distributedobject.md)
- [@ohos.data.distributedKVStore](reference/apis/js-apis-distributedKVStore.md)
- [@ohos.data.preferences](reference/apis/js-apis-data-preferences.md)
- [@ohos.data.rdb](reference/apis/js-apis-data-rdb.md)
- [@ohos.data.dataAbility (DataAbility Predicates)](reference/apis/js-apis-data-ability.md)
- [@ohos.data.dataShare (DataShare)](reference/apis/js-apis-data-dataShare.md)
- [@ohos.data.dataSharePredicates (DataShare Predicates)](reference/apis/js-apis-data-dataSharePredicates.md)
- [@ohos.data.dataShareResultSet (DataShare Result Set)](reference/apis/js-apis-data-DataShareResultSet.md)
- [@ohos.data.distributedDataObject (Distributed Data Object)](reference/apis/js-apis-data-distributedobject.md)
- [@ohos.data.distributedKVStore (Distributed KV Store)](reference/apis/js-apis-distributedKVStore.md)
- [@ohos.data.preferences (Preferences)](reference/apis/js-apis-data-preferences.md)
- [@ohos.data.relationalStore (RDB Store)](reference/apis/js-apis-data-relationalStore.md)
- [@ohos.data.ValuesBucket](reference/apis/js-apis-data-valuesBucket.md)
- data/rdb
- [resultSet](reference/apis/js-apis-data-resultset.md)
- [resultSet (Result Set)](reference/apis/js-apis-data-resultset.md)
- File Management
- [@ohos.environment](reference/apis/js-apis-environment.md)
- [@ohos.data.fileAccess](reference/apis/js-apis-fileAccess.md)
- [@ohos.fileExtensionInfo](reference/apis/js-apis-fileExtensionInfo.md)
- [@ohos.fileio](reference/apis/js-apis-fileio.md)
- [@ohos.filemanagement.userFileManager](reference/apis/js-apis-userFileManager.md)
- [@ohos.multimedia.medialibrary](reference/apis/js-apis-medialibrary.md)
- [@ohos.securityLabel](reference/apis/js-apis-securityLabel.md)
- [@ohos.statfs](reference/apis/js-apis-statfs.md)
- [@ohos.storageStatistics](reference/apis/js-apis-storage-statistics.md)
- [@ohos.volumeManager](reference/apis/js-apis-volumemanager.md)
- [@ohos.file.environment (Directory Environment Capability)](reference/apis/js-apis-file-environment.md)
- [@ohos.file.fileAccess (User File Access and Management)](reference/apis/js-apis-fileAccess.md)
- [@ohos.file.fileExtensionInfo (User File Extension Information)](reference/apis/js-apis-fileExtensionInfo.md)
- [@ohos.file.fs (File Management)](reference/apis/js-apis-file-fs.md)
- [@ohos.file.hash (File Hash Processing)](reference/apis/js-apis-file-hash.md)
- [@ohos.file.securityLabel (Data Label)](reference/apis/js-apis-file-securityLabel.md)
- [@ohos.file.statvfs (File System Space Statistics)](reference/apis/js-apis-file-statvfs.md)
- [@ohos.filemanagement.userFileManager (User Data Management)](reference/apis/js-apis-userFileManager.md)
- [@ohos.multimedia.medialibrary (Media Library Management)](reference/apis/js-apis-medialibrary.md)
- [@ohos.storageStatistics (Application Storage Statistics)](reference/apis/js-apis-storage-statistics.md)
- [@ohos.volumeManager (Volume Management)](reference/apis/js-apis-volumemanager.md)
- Telephony Service
- [@ohos.contact](reference/apis/js-apis-contact.md)
- [@ohos.telephony.call](reference/apis/js-apis-call.md)
- [@ohos.telephony.data](reference/apis/js-apis-telephony-data.md)
- [@ohos.telephony.observer](reference/apis/js-apis-observer.md)
- [@ohos.telephony.radio](reference/apis/js-apis-radio.md)
- [@ohos.telephony.sim](reference/apis/js-apis-sim.md)
- [@ohos.telephony.sms](reference/apis/js-apis-sms.md)
- [@ohos.contact (Contacts)](reference/apis/js-apis-contact.md)
- [@ohos.telephony.call (Call)](reference/apis/js-apis-call.md)
- [@ohos.telephony.data (Cellular Data)](reference/apis/js-apis-telephony-data.md)
- [@ohos.telephony.observer (Observer)](reference/apis/js-apis-observer.md)
- [@ohos.telephony.radio (Network Search)](reference/apis/js-apis-radio.md)
- [@ohos.telephony.sim (SIM Management)](reference/apis/js-apis-sim.md)
- [@ohos.telephony.sms (SMS)](reference/apis/js-apis-sms.md)
- Network Management
- [@ohos.net.connection](reference/apis/js-apis-net-connection.md)
- [@ohos.net.ethernet](reference/apis/js-apis-net-ethernet.md)
- [@ohos.net.http](reference/apis/js-apis-http.md)
- [@ohos.net.sharing](reference/apis/js-apis-net-sharing.md)
- [@ohos.net.socket](reference/apis/js-apis-socket.md)
- [@ohos.net.webSocket](reference/apis/js-apis-webSocket.md)
- [@ohos.request](reference/apis/js-apis-request.md)
- [@ohos.net.connection (Network Connection Management)](reference/apis/js-apis-net-connection.md)
- [@ohos.net.ethernet (Ethernet Connection Management)](reference/apis/js-apis-net-ethernet.md)
- [@ohos.net.http (Data Request)](reference/apis/js-apis-http.md)
- [@ohos.net.sharing (Network Sharing)](reference/apis/js-apis-net-sharing.md)
- [@ohos.net.socket (Socket Connection)](reference/apis/js-apis-socket.md)
- [@ohos.net.webSocket (WebSocket Connection)](reference/apis/js-apis-webSocket.md)
- [@ohos.request (Upload and Download)](reference/apis/js-apis-request.md)
- Connectivity
- [@ohos.bluetooth](reference/apis/js-apis-bluetooth.md)
- [@ohos.connectedTag](reference/apis/js-apis-connectedTag.md)
- [@ohos.nfc.cardEmulation](reference/apis/js-apis-cardEmulation.md)
- [@ohos.nfc.controller](reference/apis/js-apis-nfcController.md)
- [@ohos.nfc.tag](reference/apis/js-apis-nfcTag.md)
- [@ohos.rpc](reference/apis/js-apis-rpc.md)
- [@ohos.wifiManager (Recommended)](reference/apis/js-apis-wifiManager.md)
- [@ohos.wifiManagerExt (Recommended)](reference/apis/js-apis-wifiManagerExt.md)
- [@ohos.wifi (To Be Deprecated Soon)](reference/apis/js-apis-wifi.md)
- [@ohos.wifiext (To Be Deprecated Soon)](reference/apis/js-apis-wifiext.md)
- [@ohos.bluetooth (Bluetooth)](reference/apis/js-apis-bluetooth.md)
- [@ohos.connectedTag (Active Tags)](reference/apis/js-apis-connectedTag.md)
- [@ohos.nfc.cardEmulation (Standard NFC Card Emulation)](reference/apis/js-apis-cardEmulation.md)
- [@ohos.nfc.controller (Standard NFC)](reference/apis/js-apis-nfcController.md)
- [@ohos.nfc.tag (Standard NFC Tags)](reference/apis/js-apis-nfcTag.md)
- [@ohos.rpc (RPC)](reference/apis/js-apis-rpc.md)
- [@ohos.wifiManager (WLAN)](reference/apis/js-apis-wifiManager.md)
- [@ohos.wifiManagerExt (WLAN Extension)](reference/apis/js-apis-wifiManagerExt.md)
- [@ohos.wifi (To Be Deprecated)](reference/apis/js-apis-wifi.md)
- [@ohos.wifiext (To Be Deprecated)](reference/apis/js-apis-wifiext.md)
- tag
- [nfctech](reference/apis/js-apis-nfctech.md)
- [tagSession](reference/apis/js-apis-tagSession.md)
- [nfctech (Standard NFC Technologies)](reference/apis/js-apis-nfctech.md)
- [tagSession (Standard NFC Tag Session)](reference/apis/js-apis-tagSession.md)
- Basic Features
- [@ohos.accessibility](reference/apis/js-apis-accessibility.md)
- [@ohos.accessibility.config](reference/apis/js-apis-accessibility-config.md)
- [@ohos.accessibility.GesturePath](reference/apis/js-apis-accessibility-GesturePath.md)
- [@ohos.accessibility.GesturePoint](reference/apis/js-apis-accessibility-GesturePoint.md)
- [@ohos.application.AccessibilityExtensionAbility](reference/apis/js-apis-application-accessibilityExtensionAbility.md)
- [@ohos.faultLogger](reference/apis/js-apis-faultLogger.md)
- [@ohos.hichecker](reference/apis/js-apis-hichecker.md)
- [@ohos.hidebug](reference/apis/js-apis-hidebug.md)
- [@ohos.hilog](reference/apis/js-apis-hilog.md)
- [@ohos.hiSysEvent](reference/apis/js-apis-hisysevent.md)
- [@ohos.hiTraceChain](reference/apis/js-apis-hitracechain.md)
- [@ohos.hiTraceMeter](reference/apis/js-apis-hitracemeter.md)
- [@ohos.hiviewdfx.hiAppEvent](reference/apis/js-apis-hiviewdfx-hiappevent.md)
- [@ohos.inputmethod](reference/apis/js-apis-inputmethod.md)
- [@ohos.inputmethodengine](reference/apis/js-apis-inputmethodengine.md)
- [@ohos.inputmethodextensionability](reference/apis/js-apis-inputmethod-extension-ability.md)
- [@ohos.inputmethodextensioncontext](reference/apis/js-apis-inputmethod-extension-context.md)
- [@ohos.inputmethodsubtype](reference/apis/js-apis-inputmethod-subtype.md)
- [@ohos.pasteboard](reference/apis/js-apis-pasteboard.md)
- [@ohos.screenLock](reference/apis/js-apis-screen-lock.md)
- [@ohos.systemTime](reference/apis/js-apis-system-time.md)
- [@ohos.systemTimer](reference/apis/js-apis-system-timer.md)
- [@ohos.wallpaper](reference/apis/js-apis-wallpaper.md)
- [@ohos.web.webview](reference/apis/js-apis-webview.md)
- [console](reference/apis/js-apis-logs.md)
- [@ohos.accessibility (Accessibility)](reference/apis/js-apis-accessibility.md)
- [@ohos.accessibility.config (System Accessibility Configuration)](reference/apis/js-apis-accessibility-config.md)
- [@ohos.accessibility.GesturePath (Gesture Path)](reference/apis/js-apis-accessibility-GesturePath.md)
- [@ohos.accessibility.GesturePoint (Gesture Point)](reference/apis/js-apis-accessibility-GesturePoint.md)
- [@ohos.application.AccessibilityExtensionAbility (AccessibilityExtensionAbility)](reference/apis/js-apis-application-accessibilityExtensionAbility.md)
- [@ohos.faultLogger (FaultLogger)](reference/apis/js-apis-faultLogger.md)
- [@ohos.hichecker (HiChecker)](reference/apis/js-apis-hichecker.md)
- [@ohos.hidebug (HiDebug)](reference/apis/js-apis-hidebug.md)
- [@ohos.hilog (HiLog)](reference/apis/js-apis-hilog.md)
- [@ohos.hiSysEvent (System Event Logging)](reference/apis/js-apis-hisysevent.md)
- [@ohos.hiTraceChain (Distributed Call Chain Tracing)](reference/apis/js-apis-hitracechain.md)
- [@ohos.hiTraceMeter (Performance Tracing)](reference/apis/js-apis-hitracemeter.md)
- [@ohos.hiviewdfx.hiAppEvent (Application Event Logging)](reference/apis/js-apis-hiviewdfx-hiappevent.md)
- [@ohos.inputMethod (Input Method Framework)](reference/apis/js-apis-inputmethod.md)
- [@ohos.inputMethodEngine (Input Method Service)](reference/apis/js-apis-inputmethodengine.md)
- [@ohos.InputMethodExtensionAbility (InputMethodExtensionAbility)](reference/apis/js-apis-inputmethod-extension-ability.md)
- [@ohos.InputMethodExtensionContext (InputMethodExtensionContext)](reference/apis/js-apis-inputmethod-extension-context.md)
- [@ohos.InputMethodSubtype (Input Method Subtype)](reference/apis/js-apis-inputmethod-subtype.md)
- [@ohos.pasteboard (Pasteboard)](reference/apis/js-apis-pasteboard.md)
- [@ohos.screenLock (Screenlock)](reference/apis/js-apis-screen-lock.md)
- [@ohos.systemDateTime (System Time and Time Zone)](reference/apis/js-apis-system-date-time.md)
- [@ohos.systemTimer (System Timer)](reference/apis/js-apis-system-timer.md)
- [@ohos.wallpaper (Wallpaper)](reference/apis/js-apis-wallpaper.md)
- [@ohos.web.webview (Webview)](reference/apis/js-apis-webview.md)
- [console (Log)](reference/apis/js-apis-logs.md)
- [Timer](reference/apis/js-apis-timer.md)
- application
- [AccessibilityExtensionContext](reference/apis/js-apis-inner-application-accessibilityExtensionContext.md)
- Device Management
- [@ohos.batteryInfo](reference/apis/js-apis-battery-info.md)
- [@ohos.batteryStatistics](reference/apis/js-apis-batteryStatistics.md)
- [@ohos.brightness](reference/apis/js-apis-brightness.md)
- [@ohos.deviceInfo](reference/apis/js-apis-device-info.md)
- [@ohos.distributedHardware.deviceManager](reference/apis/js-apis-device-manager.md)
- [@ohos.geoLocationManager](reference/apis/js-apis-geoLocationManager.md)
- [@ohos.multimodalInput.inputConsumer](reference/apis/js-apis-inputconsumer.md)
- [@ohos.multimodalInput.inputDevice](reference/apis/js-apis-inputdevice.md)
- [@ohos.multimodalInput.inputDeviceCooperate](reference/apis/js-apis-cooperate.md)
- [@ohos.multimodalInput.inputEvent](reference/apis/js-apis-inputevent.md)
- [@ohos.multimodalInput.inputEventClient](reference/apis/js-apis-inputeventclient.md)
- [@ohos.multimodalInput.inputMonitor](reference/apis/js-apis-inputmonitor.md)
- [@ohos.multimodalInput.keyCode](reference/apis/js-apis-keycode.md)
- [@ohos.multimodalInput.keyEvent](reference/apis/js-apis-keyevent.md)
- [@ohos.multimodalInput.mouseEvent](reference/apis/js-apis-mouseevent.md)
- [@ohos.multimodalInput.pointer](reference/apis/js-apis-pointer.md)
- [@ohos.multimodalInput.touchEvent](reference/apis/js-apis-touchevent.md)
- [@ohos.power](reference/apis/js-apis-power.md)
- [@ohos.resourceschedule.usageStatistics](reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md)
- [@ohos.runningLock](reference/apis/js-apis-runninglock.md)
- [@ohos.sensor](reference/apis/js-apis-sensor.md)
- [@ohos.settings](reference/apis/js-apis-settings.md)
- [@ohos.stationary](reference/apis/js-apis-stationary.md)
- [@ohos.systemCapability](reference/apis/js-apis-system-capability.md)
- [@ohos.systemParameterV9](reference/apis/js-apis-system-parameterV9.md)
- [@ohos.thermal](reference/apis/js-apis-thermal.md)
- [@ohos.update](reference/apis/js-apis-update.md)
- [@ohos.usb](reference/apis/js-apis-usb.md)
- [@ohos.vibrator](reference/apis/js-apis-vibrator.md)
- [@ohos.batteryInfo (Battery Information)](reference/apis/js-apis-battery-info.md)
- [@ohos.batteryStatistics (Battery Statistics)](reference/apis/js-apis-batteryStatistics.md)
- [@ohos.brightness (Screen Brightness)](reference/apis/js-apis-brightness.md)
- [@ohos.deviceInfo (Device Information)](reference/apis/js-apis-device-info.md)
- [@ohos.distributedHardware.deviceManager (Device Management)](reference/apis/js-apis-device-manager.md)
- [@ohos.geoLocationManager (Geolocation Manager)](reference/apis/js-apis-geoLocationManager.md)
- [@ohos.multimodalInput.inputConsumer (Input Consumer)](reference/apis/js-apis-inputconsumer.md)
- [@ohos.multimodalInput.inputDevice (Input Device)](reference/apis/js-apis-inputdevice.md)
- [@ohos.multimodalInput.inputDeviceCooperate (Screen Hopping)](reference/apis/js-apis-cooperate.md)
- [@ohos.multimodalInput.inputEvent (Input Event)](reference/apis/js-apis-inputevent.md)
- [@ohos.multimodalInput.inputEventClient (Key Event Injection)](reference/apis/js-apis-inputeventclient.md)
- [@ohos.multimodalInput.inputMonitor (Input Monitor)](reference/apis/js-apis-inputmonitor.md)
- [@ohos.multimodalInput.keyCode (Key Code)](reference/apis/js-apis-keycode.md)
- [@ohos.multimodalInput.keyEvent (Key Event)](reference/apis/js-apis-keyevent.md)
- [@ohos.multimodalInput.mouseEvent (Mouse Event)](reference/apis/js-apis-mouseevent.md)
- [@ohos.multimodalInput.pointer (Mouse Pointer)](reference/apis/js-apis-pointer.md)
- [@ohos.multimodalInput.touchEvent (Touch Event)](reference/apis/js-apis-touchevent.md)
- [@ohos.power (System Power Management)](reference/apis/js-apis-power.md)
- [@ohos.runningLock (Runninglock)](reference/apis/js-apis-runninglock.md)
- [@ohos.sensor (Sensor)](reference/apis/js-apis-sensor.md)
- [@ohos.settings (Data Item Settings)](reference/apis/js-apis-settings.md)
- [@ohos.stationary (Device Status Awareness Framework)](reference/apis/js-apis-stationary.md)
- [@ohos.systemCapability (SystemCapability)](reference/apis/js-apis-system-capability.md)
- [@ohos.systemParameterV9 (System Parameter)](reference/apis/js-apis-system-parameterV9.md)
- [@ohos.thermal (Thermal Management)](reference/apis/js-apis-thermal.md)
- [@ohos.update (Update)](reference/apis/js-apis-update.md)
- [@ohos.usbV9 (USB Management)](reference/apis/js-apis-usb.md)
- [@ohos.vibrator (Vibrator)](reference/apis/js-apis-vibrator.md)
- Account Management
- [@ohos.account.appAccount](reference/apis/js-apis-appAccount.md)
- [@ohos.account.distributedAccount](reference/apis/js-apis-distributed-account.md)
- [@ohos.account.osAccount](reference/apis/js-apis-osAccount.md)
- [@ohos.account.appAccount (App Account Management)](reference/apis/js-apis-appAccount.md)
- [@ohos.account.distributedAccount (Distributed Account Management)](reference/apis/js-apis-distributed-account.md)
- [@ohos.account.osAccount (OS Account Management)](reference/apis/js-apis-osAccount.md)
- Custom Management
- [@ohos.configPolicy](reference/apis/js-apis-configPolicy.md)
- [@ohos.enterprise.deviceInfo](reference/apis/js-apis-enterprise-deviceInfo.md)
- [@ohos.enterprise.EnterpriseAdminExtensionAbility](reference/apis/js-apis-EnterpriseAdminExtensionAbility.md)
- [@ohos.enterprise.adminManager](reference/apis/js-apis-enterprise-adminManager.md)
- [@ohos.enterprise.dateTimeManager](reference/apis/js-apis-enterprise-dateTimeManager.md)
- [@ohos.configPolicy (Configuration Policy)](reference/apis/js-apis-configPolicy.md)
- [@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)](reference/apis/js-apis-EnterpriseAdminExtensionAbility.md)
- [@ohos.enterprise.adminManager (Enterprise Device Management)](reference/apis/js-apis-enterprise-adminManager.md)
- [@ohos.enterprise.dateTimeManager (System Time Management)](reference/apis/js-apis-enterprise-dateTimeManager.md)
- Language Base Class Library
- [@ohos.buffer](reference/apis/js-apis-buffer.md)
- [@ohos.convertxml](reference/apis/js-apis-convertxml.md)
- [@ohos.process](reference/apis/js-apis-process.md)
- [@ohos.uri](reference/apis/js-apis-uri.md)
- [@ohos.url](reference/apis/js-apis-url.md)
- [@ohos.util](reference/apis/js-apis-util.md)
- [@ohos.util.ArrayList](reference/apis/js-apis-arraylist.md)
- [@ohos.util.Deque](reference/apis/js-apis-deque.md)
- [@ohos.util.HashMap](reference/apis/js-apis-hashmap.md)
- [@ohos.util.HashSet](reference/apis/js-apis-hashset.md)
- [@ohos.util.LightWeightMap](reference/apis/js-apis-lightweightmap.md)
- [@ohos.util.LightWeightSet](reference/apis/js-apis-lightweightset.md)
- [@ohos.util.LinkedList](reference/apis/js-apis-linkedlist.md)
- [@ohos.util.List](reference/apis/js-apis-list.md)
- [@ohos.util.PlainArray](reference/apis/js-apis-plainarray.md)
- [@ohos.util.Queue](reference/apis/js-apis-queue.md)
- [@ohos.util.Stack](reference/apis/js-apis-stack.md)
- [@ohos.util.TreeMap](reference/apis/js-apis-treemap.md)
- [@ohos.util.TreeSet](reference/apis/js-apis-treeset.md)
- [@ohos.util.Vector](reference/apis/js-apis-vector.md)
- [@ohos.worker](reference/apis/js-apis-worker.md)
- [@ohos.xml](reference/apis/js-apis-xml.md)
- [@ohos.buffer (Buffer)](reference/apis/js-apis-buffer.md)
- [@ohos.convertxml (XML-to-JavaScript Conversion)](reference/apis/js-apis-convertxml.md)
- [@ohos.process (Obtaining Process Information)](reference/apis/js-apis-process.md)
- [@ohos.taskpool (Using the Task Pool)](reference/apis/js-apis-taskpool.md)
- [@ohos.uri (URI String Parsing)](reference/apis/js-apis-uri.md)
- [@ohos.url (URL String Parsing)](reference/apis/js-apis-url.md)
- [@ohos.util (util)](reference/apis/js-apis-util.md)
- [@ohos.util.ArrayList (Linear Container ArrayList)](reference/apis/js-apis-arraylist.md)
- [@ohos.util.Deque (Linear Container Deque)](reference/apis/js-apis-deque.md)
- [@ohos.util.HashMap (Nonlinear Container HashMap)](reference/apis/js-apis-hashmap.md)
- [@ohos.util.HashSet (Nonlinear Container HashSet)](reference/apis/js-apis-hashset.md)
- [@ohos.util.LightWeightMap (Nonlinear Container LightWeightMap)](reference/apis/js-apis-lightweightmap.md)
- [@ohos.util.LightWeightSet (Nonlinear Container LightWeightSet)](reference/apis/js-apis-lightweightset.md)
- [@ohos.util.LinkedList (Linear Container LinkedList)](reference/apis/js-apis-linkedlist.md)
- [@ohos.util.List (Linear Container List)](reference/apis/js-apis-list.md)
- [@ohos.util.PlainArray (Nonlinear Container PlainArray)](reference/apis/js-apis-plainarray.md)
- [@ohos.util.Queue (Linear Container Queue)](reference/apis/js-apis-queue.md)
- [@ohos.util.Stack (Linear Container Stack)](reference/apis/js-apis-stack.md)
- [@ohos.util.TreeMap (Nonlinear Container TreeMap)](reference/apis/js-apis-treemap.md)
- [@ohos.util.TreeSet (Nonlinear Container TreeSet)](reference/apis/js-apis-treeset.md)
- [@ohos.util.Vector (Linear Container Vector)](reference/apis/js-apis-vector.md)
- [@ohos.worker (Worker Startup)](reference/apis/js-apis-worker.md)
- [@ohos.xml (XML Parsing and Generation)](reference/apis/js-apis-xml.md)
- Test
- [@ohos.application.testRunner (TestRunner)](reference/apis/js-apis-application-testRunner.md)
- [@ohos.uitest](reference/apis/js-apis-uitest.md)
- APIs No Longer Maintained
- [@ohos.backgroundTaskManager](reference/apis/js-apis-backgroundTaskManager.md)
- [@ohos.bundle](reference/apis/js-apis-Bundle.md)
- [@ohos.bundle.innerBundleManager](reference/apis/js-apis-Bundle-InnerBundleManager.md)
- [@ohos.bundleState](reference/apis/js-apis-deviceUsageStatistics.md)
- [@ohos.bytrace](reference/apis/js-apis-bytrace.md)
- [@ohos.data.storage](reference/apis/js-apis-data-storage.md)
- [@ohos.data.distributedData](reference/apis/js-apis-distributed-data.md)
- [@ohos.distributedBundle](reference/apis/js-apis-Bundle-distributedBundle.md)
- [@ohos.document](reference/apis/js-apis-document.md)
- [@ohos.geolocation](reference/apis/js-apis-geolocation.md)
- [@ohos.hiAppEvent](reference/apis/js-apis-hiappevent.md)
- [@ohos.prompt](reference/apis/js-apis-prompt.md)
- [@ohos.reminderAgent](reference/apis/js-apis-reminderAgent.md)
- [@ohos.systemParameter](reference/apis/js-apis-system-parameter.md)
- [@ohos.usb](reference/apis/js-apis-usb-deprecated.md)
- [@ohos.workScheduler](reference/apis/js-apis-workScheduler.md)
- [@system.app](reference/apis/js-apis-system-app.md)
- [@system.battery](reference/apis/js-apis-system-battery.md)
- [@system.bluetooth](reference/apis/js-apis-system-bluetooth.md)
- [@system.brightness](reference/apis/js-apis-system-brightness.md)
- [@system.configuration](reference/apis/js-apis-system-configuration.md)
- [@system.device](reference/apis/js-apis-system-device.md)
- [@system.fetch](reference/apis/js-apis-system-fetch.md)
- [@system.file](reference/apis/js-apis-system-file.md)
- [@system.geolocation](reference/apis/js-apis-system-location.md)
- [@system.mediaquery](reference/apis/js-apis-system-mediaquery.md)
- [@system.network](reference/apis/js-apis-system-network.md)
- [@system.notification](reference/apis/js-apis-system-notification.md)
- [@system.package](reference/apis/js-apis-system-package.md)
- [@system.prompt](reference/apis/js-apis-system-prompt.md)
- [@system.request](reference/apis/js-apis-system-request.md)
- [@system.router](reference/apis/js-apis-system-router.md)
- [@system.sensor](reference/apis/js-apis-system-sensor.md)
- [@system.storage](reference/apis/js-apis-system-storage.md)
- [@system.vibrator](reference/apis/js-apis-system-vibrate.md)
- [@ohos.backgroundTaskManager (Background Task Management)](reference/apis/js-apis-backgroundTaskManager.md)
- [@ohos.bundle (Bundle)](reference/apis/js-apis-Bundle.md)
- [@ohos.bundle.innerBundleManager (innerBundleManager)](reference/apis/js-apis-Bundle-InnerBundleManager.md)
- [@ohos.bundleState (Device Usage Statistics)](reference/apis/js-apis-deviceUsageStatistics.md)
- [@ohos.bytrace (Performance Tracing)](reference/apis/js-apis-bytrace.md)
- [@ohos.data.distributedData (Distributed Data Management)](reference/apis/js-apis-distributed-data.md)
- [@ohos.data.storage (Lightweight Data Storage)](reference/apis/js-apis-data-storage.md)
- [@ohos.data.rdb (RDB)](reference/apis/js-apis-data-rdb.md)
- [@ohos.distributedBundle (Distributed Bundle Management)](reference/apis/js-apis-Bundle-distributedBundle.md)
- [@ohos.document (File Operation)](reference/apis/js-apis-document.md)
- [@ohos.fileio (File Management)](reference/apis/js-apis-fileio.md)
- [@ohos.geolocation (Geolocation)](reference/apis/js-apis-geolocation.md)
- [@ohos.hiAppEvent (Application Event Logging)](reference/apis/js-apis-hiappevent.md)
- [@ohos.prompt (Prompt)](reference/apis/js-apis-prompt.md)
- [@ohos.reminderAgent (Reminder Agent)](reference/apis/js-apis-reminderAgent.md)
- [@ohos.statfs (statfs)](reference/apis/js-apis-statfs.md)
- [@ohos.systemParameter (System Parameter)](reference/apis/js-apis-system-parameter.md)
- [@ohos.systemTime (System Time and Time Zone)](reference/apis/js-apis-system-time.md)
- [@ohos.usb (USB Management)](reference/apis/js-apis-usb-deprecated.md)
- [@system.app (Application Context)](reference/apis/js-apis-system-app.md)
- [@system.battery (Battery Information)](reference/apis/js-apis-system-battery.md)
- [@system.bluetooth (Bluetooth)](reference/apis/js-apis-system-bluetooth.md)
- [@system.brightness (Screen Brightness)](reference/apis/js-apis-system-brightness.md)
- [@system.configuration (Application Configuration)](reference/apis/js-apis-system-configuration.md)
- [@system.device (Device Information)](reference/apis/js-apis-system-device.md)
- [@system.fetch (Data Request)](reference/apis/js-apis-system-fetch.md)
- [@system.file (File Storage)](reference/apis/js-apis-system-file.md)
- [@system.geolocation (Geographic Location)](reference/apis/js-apis-system-location.md)
- [@system.mediaquery (Media Query)](reference/apis/js-apis-system-mediaquery.md)
- [@system.network (Network State)](reference/apis/js-apis-system-network.md)
- [@system.notification (Notification)](reference/apis/js-apis-system-notification.md)
- [@system.package (Bundle Management)](reference/apis/js-apis-system-package.md)
- [@system.prompt (Prompt)](reference/apis/js-apis-system-prompt.md)
- [@system.request (Upload and Download)](reference/apis/js-apis-system-request.md)
- [@system.router (Page Routing)](reference/apis/js-apis-system-router.md)
- [@system.sensor (Sensor)](reference/apis/js-apis-system-sensor.md)
- [@system.storage (Data Storage)](reference/apis/js-apis-system-storage.md)
- [@system.vibrator (Vibrator)](reference/apis/js-apis-system-vibrate.md)
- bundle
- [abilityInfo](reference/apis/js-apis-bundle-AbilityInfo.md)
- [applicationInfo](reference/apis/js-apis-bundle-ApplicationInfo.md)
......@@ -1175,6 +1185,8 @@
- Security
- [Ability Access Control Error Codes](reference/errorcodes/errorcode-access-token.md)
- [HUKS Error Codes](reference/errorcodes/errorcode-huks.md)
- [Crypto Framework Error Codes](reference/errorcodes/errorcode-crypto-framework.md)
- [Certificate Error Codes](reference/errorcodes/errorcode-cert.md)
- [User Authentication Error Codes](reference/errorcodes/errorcode-useriam.md)
- Data Management
- [RDB Error Codes](reference/errorcodes/errorcode-data-rdb.md)
......@@ -1197,7 +1209,7 @@
- [HiDebug Error Codes](reference/errorcodes/errorcode-hiviewdfx-hidebug.md)
- [Input Method Framework Error Codes](reference/errorcodes/errorcode-inputmethod-framework.md)
- [Pasteboard Error Codes](reference/errorcodes/errorcode-pasteboard.md)
- [Screen Lock Management Error Codes](reference/errorcodes/errorcode-screenlock.md)
- [Time and Time Zone Service Error Codes](reference/errorcodes/errorcode-time.md)
- [Webview Error Codes](reference/errorcodes/errorcode-webview.md)
- Account Management
- [Account Error Codes](reference/errorcodes/errorcode-account.md)
......@@ -1220,8 +1232,7 @@
- Customization Management
- [Enterprise Device Management Error Codes](reference/errorcodes/errorcode-enterpriseDeviceManager.md)
- Language Base Class Library
- [Buffer Error Codes](reference/errorcodes/errorcode-buffer.md)
- [Containers Error Codes](reference/errorcodes/errorcode-containers.md)
- [Utils Error Codes](reference/errorcodes/errorcode-utils.md)
- Test
- [UiTest Error Codes](reference/errorcodes/errorcode-uitest.md)
- Native APIs
......
# OpenHarmony 3.2 Beta5
## Version Description
OpenHarmony 3.2 Beta5 provides the following enhancements over OpenHarmony 3.2 Beta4:
**Enhanced basic capabilities for the standard system**
The startup performance of the WebView component is optimized. Configuration management and input event support capabilities are enhanced. JSON files can be imported and loaded in modular mode.
The task pool and the TS2AOT-tool of the host version are provided. The dynamic library of the HAP package can be loaded without being compressed. The compiler runtime supports shared packages in the same application.
The dynamic shared library can be installed, updated, uninstalled, packed, and unpacked. For an application that is not configured with an entry icon, a default icon is displayed on the home screen. The runtime capability of the HAR shared package can be verified.
The local database is changed for widgets. Protection against frequent restart is provided for applications. The ServiceExtensionAbility component supports the asynchronous **onConnected** lifecycle.
Binding and authentication between local accounts and domain accounts are supported. A basic framework is provided for domain account management services. Direct creation of local users is forbidden.
The capabilities for controlling power indicators and lights are provided.
The HDI driver display layer supports horizontal mirroring and vertical mirroring.
**Enhanced application development framework for the standard system**
The process of compiling the shared package is added to the toolchain.
ArkUI supports obtaining of resources by resource name.
The component supports multi-level menus and group menus.
The process of compiling the HAR package is added.
The HAP compilation process is adapted so that .d.ets declaration files can be identified during HAP compilation.
**Enhanced distributed capabilities for the standard system**
BLE connection parameters can be configured, and the connection process is optimized.
## Version Mapping
**Table 1** Version mapping of software and tools
| Software/Tool| Version| Remarks|
| -------- | -------- | -------- |
| OpenHarmony | 3.2 Beta5 | NA |
| Public SDK | Ohos_sdk_public 3.2.10.6 (API Version 9 Beta5) | This toolkit is intended for application developers and does not contain system APIs that require system permissions. It is provided as standard in DevEco Studio.|
| (Optional) HUAWEI DevEco Studio| *To be released*| Recommended for developing OpenHarmony applications|
| (Optional) HUAWEI DevEco Device Tool| *To be released*| Recommended for developing OpenHarmony smart devices|
## Source Code Acquisition
### Prerequisites
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
3. Install the [git client](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
```
4. Run the following commands to install the **repo** tool:
```
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo # If you do not have the permission, download the tool to another directory and configure it as an environment variable by running the chmod a+x /usr/local/bin/repo command.
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
### Acquiring Source Code Using the repo Tool
**Method 1 (recommended)**
Use the **repo** tool to download the source code over SSH. (You must have an SSH public key for access to Gitee.)
- Obtain the source code from the version branch. You can obtain the latest source code of the version branch, which includes the code that has been incorporated into the branch up until the time you run the following commands:
```
repo init -u git@gitee.com:openharmony/manifest.git -b OpenHarmony-3.2-Beta5 --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
- Obtain the source code from the version tag, which is the same as that released with the version.
```
repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v3.2-Beta5 --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
**Method 2**
Use the **repo** tool to download the source code over HTTPS.
- Obtain the source code from the version branch. You can obtain the latest source code of the version branch, which includes the code that has been incorporated into the branch up until the time you run the following commands:
```
repo init -u https://gitee.com/openharmony/manifest -b OpenHarmony-3.2-Beta5 --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
- Obtain the source code from the version tag, which is the same as that released with the version.
```
repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v3.2-Beta5 --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
### Acquiring Source Code from Mirrors
**Table 2** Mirrors for acquiring source code
| Source Code | Version| Mirror | SHA-256 Checksum | Software Package Size|
| --------------------------------------- | ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- |
| Full code base (for mini, small, and standard systems) | 3.2 Beta5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/code-v3.2-Beta5.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/code-v3.2-Beta5.tar.gz.sha256) | 21.3 GB |
| Hi3861 solution (binary) | 3.2 Beta5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/hispark_pegasus.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/hispark_pegasus.tar.gz.sha256) | 22.9 MB |
| Hi3516 solution-LiteOS (binary)| 3.2 Beta5 | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta5/hispark_taurus_LiteOS.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta5/hispark_taurus_LiteOS.tar.gz.sha256) | 293.6 MB |
| Hi3516 solution-Linux (binary) | 3.2 Beta5 | [Download](hispark_taurus_Linux.tar.gz) | [Download](https://repo.huaweicloud.com/openharmony/os/3.2-Beta5/hispark_taurus_Linux.tar.gz.sha256) | 174.3 MB |
| RK3568 standard system solution (binary) | 3.2 Beta5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/dayu200_standard_arm32_20230201.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/dayu200_standard_arm32_20230201.tar.gz.sha256) | 3.9 GB |
| Public SDK package for the standard system (macOS) | 3.2.10.6 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/ohos-sdk-mac-public.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/ohos-sdk-mac-public.tar.gz.sha256) | 674.5 MB |
| Public SDK package for the standard system (macOS-M1) | 3.2.10.6 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/L2-SDK-MAC-M1-PUBLIC.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/L2-SDK-MAC-M1-PUBLIC.tar.gz.sha256)| 634.5 MB |
| Public SDK package for the standard system (Windows\Linux) | 3.2.10.6 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/ohos-sdk-windows_linux-public.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta5/ohos-sdk-windows_linux-public.tar.gz.sha256) | 1.6 GB |
## **What's New**
This version has the following updates to OpenHarmony 3.2 Beta4.
### SDK Updates
From this version, only the public SDK is released. It can also be downloaded through DevEco Studio.
To use the full SDK, you must download the source code, build the source code, and switch to the full SDK. For details, see [Guide to Building Full SDK](../application-dev/quick-start/full-sdk-compile-guide.md).
### Feature Updates
**Table 3** New and enhanced features
| Subsystem| Standard System| Mini and Small Systems|
| -------- | -------- | -------- |
| ArkUI | - Resources can be obtained by resource name.<br>- The component supports multi-level menus and group menus.<br>- The compilation capability is enhanced.<br>The following requirements are involved:<br>I683Z1 [New function] Adaptation to resource name–based resource retrieval<br>I68DBH [Basic capability] Providing multi-level menus and group menus<br>I68DRY [New function] Adding the HAR package compilation process<br>I68DRY [New function] Adapting to the HAP compilation process so that .d.ets declaration files can be identified during HAP compilation<br>I68DRY [New function] Adding the shared package compilation process to the toolchain| NA |
| Web subsystem| The WebView component supports the following new capabilities:<br>- Web pages can be loaded and displayed, including historical records, forward, and backward. Events can be reported during page loading. The webmessage supports the arraybuffer type. The fetch supports custom protocols.<br>- The following capabilities are added to configuration management: scroll bar and scroll position, network loading interception configuration, determining whether a page contains images, obtaining the source URL, request method, and website icon, and font management.<br>- The web context menu can obtain the selected content on the page.<br>- Interaction normalization is available for input events, and original input events are supported.<br>- Several W3C interfaces are supported.<br>The following requirements are involved:<br>I6BFPR [Function enhancement] [WebView component] Web page loading and display (supporting historical records and forward and backward list management)<br>I6BFRC [Function enhancement] [WebView component] W3C interface support (HTML-partial test cases)<br>I6BFS6 [Function enhancement] [WebView component] W3C interface support (CSS-partial test cases)<br>I6BFSK [Function enhancement] [WebView component] Web page loading and display (1. arraybuffer type support by webmessage)<br>I6BFTS [Function enhancement] [WebView component] W3C interface support (1. appmanifest)<br>I6BFUD [Function enhancement] [WebView component] Web page loading and display (1. custom protocols for fetch)<br>I6BFUM [Function enhancement] [WebView component] Status callback for web pages (1. page loading events)<br>I6BFV4 [Function enhancement] [WebView component] WebView configuration management (1. scroll bar and scroll position)<br>I6BFXF [Function enhancement] [WebView component] WebView configuration management (1. network loading interception configuration 2. Determining whether a page contains images 3. Obtaining the source URL, request method, and website icon)<br>I6BFXT [Function enhancement] [WebView component] WebView configuration management (1. font management)<br>I6BFY9 [Function enhancement] [WebView component] Input event support (1. interaction normalization)<br>I6BG4H [Function enhancement] [WebView component] Input event support (1. original input events)<br>I6BG59 [Function enhancement] [WebView component] Selecting and copying content on web pages (1. obtaining selected content from the web context menu)| NA |
| Security| - Mini system devices support authentication session cancellation.<br>- HUKS supports RSA signature enhancement.<br>The following requirements are involved:<br>I65VLX [Function enhancement] Authentication session cancellation for mini system devices<br>I611S5 [New specifications] RSA signature enhancement by HUKS| NA |
| Bundle management framework| - Implicit query is enhanced.<br>- Creation of a TS code optimization directory is supported.<br>- **bundleName** in **provision** can be verified during signature verification.<br>- A default icon is displayed on the home screen for an application for which no entry icon is configured.<br>- The following basic capabilities are added: packaging, unpacking, installing, updating, and uninstalling the dynamic shared library, and verifying the runtime capability of the HAR shared package.<br>The following requirements are involved:<br>I6BD9G [Basic capability] Enhancement to implicit query<br>I6BD9E [Basic capability] Creating a TS code optimization directory<br>I6BD99 [Basic capability] Verifying **bundleName** in **provision** during signature verification<br>I6BD8Z [Basic capability] Displaying a default icon on the home screen for an application for which no entry icon is configured<br>I6BD92 [New function] Packaging and unpacking the dynamic shared library<br>I6BD96 [New specifications] Installing, updating, and uninstalling the dynamic shared library<br>I6BD9I Verifying the runtime capability of the HAR shared package| NA |
| Building and runtime| - **taskpool**, a TS/JS task pool concurrency API, is added.<br>- The TSAOT function on the host side is supported. The TSC supports the export and import of .d.ts and .d.ets declaration files.<br>The following requirements are involved:<br>I65G6O [Basic capability] [Closed-source HAR package] Export and import of .d.ts and .d.ets declaration files<br>I64QIR [taskpool] TS/JS task pool concurrency APIs<br>I65HID [Function enhancement] TS2AOT-tool of the host version| NA |
| Pan-sensor service| The control of a single logical light is supported.<br>The following requirements are involved:<br>I63TFA [New specifications] Single logical light control| NA |
| Media| The APIs for playing and recording audio and video are reconstructed.<br>The following requirements are involved:<br>I63GTA [Reconstruction] Integration of audio and video playback APIs<br>I66VL5 [Reconstruction] Integration of audio and video recording APIs| NA |
| Startup subsystem| Symbols are hidden for the NAPI module, and the dependency on the static library module is changed to the dependency on the dynamic library module.<br>The following requirements are involved:<br>I698CV [Symbol optimization] Symbols hidden for the NAPI module; changing from the dependency on the static library module to the dependency on the dynamic library module| NA |
| Common event and notification subsystem| The local notification database is changed.<br>The following requirement is involved:<br>I67E9A [Basic capability] Local notification database switchover| NA |
| Graphics subsystem| Camera preview image is supported.<br>The following requirements are involved:<br>I6BDOH [RenderService] [New function] Camera preview image| NA |
| Location service| The network location framework is supported.<br>The following requirements are involved:<br>I5X4S9 [New feature] Network location framework| NA |
| File storage| - Unified URI processing is added for application files.<br>- Temporary authorization and unified open entry are added for user data.<br>The following requirements are involved:<br>I687C8 [New capability] Unified URI processing for application files<br>I64U8W [Basic capability] Temporary authorization and unified open entry for user data| NA |
| Ability framework| - The restart of resident processes is optimized.<br>- The widget database can be switched.<br>- The asynchronous **onConnected** lifecycle is provided.<br>The following requirements are involved:<br>I65M3F [Basic capability] ShellCommand execution control<br>I65V83 [Basic capability] ServiceExtensionAbility support for asynchronous **onConnected** lifecycle<br>I61H21 [Basic capability] Change of the local widget database<br>I63UJ5 [Ability] [ability_runtime] Exception handling in API version 8 and earlier versions<br>I6BDCW [Basic capability] Forbidden to load code in the **data** directory during application loading<br>I6BDDU [Basic capability] Default ability launch mode of the FA model: Standard<br>I6BDE2 [Basic capability] Protection against frequent restart of resident applications| NA |
### Chip and Development Board Adaptation
For details about the adaptation status, see [SIG-Devboard](https://gitee.com/openharmony/community/blob/master/sig/sig-devboard/sig_devboard.md).
### Samples
**Table 4** New samples
| Subsystem| Name| Introduction| Programming Language|
| -------- | -------- | -------- | -------- |
| Multimedia subsystem| [QR code scanning](https://gitee.com/openharmony/applications_app_samples/tree/OpenHarmony-3.2-Beta5/media/Scan)| The sample app is used to scan QR code. With the app, you can select a QR code image from a folder to identify the QR code information.| ArkTS|
| ArkUI | [Home Page of the Application Market](https://gitee.com/openharmony/applications_app_samples/tree/OpenHarmony-3.2-Beta5/MultiDeviceAppDev/AppMarket) | This sample shows a typical home page of the application market. The page has different display effects in the small window and large window, reflecting the capability of one-time development for multi-device deployment.| ArkTS|
| File management subsystem| [File Management](https://gitee.com/openharmony/applications_app_samples/tree/OpenHarmony-3.2-Beta5/FileManager/FileIo)| This sample demonstrates file management. It uses the [mediaLibrary](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md), [userFileManager](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-userfilemanager.md) and [fileio](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-fileio.md) APIs to add and access media library files and files in the application sandbox.| ArkTS|
| Ability framework| [Gallery Widget](https://gitee.com/openharmony/applications_app_samples/tree/OpenHarmony-3.2-Beta5/ability/GalleryForm) | This sample app is a gallery widget. It demonstrates how a photo in the gallery is displayed in the widget and how the widget content is periodically updated. | ArkTS|
For more information, visit [Samples](https://gitee.com/openharmony/applications_app_samples).
## Resolved Issues
**Table 5** Resolved issues
| Issue No.| Description|
| -------- | -------- |
| I5KMQX | [RK3568] The delay for switching from the **Contacts** tab to the **Call**subtab does not meet the requirement.|
| I5UFS1 | Vulnerability CVE-2022-2347 detected during the scanning of the DAS U-Boot component.|
| I5UDY5 | Linux kernel vulnerability: CVE-2022-41218.|
| I5YPMZ | Linux kernel vulnerability: CVE-2022-3344.|
## Known Issues
**Table 6** Known issues
| Issue No.| Description| Impact| To Be Resolved By|
| -------- | -------- | -------- | -------- |
| I6ATXO | [RK3568] The execution result of the OpenGL test suite contains failed items during XTS test.| The test case used to test the OpenGL interface is not adapted after other modules of the system are changed. The modules or applications that use the OpenGL interface are not affected, and the risk is controllable.| 2023-02-05|
| I6B1IC | [RK3568] [Low probability 1/10] [XTS] The ispserver thread in the /vendor/bin/ispserver process causes a cpp crash in librkaiq.z.so.| In the pressure test, there is a low probability that the ipserver thread causes a cpp crash. The ipserver thread can be automatically restarted, and services are not affected.| 2023-02-05|
| I6BJ9Z<br>I6BJ82 | alloc_file_pseudo memory leakage occurs.| The accept4 reference count is unbalanced, causing memory leakage on selinux_netlbl_sock_genattr, new_inode_pseudo, and inet_create. No patch is available in the upstream community yet, and the issue will be resolved once a patch is released in the upstream community.| 2023-03-30|
| I641A2<br>I64726 | The Bluetooth module has silent pairing issues. Other devices can be completely controlled through the Bluetooth keyboard and mouse after silent pairing.| This issue will be resolved in the form of a requirement in later versions.| 2023-03-30|
| I6BRTS | Invoking the **rdb::executeSql** interface may cause memory leakage.| Memory leakage occurs when the **rdb::executeSql** interface is repeatedly called during initialization. This interface is called only during application initialization, and therefore the impact of memory leakage is controllable.| 2023-02-10|
| I6AZ4T | Memory leakage exists for applications with the **\<textInput>** component.| Memory leakage occurs when the **\<textInput>** component is repeatedly called at a high frequency. The root cause is that the memory is not reclaimed during the calling of the third-party library flutter. We will first check whether the problem is caused by the open-source flutter component.| 2023-02-10|
<!--no_check-->
# OpenHarmony Release Notes
## OpenHarmony 3.x Releases
- [OpenHarmony v3.2 Beta5 (2023-01-31)](OpenHarmony-v3.2-beta5.md)
- [OpenHarmony v3.2 Beta4 (2022-11-30)](OpenHarmony-v3.2-beta4.md)
- [OpenHarmony v3.2 Beta3 (2022-09-30)](OpenHarmony-v3.2-beta3.md)
- [OpenHarmony v3.2 Beta2 (2022-07-30)](OpenHarmony-v3.2-beta2.md)
......
......@@ -3,28 +3,35 @@
- [OpenHarmony Project](OpenHarmony-Overview.md)
- [Glossary](glossary.md)
- Release Notes
- [OpenHarmony Version Definition](release-notes/release-definitions/Release-version-definitions.md)
- OpenHarmony 3.x Releases
- [OpenHarmony v3.2 Beta5 (2023-01-31)](release-notes/OpenHarmony-v3.2-beta5.md)
- [OpenHarmony v3.2 Beta4 (2022-11-30)](release-notes/OpenHarmony-v3.2-beta4.md)
- [OpenHarmony v3.2 Beta3 (2022-09-30)](release-notes/OpenHarmony-v3.2-beta3.md)
- [OpenHarmony v3.2 Beta2 (2022-07-30)](release-notes/OpenHarmony-v3.2-beta2.md)
- [OpenHarmony v3.2 Beta1 (2022-05-31)](release-notes/OpenHarmony-v3.2-beta1.md)
- [OpenHarmony v3.1 Release (2022-03-30)](release-notes/OpenHarmony-v3.1-release.md)
- OpenHarmony v3.1 Release (2022-03-30) and the latest patch version OpenHarmony 3.1.4 Release (2022-11-03)
- [OpenHarmony v3.1 Release (2022-03-30)](release-notes/OpenHarmony-v3.1-release.md)
- [OpenHarmony 3.1.4 Release (2022-11-03)](release-notes/OpenHarmony-v3.1.4-release.md)
- [OpenHarmony v3.1.3 Release (2022-09-30)](release-notes/OpenHarmony-v3.1.3-release.md)
- [OpenHarmony v3.1.2 Release (2022-08-24)](release-notes/OpenHarmony-v3.1.2-release.md)
- [OpenHarmony v3.1.1 Release (2022-05-31)](release-notes/OpenHarmony-v3.1.1-release.md)
- [OpenHarmony v3.1 Beta (2021-12-31)](release-notes/OpenHarmony-v3.1-beta.md)
- [OpenHarmony v3.0 LTS (2021-09-30)](release-notes/OpenHarmony-v3.0-LTS.md)
- OpenHarmony v3.0 LTS (2021-09-30) and the latest patch version OpenHarmony v3.0.7 LTS (2022-12-05)
- [OpenHarmony v3.0 LTS (2021-09-30)](release-notes/OpenHarmony-v3.0-LTS.md)
- [OpenHarmony v3.0.7 LTS (2022-12-05)](release-notes/OpenHarmony-v3.0.7-LTS.md)
- [OpenHarmony v3.0.6 LTS (2022-09-15)](release-notes/OpenHarmony-v3.0.6-LTS.md)
- [OpenHarmony v3.0.5 LTS (2022-07-01)](release-notes/OpenHarmony-v3.0.5-LTS.md)
- [OpenHarmony v3.0.3 LTS (2022-04-08)](release-notes/OpenHarmony-v3.0.3-LTS.md)
- [OpenHarmony v3.0.2 LTS (2022-03-18)](release-notes/OpenHarmony-v3.0.2-LTS.md)
- [OpenHarmony v3.0.1 LTS (2022-01-12)](release-notes/OpenHarmony-v3.0.1-LTS.md)
- OpenHarmony 2.x Releases
- [OpenHarmony v2.2 beta2 (2021-08-04)](release-notes/OpenHarmony-v2.2-beta2.md)
- [OpenHarmony 2.0 Canary (2021-06-01)](release-notes/OpenHarmony-2-0-Canary.md)
- OpenHarmony 1.x Releases
- [OpenHarmony 1.0 (2020-09-10)](release-notes/OpenHarmony-1-0.md)
- [OpenHarmony v1.1.5 LTS (2022-08-24)](release-notes/OpenHarmony-v1.1.5-LTS.md)
- [OpenHarmony v1.1.4 LTS (2022-02-11)](release-notes/OpenHarmony-v1-1-4-LTS.md)
......@@ -32,134 +39,134 @@
- [OpenHarmony v1.1.2 LTS (2021-08-04)](release-notes/OpenHarmony-v1.1.2-LTS.md)
- [OpenHarmony v1.1.1 LTS (2021-06-22)](release-notes/OpenHarmony-1-1-1-LTS.md)
- [OpenHarmony v1.1.0 LTS (2021-04-01)](release-notes/OpenHarmony-1-1-0-LTS.md)
- API Differences
- OpenHarmony 3.2 Beta3
- JS API Differences
- [Ability framework](release-notes/api-diff/v3.2-beta3/js-apidiff-ability.md)
- [Accessibility subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-accessibility.md)
- [Account subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-account.md)
- [ArkUI development framework](release-notes/api-diff/v3.2-beta3/js-apidiff-arkui.md)
- [Power management subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-battery.md)
- [Bundle management framework](release-notes/api-diff/v3.2-beta3/js-apidiff-bundle.md)
- [Communication subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-communicate.md)
- [Utils subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-compiler-and-runtime.md)
- [DFX subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-dfx.md)
- [Distributed data management subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-distributed-data.md)
- [Distributed hardware subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-distributed-hardware.md)
- [Common event and notification subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-event-and-notification.md)
- [File management subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-file-management.md)
- [Globalization subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-global.md)
- [Graphics subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-graphic.md)
- [Misc services subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-misc.md)
- [Multimodal input subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-multi-modal-input.md)
- [Multimedia subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-multimedia.md)
- [Resource scheduler subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-resource-scheduler.md)
- [Security subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-security.md)
- [Pan-sensor subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-sensor.md)
- [DSoftBus subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-soft-bus.md)
- [Telephony subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-telephony.md)
- [Test subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-unitest.md)
- [Update subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-update.md)
- [Web subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-web.md)
- [Window manager subsystem](release-notes/api-diff/v3.2-beta3/js-apidiff-window.md)
- [Updates (OpenHarmony 3.2 Beta2 -> OpenHarmony 3.2 Beta3)](release-notes/changelogs/v3.2-beta3/changelog-v3.2-beta3.md)
- OpenHarmony 3.2 Beta2
- [Ability framework](release-notes/api-change/v3.2-beta3/js-apidiff-ability.md)
- [Accessibility subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-accessibility.md)
- [Account subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-account.md)
- [ArkUI development framework](release-notes/api-change/v3.2-beta3/js-apidiff-arkui.md)
- [Power management subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-battery.md)
- [Bundle management framework](release-notes/api-change/v3.2-beta3/js-apidiff-bundle.md)
- [Communication subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-communicate.md)
- [Utils subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-compiler-and-runtime.md)
- [DFX subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-dfx.md)
- [Distributed data management subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-distributed-data.md)
- [Distributed hardware subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-distributed-hardware.md)
- [Common event and notification subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-event-and-notification.md)
- [File management subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-file-management.md)
- [Globalization subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-global.md)
- [Graphics subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-graphic.md)
- [Misc services subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-misc.md)
- [Multimodal input subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-multi-modal-input.md)
- [Multimedia subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-multimedia.md)
- [Resource scheduler subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-resource-scheduler.md)
- [Security subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-security.md)
- [Pan-sensor subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-sensor.md)
- [DSoftBus subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-soft-bus.md)
- [Telephony subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-telephony.md)
- [Test subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-unitest.md)
- [Update subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-update.md)
- [Web subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-web.md)
- [Window manager subsystem](release-notes/api-change/v3.2-beta3/js-apidiff-window.md)
- [Updates (OpenHarmony 3.2 Beta2 -> OpenHarmony 3.2 Beta3)](release-notes/api-change/v3.2-beta3/changelog-v3.2-beta3.md)
- OpenHarmony 3.2 Beta2
- JS API Differences
- [Ability framework](release-notes/api-diff/v3.2-beta2/js-apidiff-ability.md)
- [Accessibility subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-accessibility.md)
- [Account subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-account.md)
- [ArkUI development framework](release-notes/api-diff/v3.2-beta2/js-apidiff-arkui.md)
- [Bundle management framework](release-notes/api-diff/v3.2-beta2/js-apidiff-bundle.md)
- [Communication subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-communicate.md)
- [Utils subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-compiler-and-runtime.md)
- [DFX subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-dfx.md)
- [Distributed data management subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-distributed-data.md)
- [Common event and notification subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-event-and-notification.md)
- [File management subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-file-management.md)
- [Location subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-geolocation.md)
- [Globalization subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-global.md)
- [Graphics subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-graphic.md)
- [Misc services subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-misc.md)
- [Multimodal input subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-multi-modal-input.md)
- [Multimedia subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-multimedia.md)
- [Resource scheduler subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-resource-scheduler.md)
- [Security subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-security.md)
- [Pan-sensor subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-sensor.md)
- [DSoftBus subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-soft-bus.md)
- [Test subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-unitest.md)
- [Update subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-update.md)
- [USB subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-usb.md)
- [User IAM subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-user-authentication.md)
- [Web subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-web.md)
- [Window manager subsystem](release-notes/api-diff/v3.2-beta2/js-apidiff-window.md)
- [Ability framework](release-notes/api-change/v3.2-beta2/js-apidiff-ability.md)
- [Accessibility subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-accessibility.md)
- [Account subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-account.md)
- [ArkUI development framework](release-notes/api-change/v3.2-beta2/js-apidiff-arkui.md)
- [Bundle management framework](release-notes/api-change/v3.2-beta2/js-apidiff-bundle.md)
- [Communication subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-communicate.md)
- [Utils subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-compiler-and-runtime.md)
- [DFX subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-dfx.md)
- [Distributed data management subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-distributed-data.md)
- [Common event and notification subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-event-and-notification.md)
- [File management subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-file-management.md)
- [Location subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-geolocation.md)
- [Globalization subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-global.md)
- [Graphics subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-graphic.md)
- [Misc services subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-misc.md)
- [Multimodal input subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-multi-modal-input.md)
- [Multimedia subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-multimedia.md)
- [Resource scheduler subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-resource-scheduler.md)
- [Security subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-security.md)
- [Pan-sensor subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-sensor.md)
- [DSoftBus subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-soft-bus.md)
- [Test subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-unitest.md)
- [Update subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-update.md)
- [USB subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-usb.md)
- [User IAM subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-user-authentication.md)
- [Web subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-web.md)
- [Window manager subsystem](release-notes/api-change/v3.2-beta2/js-apidiff-window.md)
- ChangeLog
- [Updates (OpenHarmony 3.2 Beta1 -> OpenHarmony 3.2 Beta2)](release-notes/changelogs/v3.2-beta2/changelog-v3.2-beta2.md)
- [Adaptation Guide for the Application Sandbox](release-notes/changelogs/v3.2-beta2/application-sandbox-adaptation-guide.md)
- OpenHarmony 3.2 Beta1
- [Updates (OpenHarmony 3.2 Beta1 -> OpenHarmony 3.2 Beta2)](release-notes/api-change/v3.2-beta2/changelog-v3.2-beta2.md)
- [Adaptation Guide for the Application Sandbox](release-notes/api-change/v3.2-beta2/application-sandbox-adaptation-guide.md)
- OpenHarmony 3.2 Beta1
- JS API Differences
- [Ability framework](release-notes/api-diff/v3.2-beta1/js-apidiff-ability.md)
- [ArkUI development framework](release-notes/api-diff/v3.2-beta1/js-apidiff-arkui.md)
- [Power management subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-battery.md)
- [Bundle management framework](release-notes/api-diff/v3.2-beta1/js-apidiff-bundle.md)
- [Communication subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-communicate.md)
- [DFX subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-dfx.md)
- [Distributed data management subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-distributed-data.md)
- [Common event and notification subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-event-and-notification.md)
- [File management subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-file-management.md)
- [Globalization subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-global.md)
- [Startup subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-init.md)
- [Misc services subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-misc.md)
- [Multimodal input subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-multi-modal-input.md)
- [Multimedia subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-multimedia.md)
- [Distributed scheduler subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-resource-scheduler.md)
- [Test subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-unitest.md)
- [Web subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-web.md)
- [Window manager subsystem](release-notes/api-diff/v3.2-beta1/js-apidiff-window.md)
- [Native API Differences](release-notes/api-diff/v3.2-beta1/native-apidiff-v3.2-beta.md)
- OpenHarmony 3.1 Release
- [Ability framework](release-notes/api-change/v3.2-beta1/js-apidiff-ability.md)
- [ArkUI development framework](release-notes/api-change/v3.2-beta1/js-apidiff-arkui.md)
- [Power management subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-battery.md)
- [Bundle management framework](release-notes/api-change/v3.2-beta1/js-apidiff-bundle.md)
- [Communication subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-communicate.md)
- [DFX subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-dfx.md)
- [Distributed data management subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-distributed-data.md)
- [Common event and notification subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-event-and-notification.md)
- [File management subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-file-management.md)
- [Globalization subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-global.md)
- [Startup subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-init.md)
- [Misc services subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-misc.md)
- [Multimodal input subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-multi-modal-input.md)
- [Multimedia subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-multimedia.md)
- [Distributed scheduler subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-resource-scheduler.md)
- [Test subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-unitest.md)
- [Web subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-web.md)
- [Window manager subsystem](release-notes/api-change/v3.2-beta1/js-apidiff-window.md)
- [Native API Differences](release-notes/api-change/v3.2-beta1/native-apidiff-v3.2-beta.md)
- OpenHarmony 3.1 Release
- JS API Differences (API Version 8)
- [Ability framework](release-notes/api-diff/v3.1-Release/js-apidiff-ability.md)
- [Accessibility subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-accessibility.md)
- [Account subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-account.md)
- [ArkUI development framework](release-notes/api-diff/v3.1-Release/js-apidiff-ace.md)
- [Power management subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-battery.md)
- [Bundle management subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-bundle.md)
- [Communication subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-communicate.md)
- [Multi-language Runtime subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-compiler-and-runtime.md)
- [DFX subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-dfx.md)
- [Distributed data management subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-distributed-data.md)
- [Distributed hardware subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-distributed-hardware.md)
- [Common event and notification subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-event-and-notification.md)
- [File management subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-file-management.md)
- [Location subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-geolocation.md)
- [Globalization subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-global.md)
- [Graphics subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-graphic.md)
- [Misc services subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-misc.md)
- [Multimodal input subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-multi-modal-input.md)
- [Multimedia subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-multimedia.md)
- [Network management subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-network.md)
- [Distributed scheduler subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-resource-scheduler.md)
- [Security subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-security.md)
- [Pan-sensor subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-sensor.md)
- [Application framework subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-settings.md)
- [DSoftBus subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-soft-bus.md)
- [Telephony subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-telephony.md)
- [USB subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-usb.md)
- [User IAM subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-user-authentication.md)
- [Window manager subsystem](release-notes/api-diff/v3.1-Release/js-apidiff-window.md)
- [Native API Differences](release-notes/api-diff/v3.1-Release/native-apidiff-v3.1-release.md)
- [Updates (OpenHarmony 3.1 Beta -> OpenHarmony 3.1 Release)](release-notes/changelogs/v3.1-Release/changelog-v3.1-release.md)
- OpenHarmony 3.1 Beta
- [JS API Differences](release-notes/api-diff/v3.1-beta/js-apidiff-v3.1-beta.md)
- [Native API Differences](release-notes/api-diff/v3.1-beta/native-apidiff-v3.1-beta.md)
- [Updates (OpenHarmony 3.0 -> OpenHarmony 3.1 Beta)](release-notes/api-diff/v3.1-beta/changelog-v3.1-beta.md)
- OpenHarmony 3.0 LTS
- [JS API Differences](release-notes/api-diff/v3.0-LTS/js-apidiff-v3.0-lts.md)
- OpenHarmony v2.2 Beta2
- [JS API Differences](release-notes/api-diff/v2.2-beta2/js-apidiff-v2.2-beta2.md)
- [Native API Differences](release-notes/api-diff/v2.2-beta2/native-apidiff-v2.2-beta2.md)
- [Ability framework](release-notes/api-change/v3.1-Release/js-apidiff-ability.md)
- [Accessibility subsystem](release-notes/api-change/v3.1-Release/js-apidiff-accessibility.md)
- [Account subsystem](release-notes/api-change/v3.1-Release/js-apidiff-account.md)
- [ArkUI development framework](release-notes/api-change/v3.1-Release/js-apidiff-ace.md)
- [Power management subsystem](release-notes/api-change/v3.1-Release/js-apidiff-battery.md)
- [Bundle management subsystem](release-notes/api-change/v3.1-Release/js-apidiff-bundle.md)
- [Communication subsystem](release-notes/api-change/v3.1-Release/js-apidiff-communicate.md)
- [Multi-language Runtime subsystem](release-notes/api-change/v3.1-Release/js-apidiff-compiler-and-runtime.md)
- [DFX subsystem](release-notes/api-change/v3.1-Release/js-apidiff-dfx.md)
- [Distributed data management subsystem](release-notes/api-change/v3.1-Release/js-apidiff-distributed-data.md)
- [Distributed hardware subsystem](release-notes/api-change/v3.1-Release/js-apidiff-distributed-hardware.md)
- [Common event and notification subsystem](release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification.md)
- [File management subsystem](release-notes/api-change/v3.1-Release/js-apidiff-file-management.md)
- [Location subsystem](release-notes/api-change/v3.1-Release/js-apidiff-geolocation.md)
- [Globalization subsystem](release-notes/api-change/v3.1-Release/js-apidiff-global.md)
- [Graphics subsystem](release-notes/api-change/v3.1-Release/js-apidiff-graphic.md)
- [Misc services subsystem](release-notes/api-change/v3.1-Release/js-apidiff-misc.md)
- [Multimodal input subsystem](release-notes/api-change/v3.1-Release/js-apidiff-multi-modal-input.md)
- [Multimedia subsystem](release-notes/api-change/v3.1-Release/js-apidiff-multimedia.md)
- [Network management subsystem](release-notes/api-change/v3.1-Release/js-apidiff-network.md)
- [Distributed scheduler subsystem](release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler.md)
- [Security subsystem](release-notes/api-change/v3.1-Release/js-apidiff-security.md)
- [Pan-sensor subsystem](release-notes/api-change/v3.1-Release/js-apidiff-sensor.md)
- [Application framework subsystem](release-notes/api-change/v3.1-Release/js-apidiff-settings.md)
- [DSoftBus subsystem](release-notes/api-change/v3.1-Release/js-apidiff-soft-bus.md)
- [Telephony subsystem](release-notes/api-change/v3.1-Release/js-apidiff-telephony.md)
- [USB subsystem](release-notes/api-change/v3.1-Release/js-apidiff-usb.md)
- [User IAM subsystem](release-notes/api-change/v3.1-Release/js-apidiff-user-authentication.md)
- [Window manager subsystem](release-notes/api-change/v3.1-Release/js-apidiff-window.md)
- [Native API Differences](release-notes/api-change/v3.1-Release/native-apidiff-v3.1-release.md)
- [Updates (OpenHarmony 3.1 Beta -> OpenHarmony 3.1 Release)](release-notes/api-change/v3.1-Release/changelog-v3.1-release.md)
- OpenHarmony 3.1 Beta
- [JS API Differences](release-notes/api-change/v3.1-beta/js-apidiff-v3.1-beta.md)
- [Native API Differences](release-notes/api-change/v3.1-beta/native-apidiff-v3.1-beta.md)
- [Updates (OpenHarmony 3.0 -> OpenHarmony 3.1 Beta)](release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md)
- OpenHarmony 3.0 LTS
- [JS API Differences](release-notes/api-change/v3.0-LTS/js-apidiff-v3.0-lts.md)
- OpenHarmony v2.2 Beta2
- [JS API Differences](release-notes/api-change/v2.2-beta2/js-apidiff-v2.2-beta2.md)
- [Native API Differences](release-notes/api-change/v2.2-beta2/native-apidiff-v2.2-beta2.md)
- OpenHarmony Third-Party Components
- [OpenHarmony Third-Party Components](third-party-components/third-party-components-introduction.md)
- [Using OpenHarmony JS and TS Third-Party Components](third-party-components/npm-third-party-guide.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册