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'; 23 24/** 25 * Provides interfaces for acquiring location information, managing location switches, 26 * geocoding, reverse geocoding, country code, fencing and other functions. 27 * 28 * @namespace geoLocationManager 29 * @since 9 30 */ 31/** 32 * Provides interfaces for acquiring location information, managing location switches, 33 * geocoding, reverse geocoding, country code, fencing and other functions. 34 * 35 * @namespace geoLocationManager 36 * @atomicservice 37 * @since 11 38 */ 39declare namespace geoLocationManager { 40 /** 41 * Subscribe location changed. 42 * 43 * @permission ohos.permission.APPROXIMATELY_LOCATION 44 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 45 * @param { LocationRequest } request - Indicates the location request parameters. 46 * @param { Callback<Location> } callback - Indicates the callback for reporting the location result. 47 * @throws { BusinessError } 201 - Permission denied. 48 * @throws { BusinessError } 401 - Parameter error. 49 * @throws { BusinessError } 801 - Capability not supported. 50 * @throws { BusinessError } 3301000 - Location service is unavailable. 51 * @throws { BusinessError } 3301100 - The location switch is off. 52 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 53 * @syscap SystemCapability.Location.Location.Core 54 * @since 9 55 */ 56 /** 57 * Subscribe location changed. 58 * 59 * @permission ohos.permission.APPROXIMATELY_LOCATION 60 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 61 * @param { LocationRequest } request - Indicates the location request parameters. 62 * @param { Callback<Location> } callback - Indicates the callback for reporting the location result. 63 * @throws { BusinessError } 201 - Permission denied. 64 * @throws { BusinessError } 401 - Parameter error. 65 * @throws { BusinessError } 801 - Capability not supported. 66 * @throws { BusinessError } 3301000 - Location service is unavailable. 67 * @throws { BusinessError } 3301100 - The location switch is off. 68 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 69 * @syscap SystemCapability.Location.Location.Core 70 * @atomicservice 71 * @since 11 72 */ 73 function on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>): void; 74 75 /** 76 * Unsubscribe location changed. 77 * 78 * @permission ohos.permission.APPROXIMATELY_LOCATION 79 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 80 * @param { Callback<Location> } [callback] - Indicates the callback for reporting the location result. 81 * @throws { BusinessError } 201 - Permission denied. 82 * @throws { BusinessError } 401 - Parameter error. 83 * @throws { BusinessError } 801 - Capability not supported. 84 * @throws { BusinessError } 3301000 - Location service is unavailable. 85 * @throws { BusinessError } 3301100 - The location switch is off. 86 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 87 * @syscap SystemCapability.Location.Location.Core 88 * @since 9 89 */ 90 /** 91 * Unsubscribe location changed. 92 * 93 * @permission ohos.permission.APPROXIMATELY_LOCATION 94 * @param { 'locationChange' } type - Indicates the location service event to be subscribed to. 95 * @param { Callback<Location> } [callback] - Indicates the callback for reporting the location result. 96 * @throws { BusinessError } 201 - Permission denied. 97 * @throws { BusinessError } 401 - Parameter error. 98 * @throws { BusinessError } 801 - Capability not supported. 99 * @throws { BusinessError } 3301000 - Location service is unavailable. 100 * @throws { BusinessError } 3301100 - The location switch is off. 101 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 102 * @syscap SystemCapability.Location.Location.Core 103 * @atomicservice 104 * @since 11 105 */ 106 function off(type: 'locationChange', callback?: Callback<Location>): void; 107 108 /** 109 * Subscribe location switch changed. 110 * 111 * @param { 'locationEnabledChange' } type - Indicates the location service event to be subscribed to. 112 * @param { Callback<boolean> } callback - Indicates the callback for reporting the location switch status. 113 * @throws { BusinessError } 401 - Parameter error. 114 * @throws { BusinessError } 801 - Capability not supported. 115 * @throws { BusinessError } 3301000 - Location service is unavailable. 116 * @syscap SystemCapability.Location.Location.Core 117 * @since 9 118 */ 119 function on(type: 'locationEnabledChange', callback: Callback<boolean>): void; 120 121 /** 122 * Unsubscribe location switch changed. 123 * 124 * @param { 'locationEnabledChange' } type - Indicates the location service event to be subscribed to. 125 * @param { Callback<boolean> } [callback] - Indicates the callback for reporting the location switch status. 126 * @throws { BusinessError } 401 - Parameter error. 127 * @throws { BusinessError } 801 - Capability not supported. 128 * @throws { BusinessError } 3301000 - Location service is unavailable. 129 * @syscap SystemCapability.Location.Location.Core 130 * @since 9 131 */ 132 function off(type: 'locationEnabledChange', callback?: Callback<boolean>): void; 133 134 /** 135 * Subscribe to cache GNSS locations update messages. 136 * 137 * @permission ohos.permission.APPROXIMATELY_LOCATION 138 * @param { 'cachedGnssLocationsChange' } type - Indicates the location service event to be subscribed to. 139 * @param { CachedGnssLocationsRequest } request - Indicates the cached GNSS locations request parameters. 140 * @param { Callback<Array<Location>> } callback - Indicates the callback for reporting the cached GNSS locations. 141 * @throws { BusinessError } 201 - Permission denied. 142 * @throws { BusinessError } 401 - Parameter error. 143 * @throws { BusinessError } 801 - Capability not supported. 144 * @throws { BusinessError } 3301000 - Location service is unavailable. 145 * @throws { BusinessError } 3301100 - The location switch is off. 146 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 147 * @syscap SystemCapability.Location.Location.Gnss 148 * @since 9 149 */ 150 function on(type: 'cachedGnssLocationsChange', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>): void; 151 152 /** 153 * Unsubscribe to cache GNSS locations update messages. 154 * 155 * @permission ohos.permission.APPROXIMATELY_LOCATION 156 * @param { 'cachedGnssLocationsChange' } type - Indicates the location service event to be subscribed to. 157 * @param { Callback<Array<Location>> } [callback] - Indicates the callback for reporting the cached gnss locations. 158 * @throws { BusinessError } 201 - Permission denied. 159 * @throws { BusinessError } 401 - Parameter error. 160 * @throws { BusinessError } 801 - Capability not supported. 161 * @throws { BusinessError } 3301000 - Location service is unavailable. 162 * @throws { BusinessError } 3301100 - The location switch is off. 163 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 164 * @syscap SystemCapability.Location.Location.Gnss 165 * @since 9 166 */ 167 function off(type: 'cachedGnssLocationsChange', callback?: Callback<Array<Location>>): void; 168 169 /** 170 * Subscribe satellite status changed. 171 * 172 * @permission ohos.permission.APPROXIMATELY_LOCATION 173 * @param { 'satelliteStatusChange' } type - Indicates the location service event to be subscribed to. 174 * @param { Callback<SatelliteStatusInfo> } callback - Indicates the callback for reporting the satellite status. 175 * @throws { BusinessError } 201 - Permission denied. 176 * @throws { BusinessError } 401 - Parameter error. 177 * @throws { BusinessError } 801 - Capability not supported. 178 * @throws { BusinessError } 3301000 - Location service is unavailable. 179 * @throws { BusinessError } 3301100 - The location switch is off. 180 * @syscap SystemCapability.Location.Location.Gnss 181 * @since 9 182 */ 183 function on(type: 'satelliteStatusChange', callback: Callback<SatelliteStatusInfo>): void; 184 185 /** 186 * Unsubscribe satellite status changed. 187 * 188 * @permission ohos.permission.APPROXIMATELY_LOCATION 189 * @param { 'satelliteStatusChange' } type - Indicates the location service event to be subscribed to. 190 * @param { Callback<SatelliteStatusInfo> } [callback] - Indicates the callback for reporting the satellite status. 191 * @throws { BusinessError } 201 - Permission denied. 192 * @throws { BusinessError } 401 - Parameter error. 193 * @throws { BusinessError } 801 - Capability not supported. 194 * @throws { BusinessError } 3301000 - Location service is unavailable. 195 * @throws { BusinessError } 3301100 - The location switch is off. 196 * @syscap SystemCapability.Location.Location.Gnss 197 * @since 9 198 */ 199 function off(type: 'satelliteStatusChange', callback?: Callback<SatelliteStatusInfo>): void; 200 201 /** 202 * Subscribe nmea message changed. 203 * 204 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 205 * @param { 'nmeaMessage' } type - Indicates the location service event to be subscribed to. 206 * @param { Callback<string> } callback - Indicates the callback for reporting the nmea message. 207 * @throws { BusinessError } 201 - Permission denied. 208 * @throws { BusinessError } 401 - Parameter error. 209 * @throws { BusinessError } 801 - Capability not supported. 210 * @throws { BusinessError } 3301000 - Location service is unavailable. 211 * @throws { BusinessError } 3301100 - The location switch is off. 212 * @syscap SystemCapability.Location.Location.Gnss 213 * @since 9 214 */ 215 function on(type: 'nmeaMessage', callback: Callback<string>): void; 216 217 /** 218 * Unsubscribe nmea message changed. 219 * 220 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 221 * @param { 'nmeaMessage' } type - Indicates the location service event to be subscribed to. 222 * @param { Callback<string> } [callback] - Indicates the callback for reporting the nmea message. 223 * @throws { BusinessError } 201 - Permission denied. 224 * @throws { BusinessError } 401 - Parameter error. 225 * @throws { BusinessError } 801 - Capability not supported. 226 * @throws { BusinessError } 3301000 - Location service is unavailable. 227 * @throws { BusinessError } 3301100 - The location switch is off. 228 * @syscap SystemCapability.Location.Location.Gnss 229 * @since 9 230 */ 231 function off(type: 'nmeaMessage', callback?: Callback<string>): void; 232 233 /** 234 * Add a geofence and subscribe geo fence status changed. 235 * 236 * @permission ohos.permission.APPROXIMATELY_LOCATION 237 * @param { 'gnssFenceStatusChange' } type - Indicates the location service event to be subscribed to. 238 * @param { GeofenceRequest } request - Indicates the Geo-fence configuration parameters. 239 * @param { WantAgent } want - Indicates which ability to start when the geofence event is triggered. 240 * @throws { BusinessError } 201 - Permission denied. 241 * @throws { BusinessError } 401 - Parameter error. 242 * @throws { BusinessError } 801 - Capability not supported. 243 * @throws { BusinessError } 3301000 - Location service is unavailable. 244 * @throws { BusinessError } 3301100 - The location switch is off. 245 * @throws { BusinessError } 3301600 - Failed to operate the geofence. 246 * @syscap SystemCapability.Location.Location.Geofence 247 * @since 9 248 */ 249 function on(type: 'gnssFenceStatusChange', request: GeofenceRequest, want: WantAgent): void; 250 251 /** 252 * Remove a geofence and unsubscribe geo fence status changed. 253 * 254 * @permission ohos.permission.APPROXIMATELY_LOCATION 255 * @param { 'gnssFenceStatusChange' } type - Indicates the location service event to be subscribed to. 256 * @param { GeofenceRequest } request - Indicates the Geo-fence configuration parameters. 257 * @param { WantAgent } want - Indicates which ability to start when the geofence event is triggered. 258 * @throws { BusinessError } 201 - Permission denied. 259 * @throws { BusinessError } 401 - Parameter error. 260 * @throws { BusinessError } 801 - Capability not supported. 261 * @throws { BusinessError } 3301000 - Location service is unavailable. 262 * @throws { BusinessError } 3301100 - The location switch is off. 263 * @throws { BusinessError } 3301600 - Failed to operate the geofence. 264 * @syscap SystemCapability.Location.Location.Geofence 265 * @since 9 266 */ 267 function off(type: 'gnssFenceStatusChange', request: GeofenceRequest, want: WantAgent): void; 268 269 /** 270 * Registering the callback function for listening to country code changes. 271 * 272 * @param { 'countryCodeChange' } type - Indicates the location service event to be subscribed to. 273 * @param { Callback<CountryCode> } callback - Indicates the callback for reporting country code changes. 274 * @throws { BusinessError } 401 - Parameter error. 275 * @throws { BusinessError } 801 - Capability not supported. 276 * @throws { BusinessError } 3301000 - Location service is unavailable. 277 * @throws { BusinessError } 3301500 - Failed to query the area information. 278 * @syscap SystemCapability.Location.Location.Core 279 * @since 9 280 */ 281 function on(type: 'countryCodeChange', callback: Callback<CountryCode>): void; 282 283 /** 284 * Unregistering the callback function for listening to country code changes. 285 * 286 * @param { 'countryCodeChange' } type - Indicates the location service event to be subscribed to. 287 * @param { Callback<CountryCode> } [callback] - Indicates the callback for reporting country code changes. 288 * @throws { BusinessError } 401 - Parameter error. 289 * @throws { BusinessError } 801 - Capability not supported. 290 * @throws { BusinessError } 3301000 - Location service is unavailable. 291 * @throws { BusinessError } 3301500 - Failed to query the area information. 292 * @syscap SystemCapability.Location.Location.Core 293 * @since 9 294 */ 295 function off(type: 'countryCodeChange', callback?: Callback<CountryCode>): void; 296 297 /** 298 * Subscribe to changes in WiFi/BT scanning information, 299 * and use the WiFi/BT scanning information for localization. 300 * 301 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 302 * @param { 'locatingRequiredDataChange' } type - Indicates the location service event to be subscribed to. 303 * @param { LocatingRequiredDataConfig } config - Indicates the locating required data configuration parameters. 304 * @param { Callback<Array<LocatingRequiredData>> } [callback] - Indicates the callback for reporting WiFi/BT scan info. 305 * @throws { BusinessError } 201 - Permission denied. 306 * @throws { BusinessError } 401 - Invalid parameter. 307 * @throws { BusinessError } 801 - Capability not supported. 308 * @throws { BusinessError } 3301800 - Failed to start WiFi or Bluetooth scanning. 309 * @syscap SystemCapability.Location.Location.Core 310 * @systemapi 311 * @since 10 312 */ 313 function on(type: 'locatingRequiredDataChange', config: LocatingRequiredDataConfig, callback: Callback<Array<LocatingRequiredData>>): void; 314 315 /** 316 * Stop WiFi/BT scanning and unsubscribe from WiFi/BT scanning information changes. 317 * 318 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 319 * @param { 'locatingRequiredDataChange' } type - Indicates the location service event to be subscribed to. 320 * @param { Callback<Array<LocatingRequiredData>> } [callback] - Indicates the callback for reporting WiFi/BT scan info. 321 * @throws { BusinessError } 201 - Permission denied. 322 * @throws { BusinessError } 401 - Invalid parameter. 323 * @throws { BusinessError } 801 - Capability not supported. 324 * @syscap SystemCapability.Location.Location.Core 325 * @systemapi 326 * @since 10 327 */ 328 function off(type: 'locatingRequiredDataChange', callback?: Callback<Array<LocatingRequiredData>>): void; 329 330 /** 331 * Obtain current location. 332 * 333 * @permission ohos.permission.APPROXIMATELY_LOCATION 334 * @param { CurrentLocationRequest } request - Indicates the location request parameters. 335 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 336 * @throws { BusinessError } 201 - Permission denied. 337 * @throws { BusinessError } 401 - Parameter error. 338 * @throws { BusinessError } 801 - Capability not supported. 339 * @throws { BusinessError } 3301000 - Location service is unavailable. 340 * @throws { BusinessError } 3301100 - The location switch is off. 341 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 342 * @syscap SystemCapability.Location.Location.Core 343 * @since 9 344 */ 345 /** 346 * Obtain current location. 347 * 348 * @permission ohos.permission.APPROXIMATELY_LOCATION 349 * @param { CurrentLocationRequest } request - Indicates the location request parameters. 350 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 351 * @throws { BusinessError } 201 - Permission denied. 352 * @throws { BusinessError } 401 - Parameter error. 353 * @throws { BusinessError } 801 - Capability not supported. 354 * @throws { BusinessError } 3301000 - Location service is unavailable. 355 * @throws { BusinessError } 3301100 - The location switch is off. 356 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 357 * @syscap SystemCapability.Location.Location.Core 358 * @atomicservice 359 * @since 11 360 */ 361 function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>): void; 362 363 /** 364 * Obtain current location. 365 * 366 * @permission ohos.permission.APPROXIMATELY_LOCATION 367 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 368 * @throws { BusinessError } 201 - Permission denied. 369 * @throws { BusinessError } 401 - Parameter error. 370 * @throws { BusinessError } 801 - Capability not supported. 371 * @throws { BusinessError } 3301000 - Location service is unavailable. 372 * @throws { BusinessError } 3301100 - The location switch is off. 373 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 374 * @syscap SystemCapability.Location.Location.Core 375 * @since 9 376 */ 377 /** 378 * Obtain current location. 379 * 380 * @permission ohos.permission.APPROXIMATELY_LOCATION 381 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 382 * @throws { BusinessError } 201 - Permission denied. 383 * @throws { BusinessError } 401 - Parameter error. 384 * @throws { BusinessError } 801 - Capability not supported. 385 * @throws { BusinessError } 3301000 - Location service is unavailable. 386 * @throws { BusinessError } 3301100 - The location switch is off. 387 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 388 * @syscap SystemCapability.Location.Location.Core 389 * @atomicservice 390 * @since 11 391 */ 392 function getCurrentLocation(callback: AsyncCallback<Location>): void; 393 394 /** 395 * Obtain current location. 396 * 397 * @permission ohos.permission.APPROXIMATELY_LOCATION 398 * @param { CurrentLocationRequest } [request] - Indicates the location request parameters. 399 * @returns { Promise<Location> } The promise returned by the function. 400 * @throws { BusinessError } 201 - Permission denied. 401 * @throws { BusinessError } 401 - Parameter error. 402 * @throws { BusinessError } 801 - Capability not supported. 403 * @throws { BusinessError } 3301000 - Location service is unavailable. 404 * @throws { BusinessError } 3301100 - The location switch is off. 405 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 406 * @syscap SystemCapability.Location.Location.Core 407 * @since 9 408 */ 409 /** 410 * Obtain current location. 411 * 412 * @permission ohos.permission.APPROXIMATELY_LOCATION 413 * @param { CurrentLocationRequest } [request] - Indicates the location request parameters. 414 * @returns { Promise<Location> } The promise returned by the function. 415 * @throws { BusinessError } 201 - Permission denied. 416 * @throws { BusinessError } 401 - Parameter error. 417 * @throws { BusinessError } 801 - Capability not supported. 418 * @throws { BusinessError } 3301000 - Location service is unavailable. 419 * @throws { BusinessError } 3301100 - The location switch is off. 420 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 421 * @syscap SystemCapability.Location.Location.Core 422 * @atomicservice 423 * @since 11 424 */ 425 function getCurrentLocation(request?: CurrentLocationRequest): Promise<Location>; 426 427 /** 428 * Obtain last known location. 429 * 430 * @permission ohos.permission.APPROXIMATELY_LOCATION 431 * @returns { Location } The last known location information. 432 * @throws { BusinessError } 201 - Permission denied. 433 * @throws { BusinessError } 801 - Capability not supported. 434 * @throws { BusinessError } 3301000 - Location service is unavailable. 435 * @throws { BusinessError } 3301100 - The location switch is off. 436 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 437 * @syscap SystemCapability.Location.Location.Core 438 * @since 9 439 */ 440 /** 441 * Obtain last known location. 442 * 443 * @permission ohos.permission.APPROXIMATELY_LOCATION 444 * @returns { Location } The last known location information. 445 * @throws { BusinessError } 201 - Permission denied. 446 * @throws { BusinessError } 801 - Capability not supported. 447 * @throws { BusinessError } 3301000 - Location service is unavailable. 448 * @throws { BusinessError } 3301100 - The location switch is off. 449 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 450 * @syscap SystemCapability.Location.Location.Core 451 * @atomicservice 452 * @since 11 453 */ 454 function getLastLocation(): Location; 455 456 /** 457 * Obtain current location switch status. 458 * 459 * @returns { boolean } Returns {@code true} if the location switch on, returns {@code false} otherwise. 460 * @throws { BusinessError } 801 - Capability not supported. 461 * @throws { BusinessError } 3301000 - Location service is unavailable. 462 * @syscap SystemCapability.Location.Location.Core 463 * @since 9 464 */ 465 /** 466 * Obtain current location switch status. 467 * 468 * @returns { boolean } Returns {@code true} if the location switch on, returns {@code false} otherwise. 469 * @throws { BusinessError } 801 - Capability not supported. 470 * @throws { BusinessError } 3301000 - Location service is unavailable. 471 * @syscap SystemCapability.Location.Location.Core 472 * @atomicservice 473 * @since 11 474 */ 475 function isLocationEnabled(): boolean; 476 477 /** 478 * Enable location switch. 479 * 480 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 481 * @param { AsyncCallback<void> } callback - Indicates the callback for reporting the error message. 482 * @throws { BusinessError } 201 - Permission denied. 483 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 484 * @throws { BusinessError } 401 - Parameter error. 485 * @throws { BusinessError } 801 - Capability not supported. 486 * @throws { BusinessError } 3301000 - Location service is unavailable. 487 * @syscap SystemCapability.Location.Location.Core 488 * @systemapi 489 * @since 9 490 */ 491 function enableLocation(callback: AsyncCallback<void>): void; 492 493 /** 494 * Enable location switch. 495 * 496 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 497 * @returns { Promise<void> } The promise returned by the function. 498 * @throws { BusinessError } 201 - Permission denied. 499 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 500 * @throws { BusinessError } 801 - Capability not supported. 501 * @throws { BusinessError } 3301000 - Location service is unavailable. 502 * @syscap SystemCapability.Location.Location.Core 503 * @systemapi 504 * @since 9 505 */ 506 function enableLocation(): Promise<void>; 507 508 /** 509 * Disable location switch. 510 * 511 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 512 * @throws { BusinessError } 201 - Permission denied. 513 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 514 * @throws { BusinessError } 801 - Capability not supported. 515 * @throws { BusinessError } 3301000 - Location service is unavailable. 516 * @syscap SystemCapability.Location.Location.Core 517 * @systemapi 518 * @since 9 519 */ 520 function disableLocation(): void; 521 522 /** 523 * Obtain address info from location. 524 * 525 * @param { ReverseGeoCodeRequest } request - Indicates the reverse geocode query parameters. 526 * @param { AsyncCallback<Array<GeoAddress>> } callback - Indicates the callback for reporting the address info. 527 * @throws { BusinessError } 401 - Parameter error. 528 * @throws { BusinessError } 801 - Capability not supported. 529 * @throws { BusinessError } 3301000 - Location service is unavailable. 530 * @throws { BusinessError } 3301300 - Reverse geocoding query failed. 531 * @syscap SystemCapability.Location.Location.Geocoder 532 * @since 9 533 */ 534 function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; 535 536 /** 537 * Obtain address info from location. 538 * 539 * @param { ReverseGeoCodeRequest } request - Indicates the reverse geocode query parameters. 540 * @returns { Promise<Array<GeoAddress>> } The promise returned by the function. 541 * @throws { BusinessError } 401 - Parameter error. 542 * @throws { BusinessError } 801 - Capability not supported. 543 * @throws { BusinessError } 3301000 - Location service is unavailable. 544 * @throws { BusinessError } 3301300 - Reverse geocoding query failed. 545 * @syscap SystemCapability.Location.Location.Geocoder 546 * @since 9 547 */ 548 function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise<Array<GeoAddress>>; 549 550 /** 551 * Obtain latitude and longitude info from location address. 552 * 553 * @param { GeoCodeRequest } request - Indicates the geocode query parameters. 554 * @param { AsyncCallback<Array<GeoAddress>> } callback - Indicates the callback for reporting the latitude and longitude result. 555 * @throws { BusinessError } 401 - Parameter error. 556 * @throws { BusinessError } 801 - Capability not supported. 557 * @throws { BusinessError } 3301000 - Location service is unavailable. 558 * @throws { BusinessError } 3301400 - Geocoding query failed. 559 * @syscap SystemCapability.Location.Location.Geocoder 560 * @since 9 561 */ 562 function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; 563 564 /** 565 * Obtain latitude and longitude info from location address. 566 * 567 * @param { GeoCodeRequest } request - Indicates the geocode query parameters. 568 * @returns { Promise<Array<GeoAddress>> } The promise returned by the function. 569 * @throws { BusinessError } 401 - Parameter error. 570 * @throws { BusinessError } 801 - Capability not supported. 571 * @throws { BusinessError } 3301000 - Location service is unavailable. 572 * @throws { BusinessError } 3301400 - Geocoding query failed. 573 * @syscap SystemCapability.Location.Location.Geocoder 574 * @since 9 575 */ 576 function getAddressesFromLocationName(request: GeoCodeRequest): Promise<Array<GeoAddress>>; 577 578 /** 579 * Obtain geocoding service status. 580 * 581 * @returns { boolean } Returns {@code true} if geocoding service is available, returns {@code false} otherwise. 582 * @throws { BusinessError } 801 - Capability not supported. 583 * @throws { BusinessError } 3301000 - Location service is unavailable. 584 * @syscap SystemCapability.Location.Location.Geocoder 585 * @since 9 586 */ 587 function isGeocoderAvailable(): boolean; 588 589 /** 590 * Obtain the number of cached GNSS locations reported at a time. 591 * 592 * @permission ohos.permission.APPROXIMATELY_LOCATION 593 * @param { AsyncCallback<number> } callback - Indicates the callback for reporting the cached GNSS locations size. 594 * @throws { BusinessError } 201 - Permission denied. 595 * @throws { BusinessError } 401 - Parameter error. 596 * @throws { BusinessError } 801 - Capability not supported. 597 * @throws { BusinessError } 3301000 - Location service is unavailable. 598 * @throws { BusinessError } 3301100 - The location switch is off. 599 * @syscap SystemCapability.Location.Location.Gnss 600 * @since 9 601 */ 602 function getCachedGnssLocationsSize(callback: AsyncCallback<number>): void; 603 604 /** 605 * Obtain the number of cached GNSS locations. 606 * 607 * @permission ohos.permission.APPROXIMATELY_LOCATION 608 * @returns { Promise<number> } The promise returned by the function. 609 * @throws { BusinessError } 201 - Permission denied. 610 * @throws { BusinessError } 801 - Capability not supported. 611 * @throws { BusinessError } 3301000 - Location service is unavailable. 612 * @throws { BusinessError } 3301100 - The location switch is off. 613 * @syscap SystemCapability.Location.Location.Gnss 614 * @since 9 615 */ 616 function getCachedGnssLocationsSize(): Promise<number>; 617 618 /** 619 * All prepared GNSS locations are returned to the application through the callback function, 620 * and the bottom-layer buffer is cleared. 621 * 622 * @permission ohos.permission.APPROXIMATELY_LOCATION 623 * @param { AsyncCallback<void> } callback - Indicates the callback for reporting the error message. 624 * If the function fails to execute, the error message will be carried in the first parameter err of AsyncCallback, 625 * If the function executes successfully, execute the callback function only, no data will be returned. 626 * @throws { BusinessError } 201 - Permission denied. 627 * @throws { BusinessError } 401 - Parameter error. 628 * @throws { BusinessError } 801 - Capability not supported. 629 * @throws { BusinessError } 3301000 - Location service is unavailable. 630 * @throws { BusinessError } 3301100 - The location switch is off. 631 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 632 * @syscap SystemCapability.Location.Location.Gnss 633 * @since 9 634 */ 635 function flushCachedGnssLocations(callback: AsyncCallback<void>): void; 636 637 /** 638 * All prepared GNSS locations are returned to the application, 639 * and the bottom-layer buffer is cleared. 640 * 641 * @permission ohos.permission.APPROXIMATELY_LOCATION 642 * @returns { Promise<void> } The promise returned by the function. 643 * @throws { BusinessError } 201 - Permission denied. 644 * @throws { BusinessError } 801 - Capability not supported. 645 * @throws { BusinessError } 3301000 - Location service is unavailable. 646 * @throws { BusinessError } 3301100 - The location switch is off. 647 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 648 * @syscap SystemCapability.Location.Location.Gnss 649 * @since 9 650 */ 651 function flushCachedGnssLocations(): Promise<void>; 652 653 /** 654 * Send extended commands to location subsystem. 655 * 656 * @param { LocationCommand } command - Indicates the extended command message body. 657 * @param { AsyncCallback<void> } callback - Indicates the callback for reporting the error message. 658 * If the function fails to execute, the error message will be carried in the first parameter err of AsyncCallback, 659 * If the function executes successfully, execute the callback function only, no data will be returned. 660 * @throws { BusinessError } 401 - Parameter error. 661 * @throws { BusinessError } 801 - Capability not supported. 662 * @throws { BusinessError } 3301000 - Location service is unavailable. 663 * @syscap SystemCapability.Location.Location.Core 664 * @since 9 665 */ 666 function sendCommand(command: LocationCommand, callback: AsyncCallback<void>): void; 667 668 /** 669 * Send extended commands to location subsystem. 670 * 671 * @param { LocationCommand } command - Indicates the extended command message body. 672 * @returns { Promise<void> } The promise returned by the function. 673 * @throws { BusinessError } 401 - Parameter error. 674 * @throws { BusinessError } 801 - Capability not supported. 675 * @throws { BusinessError } 3301000 - Location service is unavailable. 676 * @syscap SystemCapability.Location.Location.Core 677 * @since 9 678 */ 679 function sendCommand(command: LocationCommand): Promise<void>; 680 681 /** 682 * Obtain the current country code. 683 * 684 * @param { AsyncCallback<CountryCode> } callback - Indicates the callback for reporting the country code. 685 * @throws { BusinessError } 401 - Parameter error. 686 * @throws { BusinessError } 801 - Capability not supported. 687 * @throws { BusinessError } 3301000 - Location service is unavailable. 688 * @throws { BusinessError } 3301500 - Failed to query the area information. 689 * @syscap SystemCapability.Location.Location.Core 690 * @since 9 691 */ 692 function getCountryCode(callback: AsyncCallback<CountryCode>): void; 693 694 /** 695 * Obtain the current country code. 696 * 697 * @returns { Promise<CountryCode> } The promise returned by the function. 698 * @throws { BusinessError } 801 - Capability not supported. 699 * @throws { BusinessError } 3301000 - Location service is unavailable. 700 * @throws { BusinessError } 3301500 - Failed to query the area information. 701 * @syscap SystemCapability.Location.Location.Core 702 * @since 9 703 */ 704 function getCountryCode(): Promise<CountryCode>; 705 706 /** 707 * Enable the geographical location simulation function. 708 * 709 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 710 * @throws { BusinessError } 801 - Capability not supported. 711 * @throws { BusinessError } 3301000 - Location service is unavailable. 712 * @throws { BusinessError } 3301100 - The location switch is off. 713 * @syscap SystemCapability.Location.Location.Core 714 * @systemapi 715 * @since 9 716 */ 717 function enableLocationMock(): void; 718 719 /** 720 * Disable the geographical location simulation function. 721 * 722 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 723 * @throws { BusinessError } 801 - Capability not supported. 724 * @throws { BusinessError } 3301000 - Location service is unavailable. 725 * @throws { BusinessError } 3301100 - The location switch is off. 726 * @syscap SystemCapability.Location.Location.Core 727 * @systemapi 728 * @since 9 729 */ 730 function disableLocationMock(): void; 731 732 /** 733 * Set the configuration parameters for location simulation. 734 * 735 * @param { LocationMockConfig } config - Indicates the configuration parameters for location simulation. 736 * Contains the array of locations and reporting intervals that need to be simulated. 737 * @throws { BusinessError } 401 - Parameter error. 738 * @throws { BusinessError } 801 - Capability not supported. 739 * @throws { BusinessError } 3301000 - Location service is unavailable. 740 * @throws { BusinessError } 3301100 - The location switch is off. 741 * @syscap SystemCapability.Location.Location.Core 742 * @systemapi 743 * @since 9 744 */ 745 function setMockedLocations(config: LocationMockConfig): void; 746 747 /** 748 * Enable the reverse geocoding simulation function. 749 * 750 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 751 * @throws { BusinessError } 801 - Capability not supported. 752 * @throws { BusinessError } 3301000 - Location service is unavailable. 753 * @syscap SystemCapability.Location.Location.Core 754 * @systemapi 755 * @since 9 756 */ 757 function enableReverseGeocodingMock(): void; 758 759 /** 760 * Disable the reverse geocoding simulation function. 761 * 762 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 763 * @throws { BusinessError } 801 - Capability not supported. 764 * @throws { BusinessError } 3301000 - Location service is unavailable. 765 * @syscap SystemCapability.Location.Location.Core 766 * @systemapi 767 * @since 9 768 */ 769 function disableReverseGeocodingMock(): void; 770 771 /** 772 * Set the configuration parameters for simulating reverse geocoding. 773 * 774 * @param { Array<ReverseGeocodingMockInfo> } mockInfos - Indicates the set of locations and place names to be simulated. 775 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 776 * @throws { BusinessError } 401 - Parameter error. 777 * @throws { BusinessError } 801 - Capability not supported. 778 * @throws { BusinessError } 3301000 - Location service is unavailable. 779 * @syscap SystemCapability.Location.Location.Core 780 * @systemapi 781 * @since 9 782 */ 783 function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>): void; 784 785 /** 786 * Querying location privacy protocol confirmation status. 787 * 788 * @param { LocationPrivacyType } type - Indicates location privacy protocol type. 789 * @returns { boolean } Returns {@code true} if the location privacy protocol has been confirmed, returns {@code false} otherwise. 790 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 791 * @throws { BusinessError } 401 - Parameter error. 792 * @throws { BusinessError } 801 - Capability not supported. 793 * @throws { BusinessError } 3301000 - Location service is unavailable. 794 * @syscap SystemCapability.Location.Location.Core 795 * @systemapi 796 * @since 9 797 */ 798 function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean; 799 800 /** 801 * Set location privacy protocol confirmation status. 802 * 803 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 804 * @param { LocationPrivacyType } type - Indicates location privacy protocol type. 805 * @param { boolean } isConfirmed - Indicates whether the location privacy protocol has been confirmed. 806 * @throws { BusinessError } 201 - Permission denied. 807 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 808 * @throws { BusinessError } 401 - Parameter error. 809 * @throws { BusinessError } 801 - Capability not supported. 810 * @throws { BusinessError } 3301000 - Location service is unavailable. 811 * @syscap SystemCapability.Location.Location.Core 812 * @systemapi 813 * @since 9 814 */ 815 function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void; 816 817 /** 818 * Get WiFi/BT scanning information, and use the WiFi/BT scanning information for localization. 819 * 820 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 821 * @param { LocatingRequiredDataConfig } config - Indicates the request parameters for obtaining the data required for locating. 822 * @returns { Promise<Array<LocatingRequiredData>> } The promise returned by the function, for reporting WiFi/BT scan info. 823 * @throws { BusinessError } 201 - Permission denied. 824 * @throws { BusinessError } 401 - Invalid parameter. 825 * @throws { BusinessError } 801 - Capability not supported. 826 * @throws { BusinessError } 3301800 - Failed to start WiFi or Bluetooth scanning. 827 * @syscap SystemCapability.Location.Location.Core 828 * @systemapi 829 * @since 10 830 */ 831 function getLocatingRequiredData(config: LocatingRequiredDataConfig): Promise<Array<LocatingRequiredData>>; 832 833 /** 834 * Configuration parameters for simulating reverse geocoding. 835 * 836 * @typedef ReverseGeocodingMockInfo 837 * @syscap SystemCapability.Location.Location.Core 838 * @systemapi 839 * @since 9 840 */ 841 export interface ReverseGeocodingMockInfo { 842 /** 843 * Location for which reverse geocoding query is required. 844 * 845 * @type { ReverseGeoCodeRequest } 846 * @syscap SystemCapability.Location.Location.Core 847 * @systemapi 848 * @since 9 849 */ 850 location: ReverseGeoCodeRequest; 851 852 /** 853 * Actual address information corresponding to the location. 854 * 855 * @type { GeoAddress } 856 * @syscap SystemCapability.Location.Location.Core 857 * @systemapi 858 * @since 9 859 */ 860 geoAddress: GeoAddress; 861 } 862 863 /** 864 * Parameters for configuring the location simulation function. 865 * 866 * @typedef LocationMockConfig 867 * @syscap SystemCapability.Location.Location.Core 868 * @systemapi 869 * @since 9 870 */ 871 export interface LocationMockConfig { 872 /** 873 * Interval for reporting simulated locations. 874 * 875 * @type { number } 876 * @syscap SystemCapability.Location.Location.Core 877 * @systemapi 878 * @since 9 879 */ 880 timeInterval: number; 881 882 /** 883 * Mock location array. 884 * 885 * @type { Array<Location> } 886 * @syscap SystemCapability.Location.Location.Core 887 * @systemapi 888 * @since 9 889 */ 890 locations: Array<Location>; 891 } 892 893 /** 894 * Satellite status information. 895 * 896 * @typedef SatelliteStatusInfo 897 * @syscap SystemCapability.Location.Location.Gnss 898 * @since 9 899 */ 900 export interface SatelliteStatusInfo { 901 /** 902 * Number of satellites. 903 * 904 * @type { number } 905 * @syscap SystemCapability.Location.Location.Gnss 906 * @since 9 907 */ 908 satellitesNumber: number; 909 910 /** 911 * Satellite ID array. 912 * 913 * @type { Array<number> } 914 * @syscap SystemCapability.Location.Location.Gnss 915 * @since 9 916 */ 917 satelliteIds: Array<number>; 918 919 /** 920 * Carrier to noise density array. 921 * 922 * @type { Array<number> } 923 * @syscap SystemCapability.Location.Location.Gnss 924 * @since 9 925 */ 926 carrierToNoiseDensitys: Array<number>; 927 928 /** 929 * Satellite altitude array. 930 * 931 * @type { Array<number> } 932 * @syscap SystemCapability.Location.Location.Gnss 933 * @since 9 934 */ 935 altitudes: Array<number>; 936 937 /** 938 * Satellite azimuth array. 939 * 940 * @type { Array<number> } 941 * @syscap SystemCapability.Location.Location.Gnss 942 * @since 9 943 */ 944 azimuths: Array<number>; 945 946 /** 947 * Satellite carrier frequency array. 948 * 949 * @type { Array<number> } 950 * @syscap SystemCapability.Location.Location.Gnss 951 * @since 9 952 */ 953 carrierFrequencies: Array<number>; 954 } 955 956 /** 957 * Parameters for requesting to report cache location information. 958 * 959 * @typedef CachedGnssLocationsRequest 960 * @syscap SystemCapability.Location.Location.Gnss 961 * @since 9 962 */ 963 export interface CachedGnssLocationsRequest { 964 /** 965 * GNSS cache location report period. 966 * 967 * @type { number } 968 * @syscap SystemCapability.Location.Location.Gnss 969 * @since 9 970 */ 971 reportingPeriodSec: number; 972 973 /** 974 * Indicates whether to wake up the listener when the GNSS cache location queue is full. 975 * 976 * @type { boolean } 977 * @syscap SystemCapability.Location.Location.Gnss 978 * @since 9 979 */ 980 wakeUpCacheQueueFull: boolean; 981 } 982 983 /** 984 * Configuring parameters in geo fence requests. 985 * 986 * @typedef GeofenceRequest 987 * @syscap SystemCapability.Location.Location.Geofence 988 * @since 9 989 */ 990 export interface GeofenceRequest { 991 /** 992 * Indicate the user scenario. 993 * 994 * @type { LocationRequestScenario } 995 * @syscap SystemCapability.Location.Location.Geofence 996 * @since 9 997 */ 998 scenario: LocationRequestScenario; 999 1000 /** 1001 * Circular fence information. 1002 * 1003 * @type { Geofence } 1004 * @syscap SystemCapability.Location.Location.Geofence 1005 * @since 9 1006 */ 1007 geofence: Geofence; 1008 } 1009 1010 /** 1011 * Circular fence information. 1012 * 1013 * @typedef Geofence 1014 * @syscap SystemCapability.Location.Location.Geofence 1015 * @since 9 1016 */ 1017 export interface Geofence { 1018 /** 1019 * Latitude of the center point of the circular fence. 1020 * 1021 * @type { number } 1022 * @syscap SystemCapability.Location.Location.Geofence 1023 * @since 9 1024 */ 1025 latitude: number; 1026 1027 /** 1028 * Longitude of the center point of the circular fence. 1029 * 1030 * @type { number } 1031 * @syscap SystemCapability.Location.Location.Geofence 1032 * @since 9 1033 */ 1034 longitude: number; 1035 1036 /** 1037 * Radius of the circular fence. 1038 * 1039 * @type { number } 1040 * @syscap SystemCapability.Location.Location.Geofence 1041 * @since 9 1042 */ 1043 radius: number; 1044 1045 /** 1046 * Expiration of the circular fence. 1047 * 1048 * @type { number } 1049 * @syscap SystemCapability.Location.Location.Geofence 1050 * @since 9 1051 */ 1052 expiration: number; 1053 } 1054 1055 /** 1056 * Configuring parameters in reverse geocode requests. 1057 * 1058 * @typedef ReverseGeoCodeRequest 1059 * @syscap SystemCapability.Location.Location.Geocoder 1060 * @since 9 1061 */ 1062 export interface ReverseGeoCodeRequest { 1063 /** 1064 * Indicates the language area information. 1065 * 1066 * @type { ?string } 1067 * @syscap SystemCapability.Location.Location.Geocoder 1068 * @since 9 1069 */ 1070 locale?: string; 1071 1072 /** 1073 * Latitude for reverse geocoding query. 1074 * 1075 * @type { number } 1076 * @syscap SystemCapability.Location.Location.Geocoder 1077 * @since 9 1078 */ 1079 latitude: number; 1080 1081 /** 1082 * Longitude for reverse geocoding query. 1083 * 1084 * @type { number } 1085 * @syscap SystemCapability.Location.Location.Geocoder 1086 * @since 9 1087 */ 1088 longitude: number; 1089 1090 /** 1091 * Indicates the maximum number of addresses returned by reverse geocoding query. 1092 * 1093 * @type { ?number } 1094 * @syscap SystemCapability.Location.Location.Geocoder 1095 * @since 9 1096 */ 1097 maxItems?: number; 1098 } 1099 1100 /** 1101 * Configuring parameters in geocode requests. 1102 * 1103 * @typedef GeoCodeRequest 1104 * @syscap SystemCapability.Location.Location.Geocoder 1105 * @since 9 1106 */ 1107 export interface GeoCodeRequest { 1108 /** 1109 * Indicates the language area information. 1110 * 1111 * @type { ?string } 1112 * @syscap SystemCapability.Location.Location.Geocoder 1113 * @since 9 1114 */ 1115 locale?: string; 1116 1117 /** 1118 * Address information. 1119 * 1120 * @type { string } 1121 * @syscap SystemCapability.Location.Location.Geocoder 1122 * @since 9 1123 */ 1124 description: string; 1125 1126 /** 1127 * Indicates the maximum number of geocode query results. 1128 * 1129 * @type { ?number } 1130 * @syscap SystemCapability.Location.Location.Geocoder 1131 * @since 9 1132 */ 1133 maxItems?: number; 1134 1135 /** 1136 * Indicates the minimum latitude for geocoding query results. 1137 * 1138 * @type { ?number } 1139 * @syscap SystemCapability.Location.Location.Geocoder 1140 * @since 9 1141 */ 1142 minLatitude?: number; 1143 1144 /** 1145 * Indicates the minimum longitude for geocoding query results. 1146 * 1147 * @type { ?number } 1148 * @syscap SystemCapability.Location.Location.Geocoder 1149 * @since 9 1150 */ 1151 minLongitude?: number; 1152 1153 /** 1154 * Indicates the maximum latitude for geocoding query results. 1155 * 1156 * @type { ?number } 1157 * @syscap SystemCapability.Location.Location.Geocoder 1158 * @since 9 1159 */ 1160 maxLatitude?: number; 1161 1162 /** 1163 * Indicates the maximum longitude for geocoding query results. 1164 * 1165 * @type { ?number } 1166 * @syscap SystemCapability.Location.Location.Geocoder 1167 * @since 9 1168 */ 1169 maxLongitude?: number; 1170 } 1171 1172 /** 1173 * Data struct describes geographic locations. 1174 * 1175 * @typedef GeoAddress 1176 * @syscap SystemCapability.Location.Location.Geocoder 1177 * @since 9 1178 */ 1179 export interface GeoAddress { 1180 /** 1181 * Indicates latitude information. 1182 * A positive value indicates north latitude, 1183 * and a negative value indicates south latitude. 1184 * 1185 * @type { ?number } 1186 * @syscap SystemCapability.Location.Location.Geocoder 1187 * @since 9 1188 */ 1189 latitude?: number; 1190 1191 /** 1192 * Indicates longitude information. 1193 * A positive value indicates east longitude , 1194 * and a negative value indicates west longitude. 1195 * 1196 * @type { ?number } 1197 * @syscap SystemCapability.Location.Location.Geocoder 1198 * @since 9 1199 */ 1200 longitude?: number; 1201 1202 /** 1203 * Indicates language used for the location description. 1204 * zh indicates Chinese, and en indicates English. 1205 * 1206 * @type { ?string } 1207 * @syscap SystemCapability.Location.Location.Geocoder 1208 * @since 9 1209 */ 1210 locale?: string; 1211 1212 /** 1213 * Indicates landmark of the location. 1214 * 1215 * @type { ?string } 1216 * @syscap SystemCapability.Location.Location.Geocoder 1217 * @since 9 1218 */ 1219 placeName?: string; 1220 1221 /** 1222 * Indicates country code. 1223 * 1224 * @type { ?string } 1225 * @syscap SystemCapability.Location.Location.Geocoder 1226 * @since 9 1227 */ 1228 countryCode?: string; 1229 1230 /** 1231 * Indicates country name. 1232 * 1233 * @type { ?string } 1234 * @syscap SystemCapability.Location.Location.Geocoder 1235 * @since 9 1236 */ 1237 countryName?: string; 1238 1239 /** 1240 * Indicates administrative region name. 1241 * 1242 * @type { ?string } 1243 * @syscap SystemCapability.Location.Location.Geocoder 1244 * @since 9 1245 */ 1246 administrativeArea?: string; 1247 1248 /** 1249 * Indicates sub-administrative region name. 1250 * 1251 * @type { ?string } 1252 * @syscap SystemCapability.Location.Location.Geocoder 1253 * @since 9 1254 */ 1255 subAdministrativeArea?: string; 1256 1257 /** 1258 * Indicates locality information. 1259 * 1260 * @type { ?string } 1261 * @syscap SystemCapability.Location.Location.Geocoder 1262 * @since 9 1263 */ 1264 locality?: string; 1265 1266 /** 1267 * Indicates sub-locality information. 1268 * 1269 * @type { ?string } 1270 * @syscap SystemCapability.Location.Location.Geocoder 1271 * @since 9 1272 */ 1273 subLocality?: string; 1274 1275 /** 1276 * Indicates road name. 1277 * 1278 * @type { ?string } 1279 * @syscap SystemCapability.Location.Location.Geocoder 1280 * @since 9 1281 */ 1282 roadName?: string; 1283 1284 /** 1285 * Indicates auxiliary road information. 1286 * 1287 * @type { ?string } 1288 * @syscap SystemCapability.Location.Location.Geocoder 1289 * @since 9 1290 */ 1291 subRoadName?: string; 1292 1293 /** 1294 * Indicates house information. 1295 * 1296 * @type { ?string } 1297 * @syscap SystemCapability.Location.Location.Geocoder 1298 * @since 9 1299 */ 1300 premises?: string; 1301 1302 /** 1303 * Indicates postal code. 1304 * 1305 * @type { ?string } 1306 * @syscap SystemCapability.Location.Location.Geocoder 1307 * @since 9 1308 */ 1309 postalCode?: string; 1310 1311 /** 1312 * Indicates phone number. 1313 * 1314 * @type { ?string } 1315 * @syscap SystemCapability.Location.Location.Geocoder 1316 * @since 9 1317 */ 1318 phoneNumber?: string; 1319 1320 /** 1321 * Indicates website URL. 1322 * 1323 * @type { ?string } 1324 * @syscap SystemCapability.Location.Location.Geocoder 1325 * @since 9 1326 */ 1327 addressUrl?: string; 1328 1329 /** 1330 * Indicates additional information. 1331 * 1332 * @type { ?Array<string> } 1333 * @syscap SystemCapability.Location.Location.Geocoder 1334 * @since 9 1335 */ 1336 descriptions?: Array<string>; 1337 1338 /** 1339 * Indicates the amount of additional descriptive information. 1340 * 1341 * @type { ?number } 1342 * @syscap SystemCapability.Location.Location.Geocoder 1343 * @since 9 1344 */ 1345 descriptionsSize?: number; 1346 1347 /** 1348 * Indicates whether it is an mock GeoAddress 1349 * 1350 * @type { ?Boolean } 1351 * @syscap SystemCapability.Location.Location.Geocoder 1352 * @systemapi 1353 * @since 9 1354 */ 1355 isFromMock?: Boolean; 1356 } 1357 1358 /** 1359 * Configuring parameters in location requests. 1360 * 1361 * @typedef LocationRequest 1362 * @syscap SystemCapability.Location.Location.Core 1363 * @since 9 1364 */ 1365 /** 1366 * Configuring parameters in location requests. 1367 * 1368 * @typedef LocationRequest 1369 * @syscap SystemCapability.Location.Location.Core 1370 * @atomicservice 1371 * @since 11 1372 */ 1373 export interface LocationRequest { 1374 /** 1375 * Priority of the location request. 1376 * 1377 * @type { ?LocationRequestPriority } 1378 * @syscap SystemCapability.Location.Location.Core 1379 * @since 9 1380 */ 1381 /** 1382 * Priority of the location request. 1383 * 1384 * @type { ?LocationRequestPriority } 1385 * @syscap SystemCapability.Location.Location.Core 1386 * @atomicservice 1387 * @since 11 1388 */ 1389 priority?: LocationRequestPriority; 1390 1391 /** 1392 * User scenario of the location request. 1393 * 1394 * @type { ?LocationRequestScenario } 1395 * @syscap SystemCapability.Location.Location.Core 1396 * @since 9 1397 */ 1398 /** 1399 * User scenario of the location request. 1400 * 1401 * @type { ?LocationRequestScenario } 1402 * @syscap SystemCapability.Location.Location.Core 1403 * @atomicservice 1404 * @since 11 1405 */ 1406 scenario?: LocationRequestScenario; 1407 1408 /** 1409 * Location report interval. 1410 * 1411 * @type { ?number } 1412 * @syscap SystemCapability.Location.Location.Core 1413 * @since 9 1414 */ 1415 /** 1416 * Location report interval. 1417 * 1418 * @type { ?number } 1419 * @syscap SystemCapability.Location.Location.Core 1420 * @atomicservice 1421 * @since 11 1422 */ 1423 timeInterval?: number; 1424 1425 /** 1426 * Location report distance interval. 1427 * 1428 * @type { ?number } 1429 * @syscap SystemCapability.Location.Location.Core 1430 * @since 9 1431 */ 1432 /** 1433 * Location report distance interval. 1434 * 1435 * @type { ?number } 1436 * @syscap SystemCapability.Location.Location.Core 1437 * @atomicservice 1438 * @since 11 1439 */ 1440 distanceInterval?: number; 1441 1442 /** 1443 * Accuracy requirements for reporting locations. 1444 * 1445 * @type { ?number } 1446 * @syscap SystemCapability.Location.Location.Core 1447 * @since 9 1448 */ 1449 /** 1450 * Accuracy requirements for reporting locations. 1451 * 1452 * @type { ?number } 1453 * @syscap SystemCapability.Location.Location.Core 1454 * @atomicservice 1455 * @since 11 1456 */ 1457 maxAccuracy?: number; 1458 } 1459 1460 /** 1461 * Configuring parameters in current location requests. 1462 * 1463 * @typedef CurrentLocationRequest 1464 * @syscap SystemCapability.Location.Location.Core 1465 * @since 9 1466 */ 1467 /** 1468 * Configuring parameters in current location requests. 1469 * 1470 * @typedef CurrentLocationRequest 1471 * @syscap SystemCapability.Location.Location.Core 1472 * @atomicservice 1473 * @since 11 1474 */ 1475 export interface CurrentLocationRequest { 1476 /** 1477 * Priority of the location request. 1478 * 1479 * @type { ?LocationRequestPriority } 1480 * @syscap SystemCapability.Location.Location.Core 1481 * @since 9 1482 */ 1483 /** 1484 * Priority of the location request. 1485 * 1486 * @type { ?LocationRequestPriority } 1487 * @syscap SystemCapability.Location.Location.Core 1488 * @atomicservice 1489 * @since 11 1490 */ 1491 priority?: LocationRequestPriority; 1492 1493 /** 1494 * User scenario of the location request. 1495 * 1496 * @type { ?LocationRequestScenario } 1497 * @syscap SystemCapability.Location.Location.Core 1498 * @since 9 1499 */ 1500 /** 1501 * User scenario of the location request. 1502 * 1503 * @type { ?LocationRequestScenario } 1504 * @syscap SystemCapability.Location.Location.Core 1505 * @atomicservice 1506 * @since 11 1507 */ 1508 scenario?: LocationRequestScenario; 1509 1510 /** 1511 * Accuracy requirements for reporting locations. 1512 * 1513 * @type { ?number } 1514 * @syscap SystemCapability.Location.Location.Core 1515 * @since 9 1516 */ 1517 /** 1518 * Accuracy requirements for reporting locations. 1519 * 1520 * @type { ?number } 1521 * @syscap SystemCapability.Location.Location.Core 1522 * @atomicservice 1523 * @since 11 1524 */ 1525 maxAccuracy?: number; 1526 1527 /** 1528 * Timeout interval of a single location request. 1529 * 1530 * @type { ?number } 1531 * @syscap SystemCapability.Location.Location.Core 1532 * @since 9 1533 */ 1534 /** 1535 * Timeout interval of a single location request. 1536 * 1537 * @type { ?number } 1538 * @syscap SystemCapability.Location.Location.Core 1539 * @atomicservice 1540 * @since 11 1541 */ 1542 timeoutMs?: number; 1543 } 1544 1545 /** 1546 * Provides information about geographic locations. 1547 * 1548 * @typedef Location 1549 * @syscap SystemCapability.Location.Location.Core 1550 * @since 9 1551 */ 1552 /** 1553 * Provides information about geographic locations. 1554 * 1555 * @typedef Location 1556 * @syscap SystemCapability.Location.Location.Core 1557 * @atomicservice 1558 * @since 11 1559 */ 1560 export interface Location { 1561 /** 1562 * Indicates latitude information. 1563 * A positive value indicates north latitude, 1564 * and a negative value indicates south latitude. 1565 * 1566 * @type { number } 1567 * @syscap SystemCapability.Location.Location.Core 1568 * @since 9 1569 */ 1570 /** 1571 * Indicates latitude information. 1572 * A positive value indicates north latitude, 1573 * and a negative value indicates south latitude. 1574 * 1575 * @type { number } 1576 * @syscap SystemCapability.Location.Location.Core 1577 * @atomicservice 1578 * @since 11 1579 */ 1580 latitude: number; 1581 1582 /** 1583 * Indicates Longitude information. 1584 * A positive value indicates east longitude , 1585 * and a negative value indicates west longitude. 1586 * 1587 * @type { number } 1588 * @syscap SystemCapability.Location.Location.Core 1589 * @since 9 1590 */ 1591 /** 1592 * Indicates Longitude information. 1593 * A positive value indicates east longitude , 1594 * and a negative value indicates west longitude. 1595 * 1596 * @type { number } 1597 * @syscap SystemCapability.Location.Location.Core 1598 * @atomicservice 1599 * @since 11 1600 */ 1601 longitude: number; 1602 1603 /** 1604 * Indicates location altitude, in meters. 1605 * 1606 * @type { number } 1607 * @syscap SystemCapability.Location.Location.Core 1608 * @since 9 1609 */ 1610 /** 1611 * Indicates location altitude, in meters. 1612 * 1613 * @type { number } 1614 * @syscap SystemCapability.Location.Location.Core 1615 * @atomicservice 1616 * @since 11 1617 */ 1618 altitude: number; 1619 1620 /** 1621 * Indicates location accuracy, in meters. 1622 * 1623 * @type { number } 1624 * @syscap SystemCapability.Location.Location.Core 1625 * @since 9 1626 */ 1627 /** 1628 * Indicates location accuracy, in meters. 1629 * 1630 * @type { number } 1631 * @syscap SystemCapability.Location.Location.Core 1632 * @atomicservice 1633 * @since 11 1634 */ 1635 accuracy: number; 1636 1637 /** 1638 * Indicates speed, in m/s. 1639 * 1640 * @type { number } 1641 * @syscap SystemCapability.Location.Location.Core 1642 * @since 9 1643 */ 1644 /** 1645 * Indicates speed, in m/s. 1646 * 1647 * @type { number } 1648 * @syscap SystemCapability.Location.Location.Core 1649 * @atomicservice 1650 * @since 11 1651 */ 1652 speed: number; 1653 1654 /** 1655 * Indicates location timestamp in the UTC format. 1656 * 1657 * @type { number } 1658 * @syscap SystemCapability.Location.Location.Core 1659 * @since 9 1660 */ 1661 /** 1662 * Indicates location timestamp in the UTC format. 1663 * 1664 * @type { number } 1665 * @syscap SystemCapability.Location.Location.Core 1666 * @atomicservice 1667 * @since 11 1668 */ 1669 timeStamp: number; 1670 1671 /** 1672 * Indicates direction information. 1673 * 1674 * @type { number } 1675 * @syscap SystemCapability.Location.Location.Core 1676 * @since 9 1677 */ 1678 /** 1679 * Indicates direction information. 1680 * 1681 * @type { number } 1682 * @syscap SystemCapability.Location.Location.Core 1683 * @atomicservice 1684 * @since 11 1685 */ 1686 direction: number; 1687 1688 /** 1689 * Indicates location timestamp since boot. 1690 * 1691 * @type { number } 1692 * @syscap SystemCapability.Location.Location.Core 1693 * @since 9 1694 */ 1695 /** 1696 * Indicates location timestamp since boot. 1697 * 1698 * @type { number } 1699 * @syscap SystemCapability.Location.Location.Core 1700 * @atomicservice 1701 * @since 11 1702 */ 1703 timeSinceBoot: number; 1704 1705 /** 1706 * Indicates additional information. 1707 * 1708 * @type { ?Array<string> } 1709 * @syscap SystemCapability.Location.Location.Core 1710 * @since 9 1711 */ 1712 /** 1713 * Indicates additional information. 1714 * 1715 * @type { ?Array<string> } 1716 * @syscap SystemCapability.Location.Location.Core 1717 * @atomicservice 1718 * @since 11 1719 */ 1720 additions?: Array<string>; 1721 1722 /** 1723 * Indicates the amount of additional descriptive information. 1724 * 1725 * @type { ?number } 1726 * @syscap SystemCapability.Location.Location.Core 1727 * @since 9 1728 */ 1729 /** 1730 * Indicates the amount of additional descriptive information. 1731 * 1732 * @type { ?number } 1733 * @syscap SystemCapability.Location.Location.Core 1734 * @atomicservice 1735 * @since 11 1736 */ 1737 additionSize?: number; 1738 1739 /** 1740 * Indicates whether it is an mock location. 1741 * 1742 * @type { ?Boolean } 1743 * @syscap SystemCapability.Location.Location.Core 1744 * @systemapi 1745 * @since 9 1746 */ 1747 /** 1748 * Indicates whether it is an mock location. 1749 * 1750 * @type { ?Boolean } 1751 * @syscap SystemCapability.Location.Location.Core 1752 * @systemapi 1753 * @atomicservice 1754 * @since 11 1755 */ 1756 isFromMock?: Boolean; 1757 } 1758 1759 /** 1760 * Describes the request parameters for obtaining the data required for locating. 1761 * @typedef LocatingRequiredDataConfig 1762 * @syscap SystemCapability.Location.Location.Core 1763 * @systemapi 1764 * @since 10 1765 */ 1766 export interface LocatingRequiredDataConfig { 1767 /** 1768 * Indicates the type of locating required data. 1769 * 1770 * @type {LocatingRequiredDataType} 1771 * @syscap SystemCapability.Location.Location.Core 1772 * @systemapi 1773 * @since 10 1774 */ 1775 type: LocatingRequiredDataType; 1776 1777 /** 1778 * Indicates whether to start scanning. 1779 * 1780 * @type {boolean} 1781 * @syscap SystemCapability.Location.Location.Core 1782 * @systemapi 1783 * @since 10 1784 */ 1785 needStartScan: boolean; 1786 1787 /** 1788 * Indicates the interval between scans. The unit is millisecond. 1789 * This parameter needs to be set only when scanning information is continuously monitored. 1790 * 1791 * @type {?number} 1792 * @syscap SystemCapability.Location.Location.Core 1793 * @systemapi 1794 * @since 10 1795 */ 1796 scanInterval?: number; 1797 1798 /** 1799 * Indicates the timeout period of a single scan. The unit is millisecond. The default value is 10000. 1800 * This parameter needs to be set only when getLocatingRequiredData is used. 1801 * 1802 * @type {?number} 1803 * @syscap SystemCapability.Location.Location.Core 1804 * @systemapi 1805 * @since 10 1806 */ 1807 scanTimeout?: number; 1808 } 1809 1810 /** 1811 * Describes the structure of the data required for locating. 1812 * @typedef LocatingRequiredData 1813 * @syscap SystemCapability.Location.Location.Core 1814 * @systemapi 1815 * @since 10 1816 */ 1817 export interface LocatingRequiredData { 1818 /** 1819 * WiFi scan info. 1820 * 1821 * @type {?WifiScanInfo} 1822 * @syscap SystemCapability.Location.Location.Core 1823 * @systemapi 1824 * @since 10 1825 */ 1826 wifiData?: WifiScanInfo; 1827 1828 /** 1829 * Bluetooth scan info. 1830 * 1831 * @type {?BluetoothScanInfo} 1832 * @syscap SystemCapability.Location.Location.Core 1833 * @systemapi 1834 * @since 10 1835 */ 1836 bluetoothData?: BluetoothScanInfo; 1837 } 1838 1839 /** 1840 * Describes the scanned WiFi information. 1841 * @typedef WifiScanInfo 1842 * @syscap SystemCapability.Location.Location.Core 1843 * @systemapi 1844 * @since 10 1845 */ 1846 export interface WifiScanInfo { 1847 /** 1848 * WiFi SSID: the maximum length is 32. 1849 * 1850 * @type {string} 1851 * @syscap SystemCapability.Location.Location.Core 1852 * @systemapi 1853 * @since 10 1854 */ 1855 ssid: string; 1856 1857 /** 1858 * WiFi bssid(MAC): the length is 6. 1859 * 1860 * @type {string} 1861 * @syscap SystemCapability.Location.Location.Core 1862 * @systemapi 1863 * @since 10 1864 */ 1865 bssid: string; 1866 1867 /** 1868 * Received signal strength indicator (RSSI). 1869 * 1870 * @type {number} 1871 * @syscap SystemCapability.Location.Location.Core 1872 * @systemapi 1873 * @since 10 1874 */ 1875 rssi: number; 1876 1877 /** 1878 * Frequency 1879 * 1880 * @type {number} 1881 * @syscap SystemCapability.Location.Location.Core 1882 * @systemapi 1883 * @since 10 1884 */ 1885 frequency: number; 1886 1887 /** 1888 * Time stamp. 1889 * 1890 * @type {number} 1891 * @syscap SystemCapability.Location.Location.Core 1892 * @systemapi 1893 * @since 10 1894 */ 1895 timestamp: number; 1896 } 1897 1898 /** 1899 * Describes the contents of the Bluetooth scan results. 1900 * 1901 * @typedef BluetoothScanInfo 1902 * @syscap SystemCapability.Location.Location.Core 1903 * @systemapi 1904 * @since 10 1905 */ 1906 export interface BluetoothScanInfo { 1907 /** 1908 * The local name of the device. 1909 * 1910 * @type {string} 1911 * @syscap SystemCapability.Location.Location.Core 1912 * @systemapi 1913 * @since 10 1914 */ 1915 deviceName: string; 1916 1917 /** 1918 * Mac address of the scanned device. 1919 * 1920 * @type {string} 1921 * @syscap SystemCapability.Location.Location.Core 1922 * @systemapi 1923 * @since 10 1924 */ 1925 macAddress: string; 1926 1927 /** 1928 * RSSI of the remote device. 1929 * 1930 * @type {number} 1931 * @syscap SystemCapability.Location.Location.Core 1932 * @systemapi 1933 * @since 10 1934 */ 1935 rssi: number; 1936 1937 /** 1938 * Time stamp. 1939 * 1940 * @type {number} 1941 * @syscap SystemCapability.Location.Location.Core 1942 * @systemapi 1943 * @since 10 1944 */ 1945 timestamp: number; 1946 } 1947 1948 /** 1949 * Enum for location priority. 1950 * 1951 * @enum { number } 1952 * @syscap SystemCapability.Location.Location.Core 1953 * @since 9 1954 */ 1955 /** 1956 * Enum for location priority. 1957 * 1958 * @enum { number } 1959 * @syscap SystemCapability.Location.Location.Core 1960 * @atomicservice 1961 * @since 11 1962 */ 1963 export enum LocationRequestPriority { 1964 /** 1965 * Default priority. 1966 * 1967 * @syscap SystemCapability.Location.Location.Core 1968 * @since 9 1969 */ 1970 /** 1971 * Default priority. 1972 * 1973 * @syscap SystemCapability.Location.Location.Core 1974 * @atomicservice 1975 * @since 11 1976 */ 1977 UNSET = 0x200, 1978 1979 /** 1980 * Preferentially ensure the locating accuracy. 1981 * 1982 * @syscap SystemCapability.Location.Location.Core 1983 * @since 9 1984 */ 1985 /** 1986 * Preferentially ensure the locating accuracy. 1987 * 1988 * @syscap SystemCapability.Location.Location.Core 1989 * @atomicservice 1990 * @since 11 1991 */ 1992 ACCURACY, 1993 1994 /** 1995 * Preferentially ensure low power consumption for locating. 1996 * 1997 * @syscap SystemCapability.Location.Location.Core 1998 * @since 9 1999 */ 2000 /** 2001 * Preferentially ensure low power consumption for locating. 2002 * 2003 * @syscap SystemCapability.Location.Location.Core 2004 * @atomicservice 2005 * @since 11 2006 */ 2007 LOW_POWER, 2008 2009 /** 2010 * Preferentially ensure that the first location is time-consuming. 2011 * 2012 * @syscap SystemCapability.Location.Location.Core 2013 * @since 9 2014 */ 2015 /** 2016 * Preferentially ensure that the first location is time-consuming. 2017 * 2018 * @syscap SystemCapability.Location.Location.Core 2019 * @atomicservice 2020 * @since 11 2021 */ 2022 FIRST_FIX 2023 } 2024 2025 /** 2026 * Enum for location scenario. 2027 * 2028 * @enum { number } 2029 * @syscap SystemCapability.Location.Location.Core 2030 * @since 9 2031 */ 2032 /** 2033 * Enum for location scenario. 2034 * 2035 * @enum { number } 2036 * @syscap SystemCapability.Location.Location.Core 2037 * @atomicservice 2038 * @since 11 2039 */ 2040 export enum LocationRequestScenario { 2041 /** 2042 * Default scenario. 2043 * 2044 * @syscap SystemCapability.Location.Location.Core 2045 * @since 9 2046 */ 2047 /** 2048 * Default scenario. 2049 * 2050 * @syscap SystemCapability.Location.Location.Core 2051 * @atomicservice 2052 * @since 11 2053 */ 2054 UNSET = 0x300, 2055 2056 /** 2057 * Navigation scenario. High positioning precision and real-time performance are required. 2058 * 2059 * @syscap SystemCapability.Location.Location.Core 2060 * @since 9 2061 */ 2062 /** 2063 * Navigation scenario. High positioning precision and real-time performance are required. 2064 * 2065 * @syscap SystemCapability.Location.Location.Core 2066 * @atomicservice 2067 * @since 11 2068 */ 2069 NAVIGATION, 2070 2071 /** 2072 * Trajectory tracking scenario. High positioning precision is required. 2073 * 2074 * @syscap SystemCapability.Location.Location.Core 2075 * @since 9 2076 */ 2077 /** 2078 * Trajectory tracking scenario. High positioning precision is required. 2079 * 2080 * @syscap SystemCapability.Location.Location.Core 2081 * @atomicservice 2082 * @since 11 2083 */ 2084 TRAJECTORY_TRACKING, 2085 2086 /** 2087 * Car hailing scenario. High positioning precision and real-time performance are required. 2088 * 2089 * @syscap SystemCapability.Location.Location.Core 2090 * @since 9 2091 */ 2092 /** 2093 * Car hailing scenario. High positioning precision and real-time performance are required. 2094 * 2095 * @syscap SystemCapability.Location.Location.Core 2096 * @atomicservice 2097 * @since 11 2098 */ 2099 CAR_HAILING, 2100 2101 /** 2102 * Daily life scenarios. Low requirements on positioning precision and real-time performance. 2103 * 2104 * @syscap SystemCapability.Location.Location.Core 2105 * @since 9 2106 */ 2107 /** 2108 * Daily life scenarios. Low requirements on positioning precision and real-time performance. 2109 * 2110 * @syscap SystemCapability.Location.Location.Core 2111 * @atomicservice 2112 * @since 11 2113 */ 2114 DAILY_LIFE_SERVICE, 2115 2116 /** 2117 * Power saving scenarios. 2118 * 2119 * @syscap SystemCapability.Location.Location.Core 2120 * @since 9 2121 */ 2122 /** 2123 * Power saving scenarios. 2124 * 2125 * @syscap SystemCapability.Location.Location.Core 2126 * @atomicservice 2127 * @since 11 2128 */ 2129 NO_POWER 2130 } 2131 2132 /** 2133 * Enum for location privacy type. 2134 * 2135 * @enum { number } 2136 * @syscap SystemCapability.Location.Location.Core 2137 * @systemapi 2138 * @since 9 2139 */ 2140 export enum LocationPrivacyType { 2141 /** 2142 * Other scenarios. 2143 * 2144 * @syscap SystemCapability.Location.Location.Core 2145 * @systemapi 2146 * @since 9 2147 */ 2148 OTHERS = 0, 2149 2150 /** 2151 * Privacy agreement for the startup wizard scenario. 2152 * 2153 * @syscap SystemCapability.Location.Location.Core 2154 * @systemapi 2155 * @since 9 2156 */ 2157 STARTUP, 2158 2159 /** 2160 * Privacy agreement pop-up when network location is enabled. 2161 * 2162 * @syscap SystemCapability.Location.Location.Core 2163 * @systemapi 2164 * @since 9 2165 */ 2166 CORE_LOCATION 2167 } 2168 2169 /** 2170 * Location subsystem command structure. 2171 * 2172 * @typedef LocationCommand 2173 * @syscap SystemCapability.Location.Location.Core 2174 * @since 9 2175 */ 2176 export interface LocationCommand { 2177 /** 2178 * Information about the scenario where the command is sent. 2179 * 2180 * @type { LocationRequestScenario } 2181 * @syscap SystemCapability.Location.Location.Core 2182 * @since 9 2183 */ 2184 scenario: LocationRequestScenario; 2185 2186 /** 2187 * Sent command content. 2188 * 2189 * @type { string } 2190 * @syscap SystemCapability.Location.Location.Core 2191 * @since 9 2192 */ 2193 command: string; 2194 } 2195 2196 /** 2197 * Country code structure. 2198 * 2199 * @typedef CountryCode 2200 * @syscap SystemCapability.Location.Location.Core 2201 * @since 9 2202 */ 2203 export interface CountryCode { 2204 /** 2205 * Country code character string. 2206 * 2207 * @type { string } 2208 * @syscap SystemCapability.Location.Location.Core 2209 * @since 9 2210 */ 2211 country: string; 2212 2213 /** 2214 * Country code source. 2215 * 2216 * @type { CountryCodeType } 2217 * @syscap SystemCapability.Location.Location.Core 2218 * @since 9 2219 */ 2220 type: CountryCodeType; 2221 } 2222 2223 /** 2224 * Enum for country code type. 2225 * 2226 * @enum { number } 2227 * @syscap SystemCapability.Location.Location.Core 2228 * @since 9 2229 */ 2230 export enum CountryCodeType { 2231 /** 2232 * Country code obtained from the locale setting. 2233 * 2234 * @syscap SystemCapability.Location.Location.Core 2235 * @since 9 2236 */ 2237 COUNTRY_CODE_FROM_LOCALE = 1, 2238 2239 /** 2240 * Country code obtained from the SIM information. 2241 * 2242 * @syscap SystemCapability.Location.Location.Core 2243 * @since 9 2244 */ 2245 COUNTRY_CODE_FROM_SIM, 2246 2247 /** 2248 * Query the country code information from the reverse geocoding result. 2249 * 2250 * @syscap SystemCapability.Location.Location.Core 2251 * @since 9 2252 */ 2253 COUNTRY_CODE_FROM_LOCATION, 2254 2255 /** 2256 * Obtain the country code from the cell registration information. 2257 * 2258 * @syscap SystemCapability.Location.Location.Core 2259 * @since 9 2260 */ 2261 COUNTRY_CODE_FROM_NETWORK 2262 } 2263 2264 /** 2265 * Enum for locating required data type. 2266 * 2267 * @enum { number } 2268 * @syscap SystemCapability.Location.Location.Core 2269 * @systemapi 2270 * @since 10 2271 */ 2272 export enum LocatingRequiredDataType { 2273 /** 2274 * Obtains WiFi scanning information for locating. 2275 * 2276 * @syscap SystemCapability.Location.Location.Core 2277 * @systemapi 2278 * @since 10 2279 */ 2280 WIFI = 1, 2281 2282 /** 2283 * Obtains BT scanning information for locating. 2284 * 2285 * @syscap SystemCapability.Location.Location.Core 2286 * @systemapi 2287 * @since 10 2288 */ 2289 BLUETOOTH 2290 } 2291} 2292 2293export default geoLocationManager;