1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit LocationKit 19 */ 20 21import { AsyncCallback, Callback } from './@ohos.base'; 22import { WantAgent } from './@ohos.wantAgent'; 23import { NotificationRequest } from './notification/notificationRequest'; 24 25/** 26 * Provides interfaces for acquiring location information, managing location switches, 27 * geocoding, reverse geocoding, country code, fencing and other functions. 28 * 29 * @namespace geoLocationManager 30 * @since 9 31 */ 32/** 33 * Provides interfaces for acquiring location information, managing location switches, 34 * geocoding, reverse geocoding, country code, fencing and other functions. 35 * 36 * @namespace geoLocationManager 37 * @syscap SystemCapability.Location.Location.Core 38 * @atomicservice 39 * @since 11 40 */ 41declare namespace geoLocationManager { 42 /** 43 * Subscribe location changed. 44 * 45 * @permission ohos.permission.APPROXIMATELY_LOCATION 46 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 47 * @param { LocationRequest } request - Indicates the location request parameters. 48 * @param { Callback<Location> } callback - Indicates the callback for reporting the location result. 49 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 50 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 51 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('locationChange')} due to limited device capabilities. 52 * @throws { BusinessError } 3301000 - The location service is unavailable. 53 * @throws { BusinessError } 3301100 - The location switch is off. 54 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 55 * @syscap SystemCapability.Location.Location.Core 56 * @since 9 57 */ 58 /** 59 * Subscribe location changed. 60 * 61 * @permission ohos.permission.APPROXIMATELY_LOCATION 62 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 63 * @param { LocationRequest } request - Indicates the location request parameters. 64 * @param { Callback<Location> } callback - Indicates the callback for reporting the location result. 65 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 66 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 67 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('locationChange')} due to limited device capabilities. 68 * @throws { BusinessError } 3301000 - The location service is unavailable. 69 * @throws { BusinessError } 3301100 - The location switch is off. 70 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 71 * @syscap SystemCapability.Location.Location.Core 72 * @atomicservice 73 * @since 11 74 */ 75 /** 76 * Subscribe location changed. 77 * 78 * @permission ohos.permission.APPROXIMATELY_LOCATION 79 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 80 * @param { LocationRequest | ContinuousLocationRequest } request - Indicates the location request parameters. 81 * @param { Callback<Location> } callback - Indicates the callback for reporting the location result. 82 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 83 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 84 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('locationChange')} due to limited device capabilities. 85 * @throws { BusinessError } 3301000 - The location service is unavailable. 86 * @throws { BusinessError } 3301100 - The location switch is off. 87 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 88 * @syscap SystemCapability.Location.Location.Core 89 * @atomicservice 90 * @since 12 91 */ 92 /** 93 * Subscribe location changed. 94 * 95 * @permission ohos.permission.APPROXIMATELY_LOCATION 96 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 97 * @param { LocationRequest | ContinuousLocationRequest } request - Indicates the location request parameters. 98 * @param { Callback<Location> } callback - Indicates the callback for reporting the location result. 99 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 100 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 101 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('locationChange')} due to limited device capabilities. 102 * @throws { BusinessError } 3301000 - The location service is unavailable. 103 * @throws { BusinessError } 3301100 - The location switch is off. 104 * @syscap SystemCapability.Location.Location.Core 105 * @atomicservice 106 * @since 18 107 */ 108 function on(type: 'locationChange', request: LocationRequest | ContinuousLocationRequest, 109 callback: Callback<Location>): void; 110 111 /** 112 * Unsubscribe location changed. 113 * 114 * @permission ohos.permission.APPROXIMATELY_LOCATION 115 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 116 * @param { Callback<Location> } [callback] - Indicates the callback for reporting the location result. 117 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 118 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 119 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('locationChange')} due to limited device capabilities. 120 * @throws { BusinessError } 3301000 - The location service is unavailable. 121 * @throws { BusinessError } 3301100 - The location switch is off. 122 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 123 * @syscap SystemCapability.Location.Location.Core 124 * @since 9 125 */ 126 /** 127 * Unsubscribe location changed. 128 * 129 * @permission ohos.permission.APPROXIMATELY_LOCATION 130 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 131 * @param { Callback<Location> } [callback] - Indicates the callback for reporting the location result. 132 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 133 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 134 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('locationChange')} due to limited device capabilities. 135 * @throws { BusinessError } 3301000 - The location service is unavailable. 136 * @throws { BusinessError } 3301100 - The location switch is off. 137 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 138 * @syscap SystemCapability.Location.Location.Core 139 * @atomicservice 140 * @since 11 141 */ 142 /** 143 * Unsubscribe location changed. 144 * 145 * @permission ohos.permission.APPROXIMATELY_LOCATION 146 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 147 * @param { Callback<Location> } [callback] - Indicates the callback for reporting the location result. 148 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 149 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 150 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('locationChange')} due to limited device capabilities. 151 * @throws { BusinessError } 3301000 - The location service is unavailable. 152 * @syscap SystemCapability.Location.Location.Core 153 * @atomicservice 154 * @since 18 155 */ 156 function off(type: 'locationChange', callback?: Callback<Location>): void; 157 158 /** 159 * Subscribe continuous location error changed. 160 * 161 * @permission ohos.permission.APPROXIMATELY_LOCATION 162 * @param { 'locationError' } type - Indicates the location service event to be subscribed to. 163 * @param { Callback<LocationError> } callback - Indicates the callback for reporting the continuous location error. 164 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 165 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 166 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('locationError')} due to limited device capabilities. 167 * @throws { BusinessError } 3301000 - The location service is unavailable. 168 * @syscap SystemCapability.Location.Location.Core 169 * @atomicservice 170 * @since 12 171 */ 172 function on(type: 'locationError', callback: Callback<LocationError>): void; 173 174 /** 175 * Unsubscribe continuous location error changed. 176 * 177 * @permission ohos.permission.APPROXIMATELY_LOCATION 178 * @param { 'locationError' } type - Indicates the location service event to be subscribed to. 179 * @param { Callback<LocationError> } [callback] - Indicates the callback for reporting the continuous location error. 180 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 181 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 182 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('locationError')} due to limited device capabilities. 183 * @throws { BusinessError } 3301000 - The location service is unavailable. 184 * @syscap SystemCapability.Location.Location.Core 185 * @atomicservice 186 * @since 12 187 */ 188 function off(type: 'locationError', callback?: Callback<LocationError>): void; 189 190 /** 191 * Subscribe location switch changed. 192 * 193 * @param { 'locationEnabledChange' } type - Indicates the location service event to be subscribed to. 194 * @param { Callback<boolean> } callback - Indicates the callback for reporting the location switch status. 195 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 196 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('locationEnabledChange')} due to limited device capabilities. 197 * @throws { BusinessError } 3301000 - The location service is unavailable. 198 * @syscap SystemCapability.Location.Location.Core 199 * @since 9 200 */ 201 function on(type: 'locationEnabledChange', callback: Callback<boolean>): void; 202 203 /** 204 * Unsubscribe location switch changed. 205 * 206 * @param { 'locationEnabledChange' } type - Indicates the location service event to be subscribed to. 207 * @param { Callback<boolean> } [callback] - Indicates the callback for reporting the location switch status. 208 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 209 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('locationEnabledChange')} due to limited device capabilities. 210 * @throws { BusinessError } 3301000 - The location service is unavailable. 211 * @syscap SystemCapability.Location.Location.Core 212 * @since 9 213 */ 214 function off(type: 'locationEnabledChange', callback?: Callback<boolean>): void; 215 216 /** 217 * Subscribe to cache GNSS locations update messages. 218 * 219 * @permission ohos.permission.APPROXIMATELY_LOCATION 220 * @param { 'cachedGnssLocationsChange' } type - Indicates the location service event to be subscribed to. 221 * @param { CachedGnssLocationsRequest } request - Indicates the cached GNSS locations request parameters. 222 * @param { Callback<Array<Location>> } callback - Indicates the callback for reporting the cached GNSS locations. 223 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 224 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 225 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('cachedGnssLocationsChange')} due to limited device capabilities. 226 * @throws { BusinessError } 3301000 - The location service is unavailable. 227 * @throws { BusinessError } 3301100 - The location switch is off. 228 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 229 * @syscap SystemCapability.Location.Location.Gnss 230 * @since 9 231 */ 232 /** 233 * Subscribe to cache GNSS locations update messages. 234 * 235 * @permission ohos.permission.APPROXIMATELY_LOCATION 236 * @param { 'cachedGnssLocationsChange' } type - Indicates the location service event to be subscribed to. 237 * @param { CachedGnssLocationsRequest } request - Indicates the cached GNSS locations request parameters. 238 * @param { Callback<Array<Location>> } callback - Indicates the callback for reporting the cached GNSS locations. 239 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 240 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 241 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('cachedGnssLocationsChange')} due to limited device capabilities. 242 * @throws { BusinessError } 3301000 - The location service is unavailable. 243 * @throws { BusinessError } 3301100 - The location switch is off. 244 * @syscap SystemCapability.Location.Location.Gnss 245 * @since 18 246 */ 247 function on(type: 'cachedGnssLocationsChange', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>): void; 248 249 /** 250 * Unsubscribe to cache GNSS locations update messages. 251 * 252 * @permission ohos.permission.APPROXIMATELY_LOCATION 253 * @param { 'cachedGnssLocationsChange' } type - Indicates the location service event to be subscribed to. 254 * @param { Callback<Array<Location>> } [callback] - Indicates the callback for reporting the cached gnss locations. 255 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 256 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 257 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('cachedGnssLocationsChange')} due to limited device capabilities. 258 * @throws { BusinessError } 3301000 - The location service is unavailable. 259 * @throws { BusinessError } 3301100 - The location switch is off. 260 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 261 * @syscap SystemCapability.Location.Location.Gnss 262 * @since 9 263 */ 264 /** 265 * Unsubscribe to cache GNSS locations update messages. 266 * 267 * @permission ohos.permission.APPROXIMATELY_LOCATION 268 * @param { 'cachedGnssLocationsChange' } type - Indicates the location service event to be subscribed to. 269 * @param { Callback<Array<Location>> } [callback] - Indicates the callback for reporting the cached gnss locations. 270 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 271 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 272 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('cachedGnssLocationsChange')} due to limited device capabilities. 273 * @throws { BusinessError } 3301000 - The location service is unavailable. 274 * @throws { BusinessError } 3301100 - The location switch is off. 275 * @syscap SystemCapability.Location.Location.Gnss 276 * @since 18 277 */ 278 function off(type: 'cachedGnssLocationsChange', callback?: Callback<Array<Location>>): void; 279 280 /** 281 * Subscribe satellite status changed. 282 * 283 * @permission ohos.permission.APPROXIMATELY_LOCATION 284 * @param { 'satelliteStatusChange' } type - Indicates the location service event to be subscribed to. 285 * @param { Callback<SatelliteStatusInfo> } callback - Indicates the callback for reporting the satellite status. 286 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 287 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 288 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('satelliteStatusChange')} due to limited device capabilities. 289 * @throws { BusinessError } 3301000 - The location service is unavailable. 290 * @throws { BusinessError } 3301100 - The location switch is off. 291 * @syscap SystemCapability.Location.Location.Gnss 292 * @since 9 293 */ 294 function on(type: 'satelliteStatusChange', callback: Callback<SatelliteStatusInfo>): void; 295 296 /** 297 * Unsubscribe satellite status changed. 298 * 299 * @permission ohos.permission.APPROXIMATELY_LOCATION 300 * @param { 'satelliteStatusChange' } type - Indicates the location service event to be subscribed to. 301 * @param { Callback<SatelliteStatusInfo> } [callback] - Indicates the callback for reporting the satellite status. 302 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 303 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 304 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('satelliteStatusChange')} due to limited device capabilities. 305 * @throws { BusinessError } 3301000 - The location service is unavailable. 306 * @throws { BusinessError } 3301100 - The location switch is off. 307 * @syscap SystemCapability.Location.Location.Gnss 308 * @since 9 309 */ 310 function off(type: 'satelliteStatusChange', callback?: Callback<SatelliteStatusInfo>): void; 311 312 /** 313 * Subscribe nmea message changed. 314 * 315 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 316 * @param { 'nmeaMessage' } type - Indicates the location service event to be subscribed to. 317 * @param { Callback<string> } callback - Indicates the callback for reporting the nmea message. 318 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 319 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 320 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('nmeaMessage')} due to limited device capabilities. 321 * @throws { BusinessError } 3301000 - The location service is unavailable. 322 * @throws { BusinessError } 3301100 - The location switch is off. 323 * @syscap SystemCapability.Location.Location.Gnss 324 * @since 9 325 */ 326 function on(type: 'nmeaMessage', callback: Callback<string>): void; 327 328 /** 329 * Unsubscribe nmea message changed. 330 * 331 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 332 * @param { 'nmeaMessage' } type - Indicates the location service event to be subscribed to. 333 * @param { Callback<string> } [callback] - Indicates the callback for reporting the nmea message. 334 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 335 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 336 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('nmeaMessage')} due to limited device capabilities. 337 * @throws { BusinessError } 3301000 - The location service is unavailable. 338 * @throws { BusinessError } 3301100 - The location switch is off. 339 * @syscap SystemCapability.Location.Location.Gnss 340 * @since 9 341 */ 342 function off(type: 'nmeaMessage', callback?: Callback<string>): void; 343 344 /** 345 * Add a geofence and subscribe geofence status changed. 346 * 347 * @permission ohos.permission.APPROXIMATELY_LOCATION 348 * @param { 'gnssFenceStatusChange' } type - Indicates the location service event to be subscribed to. 349 * @param { GeofenceRequest } request - Indicates the Geofence configuration parameters. 350 * @param { WantAgent } want - Indicates which ability to start when the geofence event is triggered. 351 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 352 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 353 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('gnssFenceStatusChange')} due to limited device capabilities. 354 * @throws { BusinessError } 3301000 - The location service is unavailable. 355 * @throws { BusinessError } 3301100 - The location switch is off. 356 * @throws { BusinessError } 3301600 - Failed to operate the geofence. 357 * @syscap SystemCapability.Location.Location.Geofence 358 * @since 9 359 */ 360 function on(type: 'gnssFenceStatusChange', request: GeofenceRequest, want: WantAgent): void; 361 362 /** 363 * Remove a geofence and unsubscribe geofence status changed. 364 * 365 * @permission ohos.permission.APPROXIMATELY_LOCATION 366 * @param { 'gnssFenceStatusChange' } type - Indicates the location service event to be subscribed to. 367 * @param { GeofenceRequest } request - Indicates the Geofence configuration parameters. 368 * @param { WantAgent } want - Indicates which ability to start when the geofence event is triggered. 369 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 370 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 371 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('gnssFenceStatusChange')} due to limited device capabilities. 372 * @throws { BusinessError } 3301000 - The location service is unavailable. 373 * @throws { BusinessError } 3301100 - The location switch is off. 374 * @throws { BusinessError } 3301600 - Failed to operate the geofence. 375 * @syscap SystemCapability.Location.Location.Geofence 376 * @since 9 377 */ 378 function off(type: 'gnssFenceStatusChange', request: GeofenceRequest, want: WantAgent): void; 379 380 /** 381 * Registering the callback function for listening to country code changes. 382 * 383 * @param { 'countryCodeChange' } type - Indicates the location service event to be subscribed to. 384 * @param { Callback<CountryCode> } callback - Indicates the callback for reporting country code changes. 385 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 386 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('countryCodeChange')} due to limited device capabilities. 387 * @throws { BusinessError } 3301000 - The location service is unavailable. 388 * @throws { BusinessError } 3301500 - Failed to query the area information. 389 * @syscap SystemCapability.Location.Location.Core 390 * @since 9 391 */ 392 function on(type: 'countryCodeChange', callback: Callback<CountryCode>): void; 393 394 /** 395 * Unregistering the callback function for listening to country code changes. 396 * 397 * @param { 'countryCodeChange' } type - Indicates the location service event to be subscribed to. 398 * @param { Callback<CountryCode> } [callback] - Indicates the callback for reporting country code changes. 399 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 400 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('countryCodeChange')} due to limited device capabilities. 401 * @throws { BusinessError } 3301000 - The location service is unavailable. 402 * @throws { BusinessError } 3301500 - Failed to query the area information. 403 * @syscap SystemCapability.Location.Location.Core 404 * @since 9 405 */ 406 function off(type: 'countryCodeChange', callback?: Callback<CountryCode>): void; 407 408 /** 409 * Subscribe to changes in WiFi/BT scanning information, 410 * and use the WiFi/BT scanning information for localization. 411 * 412 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 413 * @param { 'locatingRequiredDataChange' } type - Indicates the location service event to be subscribed to. 414 * @param { LocatingRequiredDataConfig } config - Indicates the locating required data configuration parameters. 415 * @param { Callback<Array<LocatingRequiredData>> } [callback] - Indicates the callback for reporting WiFi/BT scan info. 416 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 417 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 418 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 419 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('locatingRequiredDataChange')} due to limited device capabilities. 420 * @throws { BusinessError } 3301800 - Failed to start WiFi or Bluetooth scanning. 421 * @syscap SystemCapability.Location.Location.Core 422 * @systemapi 423 * @since 10 424 */ 425 function on(type: 'locatingRequiredDataChange', config: LocatingRequiredDataConfig, callback: Callback<Array<LocatingRequiredData>>): void; 426 427 /** 428 * Stop WiFi/BT scanning and unsubscribe from WiFi/BT scanning information changes. 429 * 430 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 431 * @param { 'locatingRequiredDataChange' } type - Indicates the location service event to be subscribed to. 432 * @param { Callback<Array<LocatingRequiredData>> } [callback] - Indicates the callback for reporting WiFi/BT scan info. 433 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 434 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 435 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 436 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('locatingRequiredDataChange')} due to limited device capabilities. 437 * @syscap SystemCapability.Location.Location.Core 438 * @systemapi 439 * @since 10 440 */ 441 function off(type: 'locatingRequiredDataChange', callback?: Callback<Array<LocatingRequiredData>>): void; 442 443 /** 444 * Subscribe location icon status changed. 445 * 446 * @param { 'locationIconStatusChange' } type - Indicates the location service event to be subscribed to. 447 * @param { Callback<LocationIconStatus> } callback - Indicates the callback for reporting the location icon status. 448 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 449 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 450 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('locationIconStatusChange')} due to limited device capabilities. 451 * @throws { BusinessError } 3301000 - The location service is unavailable. 452 * @syscap SystemCapability.Location.Location.Core 453 * @systemapi 454 * @since 12 455 */ 456 function on(type: 'locationIconStatusChange', callback: Callback<LocationIconStatus>): void; 457 458 /** 459 * Unsubscribe location icon status changed. 460 * 461 * @param { 'locationIconStatusChange' } type - Indicates the location service event to be subscribed to. 462 * @param { Callback<LocationIconStatus> } [callback] - Indicates the callback for reporting the location icon status. 463 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 464 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 465 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.off('locationIconStatusChange')} due to limited device capabilities. 466 * @throws { BusinessError } 3301000 - The location service is unavailable. 467 * @syscap SystemCapability.Location.Location.Core 468 * @systemapi 469 * @since 12 470 */ 471 function off(type: 'locationIconStatusChange', callback?: Callback<LocationIconStatus>): void; 472 473 /** 474 * Registers and listens to bluetooth scanning results for location services. 475 * 476 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 477 * @param { 'bluetoothScanResultChange' } type - Indicates the location service event to be subscribed to. 478 * @param { Callback<BluetoothScanResult> } callback - Indicates the callback for reporting Bluetooth scan info. 479 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 480 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 481 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('bluetoothScanResultChange')} due to limited device capabilities. 482 * @throws { BusinessError } 3301000 - The location service is unavailable. 483 * @throws { BusinessError } 3301100 - The location switch is off. 484 * @syscap SystemCapability.Location.Location.Core 485 * @since 16 486 */ 487 function on(type: 'bluetoothScanResultChange', callback: Callback<BluetoothScanResult>): void; 488 489 /** 490 * Stop bluetooth scanning and unregister to listen to bluetooth scanning result changes. 491 * 492 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 493 * @param { 'bluetoothScanResultChange' } type - Indicates the location service event to be subscribed to. 494 * @param { Callback<BluetoothScanResult> } [callback] - Indicates the callback for reporting Bluetooth scan info. 495 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 496 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 497 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.on('bluetoothScanResultChange')} due to limited device capabilities. 498 * @throws { BusinessError } 3301000 - The location service is unavailable. 499 * @syscap SystemCapability.Location.Location.Core 500 * @since 16 501 */ 502 function off(type: 'bluetoothScanResultChange', callback?: Callback<BluetoothScanResult>): void; 503 504 /** 505 * Obtain current location. 506 * 507 * @permission ohos.permission.APPROXIMATELY_LOCATION 508 * @param { CurrentLocationRequest } request - Indicates the location request parameters. 509 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 510 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 511 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 512 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCurrentLocation} due to limited device capabilities. 513 * @throws { BusinessError } 3301000 - The location service is unavailable. 514 * @throws { BusinessError } 3301100 - The location switch is off. 515 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 516 * @syscap SystemCapability.Location.Location.Core 517 * @since 9 518 */ 519 /** 520 * Obtain current location. 521 * 522 * @permission ohos.permission.APPROXIMATELY_LOCATION 523 * @param { CurrentLocationRequest } request - Indicates the location request parameters. 524 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 525 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 526 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 527 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCurrentLocation} due to limited device capabilities. 528 * @throws { BusinessError } 3301000 - The location service is unavailable. 529 * @throws { BusinessError } 3301100 - The location switch is off. 530 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 531 * @syscap SystemCapability.Location.Location.Core 532 * @atomicservice 533 * @since 11 534 */ 535 /** 536 * Obtain current location. 537 * 538 * @permission ohos.permission.APPROXIMATELY_LOCATION 539 * @param { CurrentLocationRequest | SingleLocationRequest } request - Indicates the location request parameters. 540 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 541 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 542 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 543 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCurrentLocation} due to limited device capabilities. 544 * @throws { BusinessError } 3301000 - The location service is unavailable. 545 * @throws { BusinessError } 3301100 - The location switch is off. 546 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 547 * @syscap SystemCapability.Location.Location.Core 548 * @atomicservice 549 * @since 12 550 */ 551 function getCurrentLocation(request: CurrentLocationRequest | SingleLocationRequest, 552 callback: AsyncCallback<Location>): void; 553 554 /** 555 * Obtain current location. 556 * 557 * @permission ohos.permission.APPROXIMATELY_LOCATION 558 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 559 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 560 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 561 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCurrentLocation} due to limited device capabilities. 562 * @throws { BusinessError } 3301000 - The location service is unavailable. 563 * @throws { BusinessError } 3301100 - The location switch is off. 564 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 565 * @syscap SystemCapability.Location.Location.Core 566 * @since 9 567 */ 568 /** 569 * Obtain current location. 570 * 571 * @permission ohos.permission.APPROXIMATELY_LOCATION 572 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 573 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 574 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 575 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCurrentLocation} due to limited device capabilities. 576 * @throws { BusinessError } 3301000 - The location service is unavailable. 577 * @throws { BusinessError } 3301100 - The location switch is off. 578 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 579 * @syscap SystemCapability.Location.Location.Core 580 * @atomicservice 581 * @since 11 582 */ 583 function getCurrentLocation(callback: AsyncCallback<Location>): void; 584 585 /** 586 * Obtain current location. 587 * 588 * @permission ohos.permission.APPROXIMATELY_LOCATION 589 * @param { CurrentLocationRequest } [request] - Indicates the location request parameters. 590 * @returns { Promise<Location> } The promise returned by the function. 591 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 592 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 593 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCurrentLocation} due to limited device capabilities. 594 * @throws { BusinessError } 3301000 - The location service is unavailable. 595 * @throws { BusinessError } 3301100 - The location switch is off. 596 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 597 * @syscap SystemCapability.Location.Location.Core 598 * @since 9 599 */ 600 /** 601 * Obtain current location. 602 * 603 * @permission ohos.permission.APPROXIMATELY_LOCATION 604 * @param { CurrentLocationRequest } [request] - Indicates the location request parameters. 605 * @returns { Promise<Location> } The promise returned by the function. 606 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 607 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 608 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCurrentLocation} due to limited device capabilities. 609 * @throws { BusinessError } 3301000 - The location service is unavailable. 610 * @throws { BusinessError } 3301100 - The location switch is off. 611 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 612 * @syscap SystemCapability.Location.Location.Core 613 * @atomicservice 614 * @since 11 615 */ 616 /** 617 * Obtain current location. 618 * 619 * @permission ohos.permission.APPROXIMATELY_LOCATION 620 * @param { CurrentLocationRequest | SingleLocationRequest } [request] - Indicates the location request parameters. 621 * @returns { Promise<Location> } The promise returned by the function. 622 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 623 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 624 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCurrentLocation} due to limited device capabilities. 625 * @throws { BusinessError } 3301000 - The location service is unavailable. 626 * @throws { BusinessError } 3301100 - The location switch is off. 627 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 628 * @syscap SystemCapability.Location.Location.Core 629 * @atomicservice 630 * @since 12 631 */ 632 function getCurrentLocation(request?: CurrentLocationRequest | SingleLocationRequest): 633 Promise<Location>; 634 635 /** 636 * Obtain last known location. 637 * 638 * @permission ohos.permission.APPROXIMATELY_LOCATION 639 * @returns { Location } The last known location information. 640 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 641 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getLastLocation} due to limited device capabilities. 642 * @throws { BusinessError } 3301000 - The location service is unavailable. 643 * @throws { BusinessError } 3301100 - The location switch is off. 644 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 645 * @syscap SystemCapability.Location.Location.Core 646 * @since 9 647 */ 648 /** 649 * Obtain last known location. 650 * 651 * @permission ohos.permission.APPROXIMATELY_LOCATION 652 * @returns { Location } The last known location information. 653 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 654 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getLastLocation} due to limited device capabilities. 655 * @throws { BusinessError } 3301000 - The location service is unavailable. 656 * @throws { BusinessError } 3301100 - The location switch is off. 657 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 658 * @syscap SystemCapability.Location.Location.Core 659 * @atomicservice 660 * @since 11 661 */ 662 function getLastLocation(): Location; 663 664 /** 665 * Obtain current location switch status. 666 * 667 * @returns { boolean } Returns {@code true} if the location switch on, returns {@code false} otherwise. 668 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.isLocationEnabled} due to limited device capabilities. 669 * @throws { BusinessError } 3301000 - The location service is unavailable. 670 * @syscap SystemCapability.Location.Location.Core 671 * @since 9 672 */ 673 /** 674 * Obtain current location switch status. 675 * 676 * @returns { boolean } Returns {@code true} if the location switch on, returns {@code false} otherwise. 677 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.isLocationEnabled} due to limited device capabilities. 678 * @throws { BusinessError } 3301000 - The location service is unavailable. 679 * @syscap SystemCapability.Location.Location.Core 680 * @atomicservice 681 * @since 11 682 */ 683 function isLocationEnabled(): boolean; 684 685 /** 686 * Obtaining the location switch status of a specified user. 687 * 688 * @param { number } userId - Indicates the ID of a specified user. 689 * @returns { boolean } Returns {@code true} if the location switch on, returns {@code false} otherwise. 690 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 691 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.isLocationEnabledByUserId} due to limited device capabilities. 692 * @throws { BusinessError } 3301000 - The location service is unavailable. 693 * @syscap SystemCapability.Location.Location.Core 694 * @systemapi 695 * @since 18 696 */ 697 function isLocationEnabledByUserId(userId: number): boolean; 698 699 /** 700 * Enable location switch. 701 * 702 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 703 * @param { AsyncCallback<void> } callback - Indicates the callback for reporting the error message. 704 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 705 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 706 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 707 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.enableLocation} due to limited device capabilities. 708 * @throws { BusinessError } 3301000 - The location service is unavailable. 709 * @syscap SystemCapability.Location.Location.Core 710 * @systemapi 711 * @since 9 712 */ 713 function enableLocation(callback: AsyncCallback<void>): void; 714 715 /** 716 * Enable location switch. 717 * 718 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 719 * @returns { Promise<void> } The promise returned by the function. 720 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 721 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 722 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.enableLocation} due to limited device capabilities. 723 * @throws { BusinessError } 3301000 - The location service is unavailable. 724 * @syscap SystemCapability.Location.Location.Core 725 * @systemapi 726 * @since 9 727 */ 728 function enableLocation(): Promise<void>; 729 730 /** 731 * Turn on the location switch for a specified user. 732 * 733 * @permission ohos.permission.MANAGE_SECURE_SETTINGS and ohos.permission.CONTROL_LOCATION_SWITCH 734 * @param { number } userId - Indicates the ID of a specified user. 735 * @returns { Promise<void> } The promise returned by the function. 736 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 737 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 738 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.enableLocation} due to limited device capabilities. 739 * @throws { BusinessError } 3301000 - The location service is unavailable. 740 * @syscap SystemCapability.Location.Location.Core 741 * @systemapi 742 * @since 18 743 */ 744 function enableLocationByUserId(userId: number): Promise<void>; 745 746 /** 747 * Disable location switch. 748 * 749 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 750 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 751 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 752 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.disableLocation} due to limited device capabilities. 753 * @throws { BusinessError } 3301000 - The location service is unavailable. 754 * @syscap SystemCapability.Location.Location.Core 755 * @systemapi 756 * @since 9 757 */ 758 function disableLocation(): void; 759 760 /** 761 * Turn off the location switch for a specified user. 762 * 763 * @permission ohos.permission.MANAGE_SECURE_SETTINGS and ohos.permission.CONTROL_LOCATION_SWITCH 764 * @param { number } userId - Indicates the ID of a specified user. 765 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 766 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 767 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.enableLocation} due to limited device capabilities. 768 * @throws { BusinessError } 3301000 - The location service is unavailable. 769 * @syscap SystemCapability.Location.Location.Core 770 * @systemapi 771 * @since 18 772 */ 773 function disableLocationByUserId(userId: number): void; 774 775 /** 776 * Set the app locating behavior not controlled by the location switch. 777 * 778 * @permission ohos.permission.LOCATION_SWITCH_IGNORED 779 * @param { boolean } isIgnored - True indicates that the location behavior of the app is not controlled by the location switch. 780 * Otherwise, it's the opposite. 781 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 782 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 783 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.enableLocation} due to limited device capabilities. 784 * @throws { BusinessError } 3301000 - The location service is unavailable. 785 * @syscap SystemCapability.Location.Location.Core 786 * @systemapi 787 * @since 18 788 */ 789 function setLocationSwitchIgnored(isIgnored: boolean): void; 790 791 /** 792 * Obtain address info from location. 793 * 794 * @param { ReverseGeoCodeRequest } request - Indicates the reverse geocode query parameters. 795 * @param { AsyncCallback<Array<GeoAddress>> } callback - Indicates the callback for reporting the address info. 796 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 797 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getAddressesFromLocation} due to limited device capabilities. 798 * @throws { BusinessError } 3301000 - The location service is unavailable. 799 * @throws { BusinessError } 3301300 - Reverse geocoding query failed. 800 * @syscap SystemCapability.Location.Location.Geocoder 801 * @since 9 802 */ 803 function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; 804 805 /** 806 * Obtain address info from location. 807 * 808 * @param { ReverseGeoCodeRequest } request - Indicates the reverse geocode query parameters. 809 * @returns { Promise<Array<GeoAddress>> } The promise returned by the function. 810 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 811 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getAddressesFromLocation} due to limited device capabilities. 812 * @throws { BusinessError } 3301000 - The location service is unavailable. 813 * @throws { BusinessError } 3301300 - Reverse geocoding query failed. 814 * @syscap SystemCapability.Location.Location.Geocoder 815 * @since 9 816 */ 817 function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise<Array<GeoAddress>>; 818 819 /** 820 * Obtain latitude and longitude info from location address. 821 * 822 * @param { GeoCodeRequest } request - Indicates the geocode query parameters. 823 * @param { AsyncCallback<Array<GeoAddress>> } callback - Indicates the callback for reporting the latitude and longitude result. 824 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 825 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getAddressesFromLocationName} due to limited device capabilities. 826 * @throws { BusinessError } 3301000 - The location service is unavailable. 827 * @throws { BusinessError } 3301400 - Geocoding query failed. 828 * @syscap SystemCapability.Location.Location.Geocoder 829 * @since 9 830 */ 831 function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; 832 833 /** 834 * Obtain latitude and longitude info from location address. 835 * 836 * @param { GeoCodeRequest } request - Indicates the geocode query parameters. 837 * @returns { Promise<Array<GeoAddress>> } The promise returned by the function. 838 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 839 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getAddressesFromLocationName} due to limited device capabilities. 840 * @throws { BusinessError } 3301000 - The location service is unavailable. 841 * @throws { BusinessError } 3301400 - Geocoding query failed. 842 * @syscap SystemCapability.Location.Location.Geocoder 843 * @since 9 844 */ 845 function getAddressesFromLocationName(request: GeoCodeRequest): Promise<Array<GeoAddress>>; 846 847 /** 848 * Obtain geocoding service status. 849 * 850 * @returns { boolean } Returns {@code true} if geocoding service is available, returns {@code false} otherwise. 851 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.isGeocoderAvailable} due to limited device capabilities. 852 * @throws { BusinessError } 3301000 - The location service is unavailable. 853 * @syscap SystemCapability.Location.Location.Geocoder 854 * @since 9 855 */ 856 function isGeocoderAvailable(): boolean; 857 858 /** 859 * Obtain the number of cached GNSS locations reported at a time. 860 * 861 * @permission ohos.permission.APPROXIMATELY_LOCATION 862 * @param { AsyncCallback<number> } callback - Indicates the callback for reporting the cached GNSS locations size. 863 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 864 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 865 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCachedGnssLocationsSize} due to limited device capabilities. 866 * @throws { BusinessError } 3301000 - The location service is unavailable. 867 * @throws { BusinessError } 3301100 - The location switch is off. 868 * @syscap SystemCapability.Location.Location.Gnss 869 * @since 9 870 */ 871 function getCachedGnssLocationsSize(callback: AsyncCallback<number>): void; 872 873 /** 874 * Obtain the number of cached GNSS locations. 875 * 876 * @permission ohos.permission.APPROXIMATELY_LOCATION 877 * @returns { Promise<number> } The promise returned by the function. 878 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 879 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCachedGnssLocationsSize} due to limited device capabilities. 880 * @throws { BusinessError } 3301000 - The location service is unavailable. 881 * @throws { BusinessError } 3301100 - The location switch is off. 882 * @syscap SystemCapability.Location.Location.Gnss 883 * @since 9 884 */ 885 function getCachedGnssLocationsSize(): Promise<number>; 886 887 /** 888 * All prepared GNSS locations are returned to the application through the callback function, 889 * and the bottom-layer buffer is cleared. 890 * 891 * @permission ohos.permission.APPROXIMATELY_LOCATION 892 * @param { AsyncCallback<void> } callback - Indicates the callback for reporting the error message. 893 * If the function fails to execute, the error message will be carried in the first parameter err of AsyncCallback, 894 * If the function executes successfully, execute the callback function only, no data will be returned. 895 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 896 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 897 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.flushCachedGnssLocations} due to limited device capabilities. 898 * @throws { BusinessError } 3301000 - The location service is unavailable. 899 * @throws { BusinessError } 3301100 - The location switch is off. 900 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 901 * @syscap SystemCapability.Location.Location.Gnss 902 * @since 9 903 */ 904 function flushCachedGnssLocations(callback: AsyncCallback<void>): void; 905 906 /** 907 * All prepared GNSS locations are returned to the application, 908 * and the bottom-layer buffer is cleared. 909 * 910 * @permission ohos.permission.APPROXIMATELY_LOCATION 911 * @returns { Promise<void> } The promise returned by the function. 912 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 913 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.flushCachedGnssLocations} due to limited device capabilities. 914 * @throws { BusinessError } 3301000 - The location service is unavailable. 915 * @throws { BusinessError } 3301100 - The location switch is off. 916 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 917 * @syscap SystemCapability.Location.Location.Gnss 918 * @since 9 919 */ 920 function flushCachedGnssLocations(): Promise<void>; 921 922 /** 923 * Send extended commands to location subsystem. 924 * 925 * @param { LocationCommand } command - Indicates the extended command message body. 926 * @param { AsyncCallback<void> } callback - Indicates the callback for reporting the error message. 927 * If the function fails to execute, the error message will be carried in the first parameter err of AsyncCallback, 928 * If the function executes successfully, execute the callback function only, no data will be returned. 929 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 930 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.sendCommand} due to limited device capabilities. 931 * @throws { BusinessError } 3301000 - The location service is unavailable. 932 * @syscap SystemCapability.Location.Location.Core 933 * @since 9 934 */ 935 function sendCommand(command: LocationCommand, callback: AsyncCallback<void>): void; 936 937 /** 938 * Send extended commands to location subsystem. 939 * 940 * @param { LocationCommand } command - Indicates the extended command message body. 941 * @returns { Promise<void> } The promise returned by the function. 942 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 943 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.sendCommand} due to limited device capabilities. 944 * @throws { BusinessError } 3301000 - The location service is unavailable. 945 * @syscap SystemCapability.Location.Location.Core 946 * @since 9 947 */ 948 function sendCommand(command: LocationCommand): Promise<void>; 949 950 /** 951 * Obtain the current country code. 952 * 953 * @param { AsyncCallback<CountryCode> } callback - Indicates the callback for reporting the country code. 954 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 955 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCountryCode} due to limited device capabilities. 956 * @throws { BusinessError } 3301000 - The location service is unavailable. 957 * @throws { BusinessError } 3301500 - Failed to query the area information. 958 * @syscap SystemCapability.Location.Location.Core 959 * @since 9 960 */ 961 function getCountryCode(callback: AsyncCallback<CountryCode>): void; 962 963 /** 964 * Obtain the current country code. 965 * 966 * @returns { Promise<CountryCode> } The promise returned by the function. 967 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCountryCode} due to limited device capabilities. 968 * @throws { BusinessError } 3301000 - The location service is unavailable. 969 * @throws { BusinessError } 3301500 - Failed to query the area information. 970 * @syscap SystemCapability.Location.Location.Core 971 * @since 9 972 */ 973 function getCountryCode(): Promise<CountryCode>; 974 975 /** 976 * Enable the geographical location simulation function. 977 * 978 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 979 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.enableLocationMock} due to limited device capabilities. 980 * @throws { BusinessError } 3301000 - The location service is unavailable. 981 * @throws { BusinessError } 3301100 - The location switch is off. 982 * @syscap SystemCapability.Location.Location.Core 983 * @systemapi 984 * @since 9 985 */ 986 function enableLocationMock(): void; 987 988 /** 989 * Disable the geographical location simulation function. 990 * 991 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 992 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.disableLocationMock} due to limited device capabilities. 993 * @throws { BusinessError } 3301000 - The location service is unavailable. 994 * @throws { BusinessError } 3301100 - The location switch is off. 995 * @syscap SystemCapability.Location.Location.Core 996 * @systemapi 997 * @since 9 998 */ 999 function disableLocationMock(): void; 1000 1001 /** 1002 * Set the configuration parameters for location simulation. 1003 * 1004 * @param { LocationMockConfig } config - Indicates the configuration parameters for location simulation. 1005 * Contains the array of locations and reporting intervals that need to be simulated. 1006 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1007 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1008 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.setMockedLocations} due to limited device capabilities. 1009 * @throws { BusinessError } 3301000 - The location service is unavailable. 1010 * @throws { BusinessError } 3301100 - The location switch is off. 1011 * @syscap SystemCapability.Location.Location.Core 1012 * @systemapi 1013 * @since 9 1014 */ 1015 function setMockedLocations(config: LocationMockConfig): void; 1016 1017 /** 1018 * Enable the reverse geocoding simulation function. 1019 * 1020 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1021 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.enableReverseGeocodingMock} due to limited device capabilities. 1022 * @throws { BusinessError } 3301000 - The location service is unavailable. 1023 * @syscap SystemCapability.Location.Location.Core 1024 * @systemapi 1025 * @since 9 1026 */ 1027 function enableReverseGeocodingMock(): void; 1028 1029 /** 1030 * Disable the reverse geocoding simulation function. 1031 * 1032 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1033 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.disableReverseGeocodingMock} due to limited device capabilities. 1034 * @throws { BusinessError } 3301000 - The location service is unavailable. 1035 * @syscap SystemCapability.Location.Location.Core 1036 * @systemapi 1037 * @since 9 1038 */ 1039 function disableReverseGeocodingMock(): void; 1040 1041 /** 1042 * Set the configuration parameters for simulating reverse geocoding. 1043 * 1044 * @param { Array<ReverseGeocodingMockInfo> } mockInfos - Indicates the set of locations and place names to be simulated. 1045 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1046 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1047 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.setReverseGeocodingMockInfo} due to limited device capabilities. 1048 * @throws { BusinessError } 3301000 - The location service is unavailable. 1049 * @syscap SystemCapability.Location.Location.Core 1050 * @systemapi 1051 * @since 9 1052 */ 1053 function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>): void; 1054 1055 /** 1056 * Querying location privacy protocol confirmation status. 1057 * 1058 * @param { LocationPrivacyType } type - Indicates location privacy protocol type. 1059 * @returns { boolean } Returns {@code true} if the location privacy protocol has been confirmed, returns {@code false} otherwise. 1060 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1061 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1062 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.isLocationPrivacyConfirmed} due to limited device capabilities. 1063 * @throws { BusinessError } 3301000 - The location service is unavailable. 1064 * @syscap SystemCapability.Location.Location.Core 1065 * @systemapi 1066 * @since 9 1067 */ 1068 function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean; 1069 1070 /** 1071 * Set location privacy protocol confirmation status. 1072 * 1073 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 1074 * @param { LocationPrivacyType } type - Indicates location privacy protocol type. 1075 * @param { boolean } isConfirmed - Indicates whether the location privacy protocol has been confirmed. 1076 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1077 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1078 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1079 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.setLocationPrivacyConfirmStatus} due to limited device capabilities. 1080 * @throws { BusinessError } 3301000 - The location service is unavailable. 1081 * @syscap SystemCapability.Location.Location.Core 1082 * @systemapi 1083 * @since 9 1084 */ 1085 function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void; 1086 1087 /** 1088 * Get WiFi/BT scanning information, and use the WiFi/BT scanning information for localization. 1089 * 1090 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 1091 * @param { LocatingRequiredDataConfig } config - Indicates the request parameters for obtaining the data required for locating. 1092 * @returns { Promise<Array<LocatingRequiredData>> } The promise returned by the function, for reporting WiFi/BT scan info. 1093 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1094 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1095 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1096 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getLocatingRequiredData} due to limited device capabilities. 1097 * @throws { BusinessError } 3301800 - Failed to start WiFi or Bluetooth scanning. 1098 * @syscap SystemCapability.Location.Location.Core 1099 * @systemapi 1100 * @since 10 1101 */ 1102 function getLocatingRequiredData(config: LocatingRequiredDataConfig): Promise<Array<LocatingRequiredData>>; 1103 1104 /** 1105 * Add a geofence. 1106 * 1107 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 1108 * @param { GnssGeofenceRequest } fenceRequest - Indicates the Geofence configuration parameters. 1109 * @returns { Promise<number> } The promise returned by the function, for reporting the ID of geofence. 1110 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1111 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1112 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.addGnssGeofence} due to limited device capabilities. 1113 * @throws { BusinessError } 3301000 - The location service is unavailable. 1114 * @throws { BusinessError } 3301100 - The location switch is off. 1115 * @throws { BusinessError } 3301601 - The number of geofences exceeds the maximum. 1116 * @syscap SystemCapability.Location.Location.Geofence 1117 * @since 12 1118 */ 1119 function addGnssGeofence(fenceRequest: GnssGeofenceRequest): Promise<number>; 1120 1121 /** 1122 * Remove a geofence. 1123 * 1124 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 1125 * @param { number } geofenceId - Indicates the ID of geofence. 1126 * @returns { Promise<void> } The promise returned by the function. 1127 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1128 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1129 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.removeGnssGeofence} due to limited device capabilities. 1130 * @throws { BusinessError } 3301000 - The location service is unavailable. 1131 * @throws { BusinessError } 3301602 - Failed to delete a geofence due to an incorrect ID. 1132 * @syscap SystemCapability.Location.Location.Geofence 1133 * @since 12 1134 */ 1135 function removeGnssGeofence(geofenceId: number): Promise<void>; 1136 1137 /** 1138 * Obtains the coordinate system types supported by geofence. 1139 * 1140 * @returns { Array<CoordinateSystemType> } Return the coordinate system types supported by geofence. 1141 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getGeofenceSupportedCoordTypes} due to limited device capabilities. 1142 * @throws { BusinessError } 3301000 - The location service is unavailable. 1143 * @syscap SystemCapability.Location.Location.Geofence 1144 * @since 12 1145 */ 1146 function getGeofenceSupportedCoordTypes(): Array<CoordinateSystemType>; 1147 1148 /** 1149 * Get location icon status. 1150 * 1151 * @returns { LocationIconStatus } The location icon status. 1152 * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. 1153 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getLocationIconStatus} due to limited device capabilities. 1154 * @throws { BusinessError } 3301000 - The location service is unavailable. 1155 * @syscap SystemCapability.Location.Location.Core 1156 * @systemapi 1157 * @since 12 1158 */ 1159 function getLocationIconStatus(): LocationIconStatus; 1160 1161 /** 1162 * Obtains the BSSID of the connected Wi-Fi hotspot. 1163 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 1164 * @returns {string} Returns the BSSID of the connected Wi-Fi hotspot. 1165 * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. 1166 * @throws { BusinessError } 801 - Capability not supported. Failed to call ${geoLocationManager.getCurrentWifiBssidForLocating()} due to limited device capabilities. 1167 * @throws { BusinessError } 3301000 - The location service is unavailable. 1168 * @throws { BusinessError } 3301100 - The location switch is off. 1169 * @throws { BusinessError } 3301900 - Failed to obtain the BSSID of the Wi-Fi hotspot. The Wi-Fi network is not connected. 1170 * @syscap SystemCapability.Location.Location.Core 1171 * @crossplatform 1172 * @since 14 1173 */ 1174 function getCurrentWifiBssidForLocating(): string; 1175 1176 /** 1177 * Configuration parameters for simulating reverse geocoding. 1178 * 1179 * @typedef ReverseGeocodingMockInfo 1180 * @syscap SystemCapability.Location.Location.Core 1181 * @systemapi 1182 * @since 9 1183 */ 1184 export interface ReverseGeocodingMockInfo { 1185 /** 1186 * Location for which reverse geocoding query is required. 1187 * 1188 * @type { ReverseGeoCodeRequest } 1189 * @syscap SystemCapability.Location.Location.Core 1190 * @systemapi 1191 * @since 9 1192 */ 1193 location: ReverseGeoCodeRequest; 1194 1195 /** 1196 * Actual address information corresponding to the location. 1197 * 1198 * @type { GeoAddress } 1199 * @syscap SystemCapability.Location.Location.Core 1200 * @systemapi 1201 * @since 9 1202 */ 1203 geoAddress: GeoAddress; 1204 } 1205 1206 /** 1207 * Parameters for configuring the location simulation function. 1208 * 1209 * @typedef LocationMockConfig 1210 * @syscap SystemCapability.Location.Location.Core 1211 * @systemapi 1212 * @since 9 1213 */ 1214 export interface LocationMockConfig { 1215 /** 1216 * Interval for reporting simulated locations. 1217 * 1218 * @type { number } 1219 * @syscap SystemCapability.Location.Location.Core 1220 * @systemapi 1221 * @since 9 1222 */ 1223 timeInterval: number; 1224 1225 /** 1226 * Mock location array. 1227 * 1228 * @type { Array<Location> } 1229 * @syscap SystemCapability.Location.Location.Core 1230 * @systemapi 1231 * @since 9 1232 */ 1233 locations: Array<Location>; 1234 } 1235 1236 /** 1237 * Satellite status information. 1238 * 1239 * @typedef SatelliteStatusInfo 1240 * @syscap SystemCapability.Location.Location.Gnss 1241 * @since 9 1242 */ 1243 export interface SatelliteStatusInfo { 1244 /** 1245 * Number of satellites. 1246 * 1247 * @type { number } 1248 * @syscap SystemCapability.Location.Location.Gnss 1249 * @since 9 1250 */ 1251 satellitesNumber: number; 1252 1253 /** 1254 * Satellite ID array. 1255 * 1256 * @type { Array<number> } 1257 * @syscap SystemCapability.Location.Location.Gnss 1258 * @since 9 1259 */ 1260 satelliteIds: Array<number>; 1261 1262 /** 1263 * Carrier to noise density array. 1264 * 1265 * @type { Array<number> } 1266 * @syscap SystemCapability.Location.Location.Gnss 1267 * @since 9 1268 */ 1269 carrierToNoiseDensitys: Array<number>; 1270 1271 /** 1272 * Satellite altitude array. 1273 * 1274 * @type { Array<number> } 1275 * @syscap SystemCapability.Location.Location.Gnss 1276 * @since 9 1277 */ 1278 altitudes: Array<number>; 1279 1280 /** 1281 * Satellite azimuth array. 1282 * 1283 * @type { Array<number> } 1284 * @syscap SystemCapability.Location.Location.Gnss 1285 * @since 9 1286 */ 1287 azimuths: Array<number>; 1288 1289 /** 1290 * Satellite carrier frequency array. 1291 * 1292 * @type { Array<number> } 1293 * @syscap SystemCapability.Location.Location.Gnss 1294 * @since 9 1295 */ 1296 carrierFrequencies: Array<number>; 1297 1298 /** 1299 * Satellite constellation type array. 1300 * 1301 * @type { ?Array<SatelliteConstellationCategory> } 1302 * @syscap SystemCapability.Location.Location.Gnss 1303 * @since 12 1304 */ 1305 satelliteConstellation?: Array<SatelliteConstellationCategory>; 1306 1307 /** 1308 * Satellite additional information array. 1309 * 1310 * @type { ?Array<number> } 1311 * @syscap SystemCapability.Location.Location.Gnss 1312 * @since 12 1313 */ 1314 satelliteAdditionalInfo?: Array<number>; 1315 } 1316 1317 /** 1318 * Parameters for requesting to report cache location information. 1319 * 1320 * @typedef CachedGnssLocationsRequest 1321 * @syscap SystemCapability.Location.Location.Gnss 1322 * @since 9 1323 */ 1324 export interface CachedGnssLocationsRequest { 1325 /** 1326 * GNSS cache location report period. 1327 * 1328 * @type { number } 1329 * @syscap SystemCapability.Location.Location.Gnss 1330 * @since 9 1331 */ 1332 reportingPeriodSec: number; 1333 1334 /** 1335 * Indicates whether to wake up the listener when the GNSS cache location queue is full. 1336 * 1337 * @type { boolean } 1338 * @syscap SystemCapability.Location.Location.Gnss 1339 * @since 9 1340 */ 1341 wakeUpCacheQueueFull: boolean; 1342 } 1343 1344 /** 1345 * Configuring parameters in GNSS geofence requests. 1346 * 1347 * @typedef GnssGeofenceRequest 1348 * @syscap SystemCapability.Location.Location.Geofence 1349 * @since 12 1350 */ 1351 export interface GnssGeofenceRequest { 1352 /** 1353 * Circular fence information. 1354 * 1355 * @type { Geofence } 1356 * @syscap SystemCapability.Location.Location.Geofence 1357 * @since 12 1358 */ 1359 geofence: Geofence; 1360 1361 /** 1362 * Indicates geofence transition status monitored. 1363 * 1364 * @type { Array<GeofenceTransitionEvent> } 1365 * @syscap SystemCapability.Location.Location.Geofence 1366 * @since 12 1367 */ 1368 monitorTransitionEvents: Array<GeofenceTransitionEvent>; 1369 1370 /** 1371 * Indicates the geofence notifications to publish. 1372 * 1373 * @type { ?Array<NotificationRequest> } 1374 * @syscap SystemCapability.Location.Location.Geofence 1375 * @since 12 1376 */ 1377 notifications?: Array<NotificationRequest>; 1378 1379 /** 1380 * Indicates the callback for reporting the geofence transition status. 1381 * 1382 * @type { AsyncCallback<GeofenceTransition> } 1383 * @syscap SystemCapability.Location.Location.Geofence 1384 * @since 12 1385 */ 1386 geofenceTransitionCallback: AsyncCallback<GeofenceTransition>; 1387 } 1388 1389 /** 1390 * Configuring parameters in geofence requests. 1391 * 1392 * @typedef GeofenceRequest 1393 * @syscap SystemCapability.Location.Location.Geofence 1394 * @since 9 1395 */ 1396 export interface GeofenceRequest { 1397 /** 1398 * Indicate the user scenario. 1399 * 1400 * @type { LocationRequestScenario } 1401 * @syscap SystemCapability.Location.Location.Geofence 1402 * @since 9 1403 */ 1404 scenario: LocationRequestScenario; 1405 1406 /** 1407 * Circular fence information. 1408 * 1409 * @type { Geofence } 1410 * @syscap SystemCapability.Location.Location.Geofence 1411 * @since 9 1412 */ 1413 geofence: Geofence; 1414 } 1415 1416 /** 1417 * Circular fence information. 1418 * 1419 * @typedef Geofence 1420 * @syscap SystemCapability.Location.Location.Geofence 1421 * @since 9 1422 */ 1423 export interface Geofence { 1424 /** 1425 * Latitude of the center point of the circular fence. 1426 * 1427 * @type { number } 1428 * @syscap SystemCapability.Location.Location.Geofence 1429 * @since 9 1430 */ 1431 latitude: number; 1432 1433 /** 1434 * Longitude of the center point of the circular fence. 1435 * 1436 * @type { number } 1437 * @syscap SystemCapability.Location.Location.Geofence 1438 * @since 9 1439 */ 1440 longitude: number; 1441 1442 /** 1443 * Coordinate system type. 1444 * 1445 * @type { ?CoordinateSystemType } 1446 * @syscap SystemCapability.Location.Location.Geofence 1447 * @since 12 1448 */ 1449 coordinateSystemType?: CoordinateSystemType; 1450 1451 /** 1452 * Radius of the circular fence. 1453 * 1454 * @type { number } 1455 * @syscap SystemCapability.Location.Location.Geofence 1456 * @since 9 1457 */ 1458 radius: number; 1459 1460 /** 1461 * Expiration of the circular fence. 1462 * 1463 * @type { number } 1464 * @syscap SystemCapability.Location.Location.Geofence 1465 * @since 9 1466 */ 1467 expiration: number; 1468 } 1469 1470 /** 1471 * Configuring parameters in reverse geocode requests. 1472 * 1473 * @typedef ReverseGeoCodeRequest 1474 * @syscap SystemCapability.Location.Location.Geocoder 1475 * @since 9 1476 */ 1477 export interface ReverseGeoCodeRequest { 1478 /** 1479 * Indicates the language area information. 1480 * 1481 * @type { ?string } 1482 * @syscap SystemCapability.Location.Location.Geocoder 1483 * @since 9 1484 */ 1485 locale?: string; 1486 1487 /** 1488 * Indicates the country information. 1489 * 1490 * @type { ?string } 1491 * @syscap SystemCapability.Location.Location.Geocoder 1492 * @since 12 1493 */ 1494 country?: string; 1495 1496 /** 1497 * Latitude for reverse geocoding query. 1498 * 1499 * @type { number } 1500 * @syscap SystemCapability.Location.Location.Geocoder 1501 * @since 9 1502 */ 1503 latitude: number; 1504 1505 /** 1506 * Longitude for reverse geocoding query. 1507 * 1508 * @type { number } 1509 * @syscap SystemCapability.Location.Location.Geocoder 1510 * @since 9 1511 */ 1512 longitude: number; 1513 1514 /** 1515 * Indicates the maximum number of addresses returned by reverse geocoding query. 1516 * 1517 * @type { ?number } 1518 * @syscap SystemCapability.Location.Location.Geocoder 1519 * @since 9 1520 */ 1521 maxItems?: number; 1522 } 1523 1524 /** 1525 * Configuring parameters in geocode requests. 1526 * 1527 * @typedef GeoCodeRequest 1528 * @syscap SystemCapability.Location.Location.Geocoder 1529 * @since 9 1530 */ 1531 export interface GeoCodeRequest { 1532 /** 1533 * Indicates the language area information. 1534 * 1535 * @type { ?string } 1536 * @syscap SystemCapability.Location.Location.Geocoder 1537 * @since 9 1538 */ 1539 locale?: string; 1540 1541 /** 1542 * Indicates the country information. 1543 * 1544 * @type { ?string } 1545 * @syscap SystemCapability.Location.Location.Geocoder 1546 * @since 12 1547 */ 1548 country?: string; 1549 1550 /** 1551 * Address information. 1552 * 1553 * @type { string } 1554 * @syscap SystemCapability.Location.Location.Geocoder 1555 * @since 9 1556 */ 1557 description: string; 1558 1559 /** 1560 * Indicates the maximum number of geocode query results. 1561 * 1562 * @type { ?number } 1563 * @syscap SystemCapability.Location.Location.Geocoder 1564 * @since 9 1565 */ 1566 maxItems?: number; 1567 1568 /** 1569 * Indicates the minimum latitude for geocoding query results. 1570 * 1571 * @type { ?number } 1572 * @syscap SystemCapability.Location.Location.Geocoder 1573 * @since 9 1574 */ 1575 minLatitude?: number; 1576 1577 /** 1578 * Indicates the minimum longitude for geocoding query results. 1579 * 1580 * @type { ?number } 1581 * @syscap SystemCapability.Location.Location.Geocoder 1582 * @since 9 1583 */ 1584 minLongitude?: number; 1585 1586 /** 1587 * Indicates the maximum latitude for geocoding query results. 1588 * 1589 * @type { ?number } 1590 * @syscap SystemCapability.Location.Location.Geocoder 1591 * @since 9 1592 */ 1593 maxLatitude?: number; 1594 1595 /** 1596 * Indicates the maximum longitude for geocoding query results. 1597 * 1598 * @type { ?number } 1599 * @syscap SystemCapability.Location.Location.Geocoder 1600 * @since 9 1601 */ 1602 maxLongitude?: number; 1603 } 1604 1605 /** 1606 * Data struct describes geographic locations. 1607 * 1608 * @typedef GeoAddress 1609 * @syscap SystemCapability.Location.Location.Geocoder 1610 * @since 9 1611 */ 1612 export interface GeoAddress { 1613 /** 1614 * Indicates latitude information. 1615 * A positive value indicates north latitude, 1616 * and a negative value indicates south latitude. 1617 * 1618 * @type { ?number } 1619 * @syscap SystemCapability.Location.Location.Geocoder 1620 * @since 9 1621 */ 1622 latitude?: number; 1623 1624 /** 1625 * Indicates longitude information. 1626 * A positive value indicates east longitude , 1627 * and a negative value indicates west longitude. 1628 * 1629 * @type { ?number } 1630 * @syscap SystemCapability.Location.Location.Geocoder 1631 * @since 9 1632 */ 1633 longitude?: number; 1634 1635 /** 1636 * Indicates language used for the location description. 1637 * zh indicates Chinese, and en indicates English. 1638 * 1639 * @type { ?string } 1640 * @syscap SystemCapability.Location.Location.Geocoder 1641 * @since 9 1642 */ 1643 locale?: string; 1644 1645 /** 1646 * Indicates detailed address information. 1647 * 1648 * @type { ?string } 1649 * @syscap SystemCapability.Location.Location.Geocoder 1650 * @since 9 1651 */ 1652 placeName?: string; 1653 1654 /** 1655 * Indicates country code. 1656 * 1657 * @type { ?string } 1658 * @syscap SystemCapability.Location.Location.Geocoder 1659 * @since 9 1660 */ 1661 countryCode?: string; 1662 1663 /** 1664 * Indicates country name. 1665 * 1666 * @type { ?string } 1667 * @syscap SystemCapability.Location.Location.Geocoder 1668 * @since 9 1669 */ 1670 countryName?: string; 1671 1672 /** 1673 * Indicates administrative region name. 1674 * 1675 * @type { ?string } 1676 * @syscap SystemCapability.Location.Location.Geocoder 1677 * @since 9 1678 */ 1679 administrativeArea?: string; 1680 1681 /** 1682 * Indicates sub-administrative region name. 1683 * 1684 * @type { ?string } 1685 * @syscap SystemCapability.Location.Location.Geocoder 1686 * @since 9 1687 */ 1688 subAdministrativeArea?: string; 1689 1690 /** 1691 * Indicates locality information. 1692 * 1693 * @type { ?string } 1694 * @syscap SystemCapability.Location.Location.Geocoder 1695 * @since 9 1696 */ 1697 locality?: string; 1698 1699 /** 1700 * Indicates sub-locality information. 1701 * 1702 * @type { ?string } 1703 * @syscap SystemCapability.Location.Location.Geocoder 1704 * @since 9 1705 */ 1706 subLocality?: string; 1707 1708 /** 1709 * Indicates road name. 1710 * 1711 * @type { ?string } 1712 * @syscap SystemCapability.Location.Location.Geocoder 1713 * @since 9 1714 */ 1715 roadName?: string; 1716 1717 /** 1718 * Indicates auxiliary road information. 1719 * 1720 * @type { ?string } 1721 * @syscap SystemCapability.Location.Location.Geocoder 1722 * @since 9 1723 */ 1724 subRoadName?: string; 1725 1726 /** 1727 * Indicates house information. 1728 * 1729 * @type { ?string } 1730 * @syscap SystemCapability.Location.Location.Geocoder 1731 * @since 9 1732 */ 1733 premises?: string; 1734 1735 /** 1736 * Indicates postal code. 1737 * 1738 * @type { ?string } 1739 * @syscap SystemCapability.Location.Location.Geocoder 1740 * @since 9 1741 */ 1742 postalCode?: string; 1743 1744 /** 1745 * Indicates phone number. 1746 * 1747 * @type { ?string } 1748 * @syscap SystemCapability.Location.Location.Geocoder 1749 * @since 9 1750 */ 1751 phoneNumber?: string; 1752 1753 /** 1754 * Indicates website URL. 1755 * 1756 * @type { ?string } 1757 * @syscap SystemCapability.Location.Location.Geocoder 1758 * @since 9 1759 */ 1760 addressUrl?: string; 1761 1762 /** 1763 * Indicates additional information. 1764 * 1765 * @type { ?Array<string> } 1766 * @syscap SystemCapability.Location.Location.Geocoder 1767 * @since 9 1768 */ 1769 descriptions?: Array<string>; 1770 1771 /** 1772 * Indicates the amount of additional descriptive information. 1773 * 1774 * @type { ?number } 1775 * @syscap SystemCapability.Location.Location.Geocoder 1776 * @since 9 1777 */ 1778 descriptionsSize?: number; 1779 1780 /** 1781 * Indicates whether it is an mock GeoAddress 1782 * 1783 * @type { ?Boolean } 1784 * @syscap SystemCapability.Location.Location.Geocoder 1785 * @systemapi 1786 * @since 9 1787 */ 1788 isFromMock?: Boolean; 1789 } 1790 1791 /** 1792 * Configuring parameters in location requests. 1793 * 1794 * @typedef LocationRequest 1795 * @syscap SystemCapability.Location.Location.Core 1796 * @since 9 1797 */ 1798 /** 1799 * Configuring parameters in location requests. 1800 * 1801 * @typedef LocationRequest 1802 * @syscap SystemCapability.Location.Location.Core 1803 * @atomicservice 1804 * @since 11 1805 */ 1806 export interface LocationRequest { 1807 /** 1808 * Priority of the location request. 1809 * 1810 * @type { ?LocationRequestPriority } 1811 * @syscap SystemCapability.Location.Location.Core 1812 * @since 9 1813 */ 1814 /** 1815 * Priority of the location request. 1816 * 1817 * @type { ?LocationRequestPriority } 1818 * @syscap SystemCapability.Location.Location.Core 1819 * @atomicservice 1820 * @since 11 1821 */ 1822 priority?: LocationRequestPriority; 1823 1824 /** 1825 * User scenario of the location request. 1826 * 1827 * @type { ?LocationRequestScenario } 1828 * @syscap SystemCapability.Location.Location.Core 1829 * @since 9 1830 */ 1831 /** 1832 * User scenario of the location request. 1833 * 1834 * @type { ?LocationRequestScenario } 1835 * @syscap SystemCapability.Location.Location.Core 1836 * @atomicservice 1837 * @since 11 1838 */ 1839 scenario?: LocationRequestScenario; 1840 1841 /** 1842 * Location report interval. 1843 * 1844 * @type { ?number } 1845 * @syscap SystemCapability.Location.Location.Core 1846 * @since 9 1847 */ 1848 /** 1849 * Location report interval. 1850 * 1851 * @type { ?number } 1852 * @syscap SystemCapability.Location.Location.Core 1853 * @atomicservice 1854 * @since 11 1855 */ 1856 timeInterval?: number; 1857 1858 /** 1859 * Location report distance interval. 1860 * 1861 * @type { ?number } 1862 * @syscap SystemCapability.Location.Location.Core 1863 * @since 9 1864 */ 1865 /** 1866 * Location report distance interval. 1867 * 1868 * @type { ?number } 1869 * @syscap SystemCapability.Location.Location.Core 1870 * @atomicservice 1871 * @since 11 1872 */ 1873 distanceInterval?: number; 1874 1875 /** 1876 * Accuracy requirements for reporting locations. 1877 * 1878 * @type { ?number } 1879 * @syscap SystemCapability.Location.Location.Core 1880 * @since 9 1881 */ 1882 /** 1883 * Accuracy requirements for reporting locations. 1884 * 1885 * @type { ?number } 1886 * @syscap SystemCapability.Location.Location.Core 1887 * @atomicservice 1888 * @since 11 1889 */ 1890 maxAccuracy?: number; 1891 } 1892 1893 /** 1894 * Configuring parameters in current location requests. 1895 * 1896 * @typedef CurrentLocationRequest 1897 * @syscap SystemCapability.Location.Location.Core 1898 * @since 9 1899 */ 1900 /** 1901 * Configuring parameters in current location requests. 1902 * 1903 * @typedef CurrentLocationRequest 1904 * @syscap SystemCapability.Location.Location.Core 1905 * @atomicservice 1906 * @since 11 1907 */ 1908 export interface CurrentLocationRequest { 1909 /** 1910 * Priority of the location request. 1911 * 1912 * @type { ?LocationRequestPriority } 1913 * @syscap SystemCapability.Location.Location.Core 1914 * @since 9 1915 */ 1916 /** 1917 * Priority of the location request. 1918 * 1919 * @type { ?LocationRequestPriority } 1920 * @syscap SystemCapability.Location.Location.Core 1921 * @atomicservice 1922 * @since 11 1923 */ 1924 priority?: LocationRequestPriority; 1925 1926 /** 1927 * User scenario of the location request. 1928 * 1929 * @type { ?LocationRequestScenario } 1930 * @syscap SystemCapability.Location.Location.Core 1931 * @since 9 1932 */ 1933 /** 1934 * User scenario of the location request. 1935 * 1936 * @type { ?LocationRequestScenario } 1937 * @syscap SystemCapability.Location.Location.Core 1938 * @atomicservice 1939 * @since 11 1940 */ 1941 scenario?: LocationRequestScenario; 1942 1943 /** 1944 * Accuracy requirements for reporting locations. 1945 * 1946 * @type { ?number } 1947 * @syscap SystemCapability.Location.Location.Core 1948 * @since 9 1949 */ 1950 /** 1951 * Accuracy requirements for reporting locations. 1952 * 1953 * @type { ?number } 1954 * @syscap SystemCapability.Location.Location.Core 1955 * @atomicservice 1956 * @since 11 1957 */ 1958 maxAccuracy?: number; 1959 1960 /** 1961 * Timeout interval of a single location request. 1962 * 1963 * @type { ?number } 1964 * @syscap SystemCapability.Location.Location.Core 1965 * @since 9 1966 */ 1967 /** 1968 * Timeout interval of a single location request. 1969 * 1970 * @type { ?number } 1971 * @syscap SystemCapability.Location.Location.Core 1972 * @atomicservice 1973 * @since 11 1974 */ 1975 timeoutMs?: number; 1976 } 1977 1978 /** 1979 * Geofence transition status. 1980 * 1981 * @typedef GeofenceTransition 1982 * @syscap SystemCapability.Location.Location.Geofence 1983 * @since 12 1984 */ 1985 export interface GeofenceTransition { 1986 /** 1987 * ID of the geofence. 1988 * 1989 * @type { number } 1990 * @syscap SystemCapability.Location.Location.Geofence 1991 * @since 12 1992 */ 1993 geofenceId: number; 1994 1995 /** 1996 * Indicates the geofence transition status. 1997 * 1998 * @type { GeofenceTransitionEvent } 1999 * @syscap SystemCapability.Location.Location.Geofence 2000 * @since 12 2001 */ 2002 transitionEvent: GeofenceTransitionEvent; 2003 } 2004 2005 /** 2006 * Configuring parameters in continuous location requests. 2007 * 2008 * @typedef ContinuousLocationRequest 2009 * @syscap SystemCapability.Location.Location.Core 2010 * @atomicservice 2011 * @since 12 2012 */ 2013 export interface ContinuousLocationRequest { 2014 /** 2015 * Location report interval, in seconds. 2016 * 2017 * @type { number } 2018 * @syscap SystemCapability.Location.Location.Core 2019 * @atomicservice 2020 * @since 12 2021 */ 2022 interval: number; 2023 2024 /** 2025 * Location scenario. You can select a user activity scenario or power consumption scenario. 2026 * 2027 * @type { UserActivityScenario | PowerConsumptionScenario } 2028 * @syscap SystemCapability.Location.Location.Core 2029 * @atomicservice 2030 * @since 12 2031 */ 2032 locationScenario: UserActivityScenario | PowerConsumptionScenario; 2033 2034 /** 2035 * Indicates the type of sports. 2036 * This parameter is valid only when locationScenario is set to UserActivityScenario.SPORT. 2037 * 2038 * @type { SportsType } 2039 * @syscap SystemCapability.Location.Location.Core 2040 * @systemapi 2041 * @atomicservice 2042 * @since 18 2043 */ 2044 sportsType?: SportsType; 2045 } 2046 2047 /** 2048 * Configuring parameters in single location requests. 2049 * 2050 * @typedef SingleLocationRequest 2051 * @syscap SystemCapability.Location.Location.Core 2052 * @atomicservice 2053 * @since 12 2054 */ 2055 export interface SingleLocationRequest { 2056 /** 2057 * Priority of the location request. 2058 * 2059 * @type { LocatingPriority } 2060 * @syscap SystemCapability.Location.Location.Core 2061 * @atomicservice 2062 * @since 12 2063 */ 2064 locatingPriority: LocatingPriority; 2065 2066 /** 2067 * Timeout of a single location request, in milliseconds. 2068 * 2069 * @type { number } 2070 * @syscap SystemCapability.Location.Location.Core 2071 * @atomicservice 2072 * @since 12 2073 */ 2074 locatingTimeoutMs: number; 2075 } 2076 2077 /** 2078 * Provides information about geographic locations. 2079 * 2080 * @typedef Location 2081 * @syscap SystemCapability.Location.Location.Core 2082 * @since 9 2083 */ 2084 /** 2085 * Provides information about geographic locations. 2086 * 2087 * @typedef Location 2088 * @syscap SystemCapability.Location.Location.Core 2089 * @atomicservice 2090 * @since 11 2091 */ 2092 export interface Location { 2093 /** 2094 * Indicates latitude information. 2095 * A positive value indicates north latitude, 2096 * and a negative value indicates south latitude. 2097 * 2098 * @type { number } 2099 * @syscap SystemCapability.Location.Location.Core 2100 * @since 9 2101 */ 2102 /** 2103 * Indicates latitude information. 2104 * A positive value indicates north latitude, 2105 * and a negative value indicates south latitude. 2106 * 2107 * @type { number } 2108 * @syscap SystemCapability.Location.Location.Core 2109 * @atomicservice 2110 * @since 11 2111 */ 2112 latitude: number; 2113 2114 /** 2115 * Indicates Longitude information. 2116 * A positive value indicates east longitude , 2117 * and a negative value indicates west longitude. 2118 * 2119 * @type { number } 2120 * @syscap SystemCapability.Location.Location.Core 2121 * @since 9 2122 */ 2123 /** 2124 * Indicates Longitude information. 2125 * A positive value indicates east longitude , 2126 * and a negative value indicates west longitude. 2127 * 2128 * @type { number } 2129 * @syscap SystemCapability.Location.Location.Core 2130 * @atomicservice 2131 * @since 11 2132 */ 2133 longitude: number; 2134 2135 /** 2136 * Indicates location altitude, in meters. 2137 * 2138 * @type { number } 2139 * @syscap SystemCapability.Location.Location.Core 2140 * @since 9 2141 */ 2142 /** 2143 * Indicates location altitude, in meters. 2144 * 2145 * @type { number } 2146 * @syscap SystemCapability.Location.Location.Core 2147 * @atomicservice 2148 * @since 11 2149 */ 2150 altitude: number; 2151 2152 /** 2153 * Indicates location accuracy, in meters. 2154 * 2155 * @type { number } 2156 * @syscap SystemCapability.Location.Location.Core 2157 * @since 9 2158 */ 2159 /** 2160 * Indicates location accuracy, in meters. 2161 * 2162 * @type { number } 2163 * @syscap SystemCapability.Location.Location.Core 2164 * @atomicservice 2165 * @since 11 2166 */ 2167 accuracy: number; 2168 2169 /** 2170 * Indicates speed, in m/s. 2171 * 2172 * @type { number } 2173 * @syscap SystemCapability.Location.Location.Core 2174 * @since 9 2175 */ 2176 /** 2177 * Indicates speed, in m/s. 2178 * 2179 * @type { number } 2180 * @syscap SystemCapability.Location.Location.Core 2181 * @atomicservice 2182 * @since 11 2183 */ 2184 speed: number; 2185 2186 /** 2187 * Indicates location timestamp in the UTC format. 2188 * 2189 * @type { number } 2190 * @syscap SystemCapability.Location.Location.Core 2191 * @since 9 2192 */ 2193 /** 2194 * Indicates location timestamp in the UTC format. 2195 * 2196 * @type { number } 2197 * @syscap SystemCapability.Location.Location.Core 2198 * @atomicservice 2199 * @since 11 2200 */ 2201 timeStamp: number; 2202 2203 /** 2204 * Indicates direction information. 2205 * 2206 * @type { number } 2207 * @syscap SystemCapability.Location.Location.Core 2208 * @since 9 2209 */ 2210 /** 2211 * Indicates direction information. 2212 * 2213 * @type { number } 2214 * @syscap SystemCapability.Location.Location.Core 2215 * @atomicservice 2216 * @since 11 2217 */ 2218 direction: number; 2219 2220 /** 2221 * Indicates location timestamp since boot. 2222 * 2223 * @type { number } 2224 * @syscap SystemCapability.Location.Location.Core 2225 * @since 9 2226 */ 2227 /** 2228 * Indicates location timestamp since boot. 2229 * 2230 * @type { number } 2231 * @syscap SystemCapability.Location.Location.Core 2232 * @atomicservice 2233 * @since 11 2234 */ 2235 timeSinceBoot: number; 2236 2237 /** 2238 * Indicates additional information. 2239 * 2240 * @type { ?Array<string> } 2241 * @syscap SystemCapability.Location.Location.Core 2242 * @since 9 2243 */ 2244 /** 2245 * Indicates additional information. 2246 * 2247 * @type { ?Array<string> } 2248 * @syscap SystemCapability.Location.Location.Core 2249 * @atomicservice 2250 * @since 11 2251 */ 2252 additions?: Array<string>; 2253 2254 /** 2255 * Indicates additional information map. 2256 * 2257 * @type { ?Map<string, string> } 2258 * @syscap SystemCapability.Location.Location.Core 2259 * @atomicservice 2260 * @since 12 2261 */ 2262 additionsMap?: Map<string, string>; 2263 2264 /** 2265 * Indicates the amount of additional descriptive information. 2266 * 2267 * @type { ?number } 2268 * @syscap SystemCapability.Location.Location.Core 2269 * @since 9 2270 */ 2271 /** 2272 * Indicates the amount of additional descriptive information. 2273 * 2274 * @type { ?number } 2275 * @syscap SystemCapability.Location.Location.Core 2276 * @atomicservice 2277 * @since 11 2278 */ 2279 additionSize?: number; 2280 2281 /** 2282 * Indicates whether it is an mock location. 2283 * 2284 * @type { ?Boolean } 2285 * @syscap SystemCapability.Location.Location.Core 2286 * @systemapi 2287 * @since 9 2288 */ 2289 isFromMock?: Boolean; 2290 2291 /** 2292 * Indicates vertical position accuracy in meters. 2293 * 2294 * @type { ?number } 2295 * @syscap SystemCapability.Location.Location.Core 2296 * @atomicservice 2297 * @since 12 2298 */ 2299 altitudeAccuracy?: number; 2300 2301 /** 2302 * Indicates speed accuracy in meter per seconds. 2303 * 2304 * @type { ?number } 2305 * @syscap SystemCapability.Location.Location.Core 2306 * @atomicservice 2307 * @since 12 2308 */ 2309 speedAccuracy?: number; 2310 2311 /** 2312 * Indicates direction accuracy in degrees. 2313 * 2314 * @type { ?number } 2315 * @syscap SystemCapability.Location.Location.Core 2316 * @atomicservice 2317 * @since 12 2318 */ 2319 directionAccuracy?: number; 2320 2321 /** 2322 * Time uncertainty Of timeSinceBoot in nanosecond. 2323 * 2324 * @type { ?number } 2325 * @syscap SystemCapability.Location.Location.Core 2326 * @atomicservice 2327 * @since 12 2328 */ 2329 uncertaintyOfTimeSinceBoot?: number; 2330 2331 /** 2332 * Indicates the source of the location. 2333 * 2334 * @type { ?LocationSourceType } 2335 * @syscap SystemCapability.Location.Location.Core 2336 * @atomicservice 2337 * @since 12 2338 */ 2339 sourceType?: LocationSourceType; 2340 } 2341 2342 /** 2343 * Describes the request parameters for obtaining the data required for locating. 2344 * @typedef LocatingRequiredDataConfig 2345 * @syscap SystemCapability.Location.Location.Core 2346 * @systemapi 2347 * @since 10 2348 */ 2349 export interface LocatingRequiredDataConfig { 2350 /** 2351 * Indicates the type of locating required data. 2352 * 2353 * @type {LocatingRequiredDataType} 2354 * @syscap SystemCapability.Location.Location.Core 2355 * @systemapi 2356 * @since 10 2357 */ 2358 type: LocatingRequiredDataType; 2359 2360 /** 2361 * Indicates whether to start scanning. 2362 * 2363 * @type {boolean} 2364 * @syscap SystemCapability.Location.Location.Core 2365 * @systemapi 2366 * @since 10 2367 */ 2368 needStartScan: boolean; 2369 2370 /** 2371 * Indicates the interval between scans. The unit is millisecond. 2372 * This parameter needs to be set only when scanning information is continuously monitored. 2373 * 2374 * @type {?number} 2375 * @syscap SystemCapability.Location.Location.Core 2376 * @systemapi 2377 * @since 10 2378 */ 2379 scanInterval?: number; 2380 2381 /** 2382 * Indicates the timeout period of a single scan. The unit is millisecond. The default value is 10000. 2383 * This parameter needs to be set only when getLocatingRequiredData is used. 2384 * 2385 * @type {?number} 2386 * @syscap SystemCapability.Location.Location.Core 2387 * @systemapi 2388 * @since 10 2389 */ 2390 scanTimeout?: number; 2391 } 2392 2393 /** 2394 * Describes the structure of the data required for locating. 2395 * @typedef LocatingRequiredData 2396 * @syscap SystemCapability.Location.Location.Core 2397 * @systemapi 2398 * @since 10 2399 */ 2400 export interface LocatingRequiredData { 2401 /** 2402 * WiFi scan info. 2403 * 2404 * @type {?WifiScanInfo} 2405 * @syscap SystemCapability.Location.Location.Core 2406 * @systemapi 2407 * @since 10 2408 */ 2409 wifiData?: WifiScanInfo; 2410 2411 /** 2412 * Bluetooth scan info. 2413 * 2414 * @type {?BluetoothScanInfo} 2415 * @syscap SystemCapability.Location.Location.Core 2416 * @systemapi 2417 * @since 10 2418 */ 2419 bluetoothData?: BluetoothScanInfo; 2420 } 2421 2422 /** 2423 * Describes the scanned WiFi information. 2424 * @typedef WifiScanInfo 2425 * @syscap SystemCapability.Location.Location.Core 2426 * @systemapi 2427 * @since 10 2428 */ 2429 export interface WifiScanInfo { 2430 /** 2431 * WiFi SSID: the maximum length is 32. 2432 * 2433 * @type {string} 2434 * @syscap SystemCapability.Location.Location.Core 2435 * @systemapi 2436 * @since 10 2437 */ 2438 ssid: string; 2439 2440 /** 2441 * WiFi bssid(MAC): the length is 6. 2442 * 2443 * @type {string} 2444 * @syscap SystemCapability.Location.Location.Core 2445 * @systemapi 2446 * @since 10 2447 */ 2448 bssid: string; 2449 2450 /** 2451 * Received signal strength indicator (RSSI). 2452 * 2453 * @type {number} 2454 * @syscap SystemCapability.Location.Location.Core 2455 * @systemapi 2456 * @since 10 2457 */ 2458 rssi: number; 2459 2460 /** 2461 * Frequency 2462 * 2463 * @type {number} 2464 * @syscap SystemCapability.Location.Location.Core 2465 * @systemapi 2466 * @since 10 2467 */ 2468 frequency: number; 2469 2470 /** 2471 * Time stamp. 2472 * 2473 * @type {number} 2474 * @syscap SystemCapability.Location.Location.Core 2475 * @systemapi 2476 * @since 10 2477 */ 2478 timestamp: number; 2479 } 2480 2481 /** 2482 * Describes the contents of the Bluetooth scan results. 2483 * 2484 * @typedef BluetoothScanInfo 2485 * @syscap SystemCapability.Location.Location.Core 2486 * @systemapi 2487 * @since 10 2488 */ 2489 export interface BluetoothScanInfo { 2490 /** 2491 * The local name of the device. 2492 * 2493 * @type {string} 2494 * @syscap SystemCapability.Location.Location.Core 2495 * @systemapi 2496 * @since 10 2497 */ 2498 deviceName: string; 2499 2500 /** 2501 * Mac address of the scanned device. 2502 * 2503 * @type {string} 2504 * @syscap SystemCapability.Location.Location.Core 2505 * @systemapi 2506 * @since 10 2507 */ 2508 macAddress: string; 2509 2510 /** 2511 * RSSI of the remote device. 2512 * 2513 * @type {number} 2514 * @syscap SystemCapability.Location.Location.Core 2515 * @systemapi 2516 * @since 10 2517 */ 2518 rssi: number; 2519 2520 /** 2521 * Time stamp. 2522 * 2523 * @type {number} 2524 * @syscap SystemCapability.Location.Location.Core 2525 * @systemapi 2526 * @since 10 2527 */ 2528 timestamp: number; 2529 } 2530 2531 /** 2532 * Describes the contents of the bluetooth scan results. 2533 * 2534 * @typedef BluetoothScanResult 2535 * @syscap SystemCapability.Location.Location.Core 2536 * @since 16 2537 */ 2538 export interface BluetoothScanResult { 2539 /** 2540 * Address of the scanned device 2541 * 2542 * @type { string } 2543 * @syscap SystemCapability.Location.Location.Core 2544 * @since 16 2545 */ 2546 deviceId: string; 2547 2548 /** 2549 * RSSI of the scanned device 2550 * 2551 * @type { number } 2552 * @syscap SystemCapability.Location.Location.Core 2553 * @since 16 2554 */ 2555 rssi: number; 2556 2557 /** 2558 * The raw data of broadcast packet 2559 * 2560 * @type { ?ArrayBuffer } 2561 * @syscap SystemCapability.Location.Location.Core 2562 * @since 16 2563 */ 2564 data?: ArrayBuffer; 2565 2566 /** 2567 * The local name of the scanned device 2568 * 2569 * @type { string } 2570 * @syscap SystemCapability.Location.Location.Core 2571 * @since 16 2572 */ 2573 deviceName: string; 2574 2575 /** 2576 * Connectable of the scanned device 2577 * 2578 * @type { boolean } 2579 * @syscap SystemCapability.Location.Location.Core 2580 * @since 16 2581 */ 2582 connectable: boolean; 2583 } 2584 2585 /** 2586 * Enum for the source of the location. 2587 * 2588 * @enum { number } 2589 * @syscap SystemCapability.Location.Location.Core 2590 * @atomicservice 2591 * @since 12 2592 */ 2593 export enum LocationSourceType { 2594 /** 2595 * The location is obtained from the GNSS. 2596 * 2597 * @syscap SystemCapability.Location.Location.Core 2598 * @atomicservice 2599 * @since 12 2600 */ 2601 GNSS = 1, 2602 2603 /** 2604 * The location comes from the network positioning technology. 2605 * 2606 * @syscap SystemCapability.Location.Location.Core 2607 * @atomicservice 2608 * @since 12 2609 */ 2610 NETWORK = 2, 2611 2612 /** 2613 * The location comes from the indoor positioning technology. 2614 * 2615 * @syscap SystemCapability.Location.Location.Core 2616 * @atomicservice 2617 * @since 12 2618 */ 2619 INDOOR = 3, 2620 2621 /** 2622 * The location comes from the GNSS RTK technology. 2623 * 2624 * @syscap SystemCapability.Location.Location.Core 2625 * @atomicservice 2626 * @since 12 2627 */ 2628 RTK = 4 2629 } 2630 2631 /** 2632 * Enum for coordinate system type. 2633 * 2634 * @enum { number } 2635 * @syscap SystemCapability.Location.Location.Geofence 2636 * @since 12 2637 */ 2638 export enum CoordinateSystemType { 2639 /** 2640 * WGS84 coordinates system. 2641 * 2642 * @syscap SystemCapability.Location.Location.Geofence 2643 * @since 12 2644 */ 2645 WGS84 = 1, 2646 2647 /** 2648 * GCJ-02 coordinates system. 2649 * 2650 * @syscap SystemCapability.Location.Location.Geofence 2651 * @since 12 2652 */ 2653 GCJ02 = 2 2654 } 2655 2656 /** 2657 * Enum for location icon status. 2658 * 2659 * @enum { number } 2660 * @syscap SystemCapability.Location.Location.Core 2661 * @systemapi 2662 * @since 12 2663 */ 2664 export enum LocationIconStatus { 2665 /** 2666 * The locating service is not started. 2667 * 2668 * @syscap SystemCapability.Location.Location.Core 2669 * @systemapi 2670 * @since 12 2671 */ 2672 LOCATING_NOT_STARTED = 0, 2673 2674 /** 2675 * The normal locating service is started. 2676 * 2677 * @syscap SystemCapability.Location.Location.Core 2678 * @systemapi 2679 * @since 12 2680 */ 2681 LOCATING_STARTED = 1, 2682 2683 /** 2684 * The HD locating service(RTK) is started. 2685 * 2686 * @syscap SystemCapability.Location.Location.Core 2687 * @systemapi 2688 * @since 12 2689 */ 2690 HD_LOCATING_STARTED = 2 2691 } 2692 2693 /** 2694 * Enum for location error code. 2695 * 2696 * @enum { number } 2697 * @syscap SystemCapability.Location.Location.Core 2698 * @atomicservice 2699 * @since 12 2700 */ 2701 export enum LocationError { 2702 /** 2703 * Default cause for location failure. 2704 * 2705 * @syscap SystemCapability.Location.Location.Core 2706 * @atomicservice 2707 * @since 12 2708 */ 2709 LOCATING_FAILED_DEFAULT = -1, 2710 2711 /** 2712 * Locating failed because the location permission fails to be verified. 2713 * 2714 * @syscap SystemCapability.Location.Location.Core 2715 * @atomicservice 2716 * @since 12 2717 */ 2718 LOCATING_FAILED_LOCATION_PERMISSION_DENIED = -2, 2719 2720 /** 2721 * Locating failed because the app is in the background and the background location permission verification failed. 2722 * 2723 * @syscap SystemCapability.Location.Location.Core 2724 * @atomicservice 2725 * @since 12 2726 */ 2727 LOCATING_FAILED_BACKGROUND_PERMISSION_DENIED = -3, 2728 2729 /** 2730 * Locating failed because the location switch is turned off. 2731 * 2732 * @syscap SystemCapability.Location.Location.Core 2733 * @atomicservice 2734 * @since 12 2735 */ 2736 LOCATING_FAILED_LOCATION_SWITCH_OFF = -4, 2737 2738 /** 2739 * Locating failed because internet access failure. 2740 * 2741 * @syscap SystemCapability.Location.Location.Core 2742 * @atomicservice 2743 * @since 12 2744 */ 2745 LOCATING_FAILED_INTERNET_ACCESS_FAILURE = -5 2746 } 2747 2748 /** 2749 * Enum for geofence transition status. 2750 * 2751 * @enum { number } 2752 * @syscap SystemCapability.Location.Location.Geofence 2753 * @since 12 2754 */ 2755 export enum GeofenceTransitionEvent { 2756 /** 2757 * The device is within the geofence. 2758 * 2759 * @syscap SystemCapability.Location.Location.Geofence 2760 * @since 12 2761 */ 2762 GEOFENCE_TRANSITION_EVENT_ENTER = 1, 2763 2764 /** 2765 * The device is out of the geofence. 2766 * 2767 * @syscap SystemCapability.Location.Location.Geofence 2768 * @since 12 2769 */ 2770 GEOFENCE_TRANSITION_EVENT_EXIT = 2, 2771 2772 /** 2773 * The device is in the geographical fence for a period of time. 2774 * 2775 * @syscap SystemCapability.Location.Location.Geofence 2776 * @since 12 2777 */ 2778 GEOFENCE_TRANSITION_EVENT_DWELL = 4 2779 } 2780 2781 /** 2782 * Enum for satellite constellation category. 2783 * 2784 * @enum { number } 2785 * @syscap SystemCapability.Location.Location.Gnss 2786 * @since 12 2787 */ 2788 export enum SatelliteConstellationCategory { 2789 /** 2790 * Invalid value. 2791 * 2792 * @syscap SystemCapability.Location.Location.Gnss 2793 * @since 12 2794 */ 2795 CONSTELLATION_CATEGORY_UNKNOWN = 0, 2796 2797 /** 2798 * GPS. 2799 * 2800 * @syscap SystemCapability.Location.Location.Gnss 2801 * @since 12 2802 */ 2803 CONSTELLATION_CATEGORY_GPS = 1, 2804 2805 /** 2806 * SBAS. 2807 * 2808 * @syscap SystemCapability.Location.Location.Gnss 2809 * @since 12 2810 */ 2811 CONSTELLATION_CATEGORY_SBAS = 2, 2812 2813 /** 2814 * GLONASS. 2815 * 2816 * @syscap SystemCapability.Location.Location.Gnss 2817 * @since 12 2818 */ 2819 CONSTELLATION_CATEGORY_GLONASS = 3, 2820 2821 /** 2822 * QZSS. 2823 * 2824 * @syscap SystemCapability.Location.Location.Gnss 2825 * @since 12 2826 */ 2827 CONSTELLATION_CATEGORY_QZSS = 4, 2828 2829 /** 2830 * BEIDOU. 2831 * 2832 * @syscap SystemCapability.Location.Location.Gnss 2833 * @since 12 2834 */ 2835 CONSTELLATION_CATEGORY_BEIDOU = 5, 2836 2837 /** 2838 * GALILEO. 2839 * 2840 * @syscap SystemCapability.Location.Location.Gnss 2841 * @since 12 2842 */ 2843 CONSTELLATION_CATEGORY_GALILEO = 6, 2844 2845 /** 2846 * IRNSS. 2847 * 2848 * @syscap SystemCapability.Location.Location.Gnss 2849 * @since 12 2850 */ 2851 CONSTELLATION_CATEGORY_IRNSS = 7 2852 } 2853 2854 /** 2855 * Enum for satellite additional information. 2856 * 2857 * @enum { number } 2858 * @syscap SystemCapability.Location.Location.Gnss 2859 * @since 12 2860 */ 2861 export enum SatelliteAdditionalInfo { 2862 /** 2863 * Default value. 2864 * 2865 * @syscap SystemCapability.Location.Location.Gnss 2866 * @since 12 2867 */ 2868 SATELLITES_ADDITIONAL_INFO_NULL = 0, 2869 2870 /** 2871 * Ephemeris data exist. 2872 * 2873 * @syscap SystemCapability.Location.Location.Gnss 2874 * @since 12 2875 */ 2876 SATELLITES_ADDITIONAL_INFO_EPHEMERIS_DATA_EXIST = 1, 2877 2878 /** 2879 * Almanac data exist. 2880 * 2881 * @syscap SystemCapability.Location.Location.Gnss 2882 * @since 12 2883 */ 2884 SATELLITES_ADDITIONAL_INFO_ALMANAC_DATA_EXIST = 2, 2885 2886 /** 2887 * This satellite is being used in location fix. 2888 * 2889 * @syscap SystemCapability.Location.Location.Gnss 2890 * @since 12 2891 */ 2892 SATELLITES_ADDITIONAL_INFO_USED_IN_FIX = 4, 2893 2894 /** 2895 * Carrier frequency exist. 2896 * 2897 * @syscap SystemCapability.Location.Location.Gnss 2898 * @since 12 2899 */ 2900 SATELLITES_ADDITIONAL_INFO_CARRIER_FREQUENCY_EXIST = 8 2901 } 2902 2903 /** 2904 * Enum for user activity scenario. 2905 * 2906 * @enum { number } 2907 * @syscap SystemCapability.Location.Location.Core 2908 * @atomicservice 2909 * @since 12 2910 */ 2911 export enum UserActivityScenario { 2912 /** 2913 * Navigation scenario. High positioning precision and real-time performance are required. 2914 * 2915 * @syscap SystemCapability.Location.Location.Core 2916 * @atomicservice 2917 * @since 12 2918 */ 2919 NAVIGATION = 0x401, 2920 2921 /** 2922 * Sport scenario. High positioning precision is required. 2923 * 2924 * @syscap SystemCapability.Location.Location.Core 2925 * @atomicservice 2926 * @since 12 2927 */ 2928 SPORT = 0x402, 2929 2930 /** 2931 * Transport scenario. High positioning precision and real-time performance are required. 2932 * 2933 * @syscap SystemCapability.Location.Location.Core 2934 * @atomicservice 2935 * @since 12 2936 */ 2937 TRANSPORT = 0x403, 2938 2939 /** 2940 * Daily life scenarios. Low requirements on positioning precision. 2941 * 2942 * @syscap SystemCapability.Location.Location.Core 2943 * @atomicservice 2944 * @since 12 2945 */ 2946 DAILY_LIFE_SERVICE = 0x404 2947 } 2948 2949 /** 2950 * Enum for locating priority. 2951 * 2952 * @enum { number } 2953 * @syscap SystemCapability.Location.Location.Core 2954 * @atomicservice 2955 * @since 12 2956 */ 2957 export enum LocatingPriority { 2958 /** 2959 * Preferentially ensure the highest locating accuracy. 2960 * 2961 * @syscap SystemCapability.Location.Location.Core 2962 * @atomicservice 2963 * @since 12 2964 */ 2965 PRIORITY_ACCURACY = 0x501, 2966 2967 /** 2968 * Preferentially ensure the fastest locating speed. 2969 * 2970 * @syscap SystemCapability.Location.Location.Core 2971 * @atomicservice 2972 * @since 12 2973 */ 2974 PRIORITY_LOCATING_SPEED = 0x502 2975 } 2976 2977 /** 2978 * Enum for location priority. 2979 * 2980 * @enum { number } 2981 * @syscap SystemCapability.Location.Location.Core 2982 * @since 9 2983 */ 2984 /** 2985 * Enum for location priority. 2986 * 2987 * @enum { number } 2988 * @syscap SystemCapability.Location.Location.Core 2989 * @atomicservice 2990 * @since 11 2991 */ 2992 export enum LocationRequestPriority { 2993 /** 2994 * Default priority. 2995 * 2996 * @syscap SystemCapability.Location.Location.Core 2997 * @since 9 2998 */ 2999 /** 3000 * Default priority. 3001 * 3002 * @syscap SystemCapability.Location.Location.Core 3003 * @atomicservice 3004 * @since 11 3005 */ 3006 UNSET = 0x200, 3007 3008 /** 3009 * Preferentially ensure the locating accuracy. 3010 * 3011 * @syscap SystemCapability.Location.Location.Core 3012 * @since 9 3013 */ 3014 /** 3015 * Preferentially ensure the locating accuracy. 3016 * 3017 * @syscap SystemCapability.Location.Location.Core 3018 * @atomicservice 3019 * @since 11 3020 */ 3021 ACCURACY, 3022 3023 /** 3024 * Preferentially ensure low power consumption for locating. 3025 * 3026 * @syscap SystemCapability.Location.Location.Core 3027 * @since 9 3028 */ 3029 /** 3030 * Preferentially ensure low power consumption for locating. 3031 * 3032 * @syscap SystemCapability.Location.Location.Core 3033 * @atomicservice 3034 * @since 11 3035 */ 3036 LOW_POWER, 3037 3038 /** 3039 * Preferentially ensure that the first location is time-consuming. 3040 * 3041 * @syscap SystemCapability.Location.Location.Core 3042 * @since 9 3043 */ 3044 /** 3045 * Preferentially ensure that the first location is time-consuming. 3046 * 3047 * @syscap SystemCapability.Location.Location.Core 3048 * @atomicservice 3049 * @since 11 3050 */ 3051 FIRST_FIX 3052 } 3053 3054 /** 3055 * Enum for location scenario. 3056 * 3057 * @enum { number } 3058 * @syscap SystemCapability.Location.Location.Core 3059 * @since 9 3060 */ 3061 /** 3062 * Enum for location scenario. 3063 * 3064 * @enum { number } 3065 * @syscap SystemCapability.Location.Location.Core 3066 * @atomicservice 3067 * @since 11 3068 */ 3069 export enum LocationRequestScenario { 3070 /** 3071 * Default scenario. 3072 * 3073 * @syscap SystemCapability.Location.Location.Core 3074 * @since 9 3075 */ 3076 /** 3077 * Default scenario. 3078 * 3079 * @syscap SystemCapability.Location.Location.Core 3080 * @atomicservice 3081 * @since 11 3082 */ 3083 UNSET = 0x300, 3084 3085 /** 3086 * Navigation scenario. High positioning precision and real-time performance are required. 3087 * 3088 * @syscap SystemCapability.Location.Location.Core 3089 * @since 9 3090 */ 3091 /** 3092 * Navigation scenario. High positioning precision and real-time performance are required. 3093 * 3094 * @syscap SystemCapability.Location.Location.Core 3095 * @atomicservice 3096 * @since 11 3097 */ 3098 NAVIGATION, 3099 3100 /** 3101 * Trajectory tracking scenario. High positioning precision is required. 3102 * 3103 * @syscap SystemCapability.Location.Location.Core 3104 * @since 9 3105 */ 3106 /** 3107 * Trajectory tracking scenario. High positioning precision is required. 3108 * 3109 * @syscap SystemCapability.Location.Location.Core 3110 * @atomicservice 3111 * @since 11 3112 */ 3113 TRAJECTORY_TRACKING, 3114 3115 /** 3116 * Car hailing scenario. High positioning precision and real-time performance are required. 3117 * 3118 * @syscap SystemCapability.Location.Location.Core 3119 * @since 9 3120 */ 3121 /** 3122 * Car hailing scenario. High positioning precision and real-time performance are required. 3123 * 3124 * @syscap SystemCapability.Location.Location.Core 3125 * @atomicservice 3126 * @since 11 3127 */ 3128 CAR_HAILING, 3129 3130 /** 3131 * Daily life scenarios. Low requirements on positioning precision and real-time performance. 3132 * 3133 * @syscap SystemCapability.Location.Location.Core 3134 * @since 9 3135 */ 3136 /** 3137 * Daily life scenarios. Low requirements on positioning precision and real-time performance. 3138 * 3139 * @syscap SystemCapability.Location.Location.Core 3140 * @atomicservice 3141 * @since 11 3142 */ 3143 DAILY_LIFE_SERVICE, 3144 3145 /** 3146 * Power saving scenarios. 3147 * 3148 * @syscap SystemCapability.Location.Location.Core 3149 * @since 9 3150 */ 3151 /** 3152 * Power saving scenarios. 3153 * 3154 * @syscap SystemCapability.Location.Location.Core 3155 * @atomicservice 3156 * @since 11 3157 */ 3158 NO_POWER 3159 } 3160 3161 /** 3162 * Enum for power consumption scenario. 3163 * 3164 * @enum { number } 3165 * @syscap SystemCapability.Location.Location.Core 3166 * @atomicservice 3167 * @since 12 3168 */ 3169 export enum PowerConsumptionScenario { 3170 /** 3171 * High power consumption mode. 3172 * 3173 * @syscap SystemCapability.Location.Location.Core 3174 * @atomicservice 3175 * @since 12 3176 */ 3177 HIGH_POWER_CONSUMPTION = 0x601, 3178 3179 /** 3180 * Low power consumption mode. 3181 * 3182 * @syscap SystemCapability.Location.Location.Core 3183 * @atomicservice 3184 * @since 12 3185 */ 3186 LOW_POWER_CONSUMPTION = 0x602, 3187 3188 /** 3189 * Power saving scenarios. 3190 * 3191 * @syscap SystemCapability.Location.Location.Core 3192 * @atomicservice 3193 * @since 12 3194 */ 3195 NO_POWER_CONSUMPTION = 0x603 3196 } 3197 3198 /** 3199 * Enum for location privacy type. 3200 * 3201 * @enum { number } 3202 * @syscap SystemCapability.Location.Location.Core 3203 * @systemapi 3204 * @since 9 3205 */ 3206 export enum LocationPrivacyType { 3207 /** 3208 * Other scenarios. 3209 * 3210 * @syscap SystemCapability.Location.Location.Core 3211 * @systemapi 3212 * @since 9 3213 */ 3214 OTHERS = 0, 3215 3216 /** 3217 * Privacy agreement for the startup wizard scenario. 3218 * 3219 * @syscap SystemCapability.Location.Location.Core 3220 * @systemapi 3221 * @since 9 3222 */ 3223 STARTUP, 3224 3225 /** 3226 * Privacy agreement pop-up when network location is enabled. 3227 * 3228 * @syscap SystemCapability.Location.Location.Core 3229 * @systemapi 3230 * @since 9 3231 */ 3232 CORE_LOCATION 3233 } 3234 3235 /** 3236 * Enum for sports type 3237 * 3238 * @enum { number } 3239 * @syscap SystemCapability.Location.Location.Core 3240 * @atomicservice 3241 * @since 18 3242 */ 3243 export enum SportsType { 3244 /** 3245 * Indicates running. 3246 * 3247 * @syscap SystemCapability.Location.Location.Core 3248 * @atomicservice 3249 * @since 18 3250 */ 3251 RUNNING = 1, 3252 3253 /** 3254 * Indicates walking. 3255 * 3256 * @syscap SystemCapability.Location.Location.Core 3257 * @atomicservice 3258 * @since 18 3259 */ 3260 WALKING, 3261 3262 /** 3263 * Indicates cycling. 3264 * 3265 * @syscap SystemCapability.Location.Location.Core 3266 * @atomicservice 3267 * @since 18 3268 */ 3269 CYCLING 3270 } 3271 3272 /** 3273 * Location subsystem command structure. 3274 * 3275 * @typedef LocationCommand 3276 * @syscap SystemCapability.Location.Location.Core 3277 * @since 9 3278 */ 3279 export interface LocationCommand { 3280 /** 3281 * Information about the scenario where the command is sent. 3282 * 3283 * @type { LocationRequestScenario } 3284 * @syscap SystemCapability.Location.Location.Core 3285 * @since 9 3286 */ 3287 scenario: LocationRequestScenario; 3288 3289 /** 3290 * Sent command content. 3291 * 3292 * @type { string } 3293 * @syscap SystemCapability.Location.Location.Core 3294 * @since 9 3295 */ 3296 command: string; 3297 } 3298 3299 /** 3300 * Country code structure. 3301 * 3302 * @typedef CountryCode 3303 * @syscap SystemCapability.Location.Location.Core 3304 * @since 9 3305 */ 3306 export interface CountryCode { 3307 /** 3308 * Country code character string. 3309 * 3310 * @type { string } 3311 * @syscap SystemCapability.Location.Location.Core 3312 * @since 9 3313 */ 3314 country: string; 3315 3316 /** 3317 * Country code source. 3318 * 3319 * @type { CountryCodeType } 3320 * @syscap SystemCapability.Location.Location.Core 3321 * @since 9 3322 */ 3323 type: CountryCodeType; 3324 } 3325 3326 /** 3327 * Enum for country code type. 3328 * 3329 * @enum { number } 3330 * @syscap SystemCapability.Location.Location.Core 3331 * @since 9 3332 */ 3333 export enum CountryCodeType { 3334 /** 3335 * Country code obtained from the locale setting. 3336 * 3337 * @syscap SystemCapability.Location.Location.Core 3338 * @since 9 3339 */ 3340 COUNTRY_CODE_FROM_LOCALE = 1, 3341 3342 /** 3343 * Country code obtained from the SIM information. 3344 * 3345 * @syscap SystemCapability.Location.Location.Core 3346 * @since 9 3347 */ 3348 COUNTRY_CODE_FROM_SIM, 3349 3350 /** 3351 * Query the country code information from the reverse geocoding result. 3352 * 3353 * @syscap SystemCapability.Location.Location.Core 3354 * @since 9 3355 */ 3356 COUNTRY_CODE_FROM_LOCATION, 3357 3358 /** 3359 * Obtain the country code from the cell registration information. 3360 * 3361 * @syscap SystemCapability.Location.Location.Core 3362 * @since 9 3363 */ 3364 COUNTRY_CODE_FROM_NETWORK 3365 } 3366 3367 /** 3368 * Enum for locating required data type. 3369 * 3370 * @enum { number } 3371 * @syscap SystemCapability.Location.Location.Core 3372 * @systemapi 3373 * @since 10 3374 */ 3375 export enum LocatingRequiredDataType { 3376 /** 3377 * Obtains WiFi scanning information for locating. 3378 * 3379 * @syscap SystemCapability.Location.Location.Core 3380 * @systemapi 3381 * @since 10 3382 */ 3383 WIFI = 1, 3384 3385 /** 3386 * Obtains BT scanning information for locating. 3387 * 3388 * @syscap SystemCapability.Location.Location.Core 3389 * @systemapi 3390 * @since 10 3391 */ 3392 BLUETOOTH 3393 } 3394} 3395 3396export default geoLocationManager; 3397