| FIRST_FIX | 0x203 | Fast location. Use this option if you want to obtain a location as fast as possible.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
| callback | AsyncCallback<boolean> | Yes| Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
| DAILY_LIFE_SERVICE | 0x304 | Daily life services.|
| NO_POWER | 0x305 | Power efficiency. Your application does not proactively start the location service. 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.|
| REVERSE_GEOCODE_ERROR<sup>7+</sup> | 102 | Failed to call the reverse geocoding API.|
| GEOCODE_ERROR<sup>7+</sup> | 103 | Failed to call the geocoding API.|
| LOCATOR_ERROR<sup>7+</sup> | 104 | Failed to obtain the location.|
| LOCATION_SWITCH_ERROR<sup>7+</sup> | 105 | Failed to change the location service switch.|
| LAST_KNOWN_LOCATION_ERROR<sup>7+</sup> | 106 | Failed to obtain the previous location.|
| LOCATION_REQUEST_TIMEOUT_ERROR<sup>7+</sup> | 107 | Failed to obtain the location within the specified time.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
**Return value**
## ReverseGeoCodeRequest
| Name| Description|
| -------- | -------- |
| Promise<boolean> | Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
| locale | string | No| Language used for the location description. **zh** indicates Chinese, and **en** indicates English.|
| description | number | Yes| Location description, for example, No. xx, xx Road, Pudong New District, Shanghai.|
| maxItems | number | No| Maximum number of location records to be returned.|
| minLatitude | number | No| Minimum latitude. This parameter is used with minLongitude, maxLatitude, and maxLongitude to specify the latitude and longitude ranges.|
| minLongitude | number | No| Minimum longitude.|
| maxLatitude | number | No| Maximum latitude.|
| maxLongitude | number | No| Maximum longitude.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
| isConfirmed | boolean | Yes| Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
| callback | AsyncCallback<boolean> | Yes| Callback used to return the operation result.|
| latitude<sup>7+</sup> | number | No| Latitude information. A positive value indicates north latitude, and a negative value indicates south latitude.|
| longitude<sup>7+</sup> | number | No| Longitude information. A positive value indicates east longitude , and a negative value indicates west longitude .|
| locale<sup>7+</sup> | string | No| Language used for the location description. **zh** indicates Chinese, and **en** indicates English.|
| placeName<sup>7+</sup> | string | No| Landmark of the location.|
| countryCode<sup>7+</sup> | string | No| Country code.|
| countryName<sup>7+</sup> | string | No| Country name.|
| administrativeArea<sup>7+</sup> | string | No| Administrative region name.|
| subAdministrativeArea<sup>7+</sup> | string | No| Sub-administrative region name.|
| priority | [LocationRequestPriority](#locationrequestpriority) | No| Priority of the location request.|
| scenario | [LocationRequestScenario](#locationrequestscenario) | Yes| Scenario of the location request.|
| timeInterval | number | No| Time interval at which location information is reported.|
| distanceInterval | number | No| Distance interval at which location information is reported.|
| maxAccuracy | number | No| Location accuracy.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
| isConfirmed | boolean | Yes| Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
**Return value**
## CurrentLocationRequest
| Name| Description|
| -------- | -------- |
| Promise<boolean> | Callback used to return the operation result.|
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| scenario | LocationRequestScenario | No | Indicates under what scenario the position simulation function is enabled. |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| scenario | LocationRequestScenario | No | Indicates which scene's position simulation function is enabled. If this parameter is not carried, it means that the position simulation function of all scenes is enabled. |
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| scenario | LocationRequestScenario | No | Indicates to disable the position simulation function of a scene. If this parameter is not carried, it means to disable the position simulation function of all scenes. |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| scenario | LocationRequestScenario | No | Indicates to disable the position simulation function of a scene. If this parameter is not carried, it means to disable the position simulation function of all scenes. |
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr, otherwise it will return an error message |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| config | LocationMockConfig | Yes | Indicates the configuration parameters of location simulation, including the time interval of simulation location reporting and the array of simulation locations. |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| config | LocationMockConfig | Yes | Indicates the configuration parameters of location simulation, including the time interval of simulation location reporting and the array of simulation locations. |
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**:
None
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**:
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**:
None
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
Set the configuration information of the reverse geocoding simulation function, including the corresponding relationship between location and place name. If the location information is in the configuration information during the subsequent reverse geocoding query, the corresponding place name will be returned.
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| mockInfos | Array<ReverseGeocodingMockInfo> | Yes | An array of configuration parameters indicating the inverse geocoding simulation function. The configuration parameters of the inverse geocoding simulation function include a location and a place name. |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
Set the configuration information of the reverse geocoding simulation function, including the corresponding relationship between location and place name. If the location information is in the configuration information during the subsequent reverse geocoding query, the corresponding place name will be returned.
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| mockInfos | Array<ReverseGeocodingMockInfo> | Yes | An array of configuration parameters indicating the inverse geocoding simulation function. The configuration parameters of the inverse geocoding simulation function include a location and a place name. |
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
| DAILY_LIFE_SERVICE | 0x304 | Daily life services.|
| NO_POWER | 0x305 | Power efficiency. Your application does not proactively start the location service. 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.|
| locale | string | No| Language used for the location description. **zh** indicates Chinese, and **en** indicates English.|
| description | number | Yes| Location description, for example, No. xx, xx Road, Pudong New District, Shanghai.|
| maxItems | number | No| Maximum number of location records to be returned.|
| minLatitude | number | No| Minimum latitude. This parameter is used with minLongitude, maxLatitude, and maxLongitude to specify the latitude and longitude ranges.|
| latitude<sup>7+</sup> | number | No| Latitude information. A positive value indicates north latitude, and a negative value indicates south latitude.|
| longitude<sup>7+</sup> | number | No| Longitude information. A positive value indicates east longitude , and a negative value indicates west longitude .|
| locale<sup>7+</sup> | string | No| Language used for the location description. **zh** indicates Chinese, and **en** indicates English.|
| placeName<sup>7+</sup> | string | No| Landmark of the location.|
| countryCode<sup>7+</sup> | string | No| Country code.|
| countryName<sup>7+</sup> | string | No| Country name.|
| administrativeArea<sup>7+</sup> | string | No| Administrative region name.|
| subAdministrativeArea<sup>7+</sup> | string | No| Sub-administrative region name.|
The configuration parameters of the location simulation function include the time interval of the simulation position report and the array of simulation locations.