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 */ 15import { AsyncCallback, Callback } from './basic'; 16import { WantAgent } from './@ohos.wantAgent'; 17 18/** 19 * Provides interfaces for acquiring location information, managing location switches, 20 * geocoding, reverse geocoding, country code, geofencing and other functions. 21 * @namespace geoLocationManager 22 * @since 9 23 */ 24declare namespace geoLocationManager { 25 /** 26 * Subscribe location changed. 27 * @permission ohos.permission.APPROXIMATELY_LOCATION 28 * @param { LocationRequest } request - Indicates the location request parameters. 29 * @param { Callback<Location> } callback - Indicates the callback for reporting the location result. 30 * @returns { void }. 31 * @throws { BusinessError } 201 - Permission denied. 32 * @throws { BusinessError } 401 - Parameter error. 33 * @throws { BusinessError } 801 - Capability not supported. 34 * @throws { BusinessError } 3301000 - Location service is unavailable. 35 * @throws { BusinessError } 3301100 - The location switch is off. 36 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 37 * @syscap SystemCapability.Location.Location.Core 38 * @since 9 39 */ 40 function on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>): void; 41 42 /** 43 * Unsubscribe location changed. 44 * @permission ohos.permission.APPROXIMATELY_LOCATION 45 * @param { Callback<Location> } [callback] - Indicates the callback for reporting the location result. 46 * @returns { void }. 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 function off(type: 'locationChange', callback?: Callback<Location>): void; 57 58 /** 59 * Subscribe location switch changed. 60 * @param { Callback<boolean> } callback - Indicates the callback for reporting the location switch status. 61 * @returns { void }. 62 * @throws { BusinessError } 401 - Parameter error. 63 * @throws { BusinessError } 801 - Capability not supported. 64 * @throws { BusinessError } 3301000 - Location service is unavailable. 65 * @syscap SystemCapability.Location.Location.Core 66 * @since 9 67 */ 68 function on(type: 'locationEnabledChange', callback: Callback<boolean>): void; 69 70 /** 71 * Unsubscribe location switch changed. 72 * @param { Callback<boolean> } [callback] - Indicates the callback for reporting the location switch status. 73 * @returns { void }. 74 * @throws { BusinessError } 401 - Parameter error. 75 * @throws { BusinessError } 801 - Capability not supported. 76 * @throws { BusinessError } 3301000 - Location service is unavailable. 77 * @syscap SystemCapability.Location.Location.Core 78 * @since 9 79 */ 80 function off(type: 'locationEnabledChange', callback?: Callback<boolean>): void; 81 82 /** 83 * Subscribe to cache GNSS locations update messages. 84 * @permission ohos.permission.APPROXIMATELY_LOCATION 85 * @param { CachedGnssLocationsRequest } request - Indicates the cached GNSS locations request parameters. 86 * @param { Callback<Array<Location>> } callback - Indicates the callback for reporting the cached GNSS locations. 87 * @returns { void }. 88 * @throws { BusinessError } 201 - Permission denied. 89 * @throws { BusinessError } 401 - Parameter error. 90 * @throws { BusinessError } 801 - Capability not supported. 91 * @throws { BusinessError } 3301000 - Location service is unavailable. 92 * @throws { BusinessError } 3301100 - The location switch is off. 93 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 94 * @syscap SystemCapability.Location.Location.Gnss 95 * @since 9 96 */ 97 function on(type: 'cachedGnssLocationsChange', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>): void; 98 99 /** 100 * Unsubscribe to cache GNSS locations update messages. 101 * @permission ohos.permission.APPROXIMATELY_LOCATION 102 * @param { Callback<Array<Location>> } [callback] - Indicates the callback for reporting the cached gnss locations. 103 * @returns { void }. 104 * @throws { BusinessError } 201 - Permission denied. 105 * @throws { BusinessError } 401 - Parameter error. 106 * @throws { BusinessError } 801 - Capability not supported. 107 * @throws { BusinessError } 3301000 - Location service is unavailable. 108 * @throws { BusinessError } 3301100 - The location switch is off. 109 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 110 * @syscap SystemCapability.Location.Location.Gnss 111 * @since 9 112 */ 113 function off(type: 'cachedGnssLocationsChange', callback?: Callback<Array<Location>>): void; 114 115 /** 116 * Subscribe satellite status changed. 117 * @permission ohos.permission.APPROXIMATELY_LOCATION 118 * @param { Callback<SatelliteStatusInfo> } callback - Indicates the callback for reporting the satellite status. 119 * @returns { void }. 120 * @throws { BusinessError } 201 - Permission denied. 121 * @throws { BusinessError } 401 - Parameter error. 122 * @throws { BusinessError } 801 - Capability not supported. 123 * @throws { BusinessError } 3301000 - Location service is unavailable. 124 * @throws { BusinessError } 3301100 - The location switch is off. 125 * @syscap SystemCapability.Location.Location.Gnss 126 * @since 9 127 */ 128 function on(type: 'satelliteStatusChange', callback: Callback<SatelliteStatusInfo>): void; 129 130 /** 131 * Unsubscribe satellite status changed. 132 * @permission ohos.permission.APPROXIMATELY_LOCATION 133 * @param { Callback<SatelliteStatusInfo> } [callback] - Indicates the callback for reporting the satellite status. 134 * @returns { void }. 135 * @throws { BusinessError } 201 - Permission denied. 136 * @throws { BusinessError } 401 - Parameter error. 137 * @throws { BusinessError } 801 - Capability not supported. 138 * @throws { BusinessError } 3301000 - Location service is unavailable. 139 * @throws { BusinessError } 3301100 - The location switch is off. 140 * @syscap SystemCapability.Location.Location.Gnss 141 * @since 9 142 */ 143 function off(type: 'satelliteStatusChange', callback?: Callback<SatelliteStatusInfo>): void; 144 145 /** 146 * Subscribe nmea message changed. 147 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 148 * @param { Callback<string> } callback - Indicates the callback for reporting the nmea message. 149 * @returns { void }. 150 * @throws { BusinessError } 201 - Permission denied. 151 * @throws { BusinessError } 401 - Parameter error. 152 * @throws { BusinessError } 801 - Capability not supported. 153 * @throws { BusinessError } 3301000 - Location service is unavailable. 154 * @throws { BusinessError } 3301100 - The location switch is off. 155 * @syscap SystemCapability.Location.Location.Gnss 156 * @since 9 157 */ 158 function on(type: 'nmeaMessage', callback: Callback<string>): void; 159 160 /** 161 * Unsubscribe nmea message changed. 162 * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 163 * @param { Callback<string> } [callback] - Indicates the callback for reporting the nmea message. 164 * @returns { void }. 165 * @throws { BusinessError } 201 - Permission denied. 166 * @throws { BusinessError } 401 - Parameter error. 167 * @throws { BusinessError } 801 - Capability not supported. 168 * @throws { BusinessError } 3301000 - Location service is unavailable. 169 * @throws { BusinessError } 3301100 - The location switch is off. 170 * @syscap SystemCapability.Location.Location.Gnss 171 * @since 9 172 */ 173 function off(type: 'nmeaMessage', callback?: Callback<string>): void; 174 175 /** 176 * Add a geofence and subscribe geo fence status changed. 177 * @permission ohos.permission.APPROXIMATELY_LOCATION 178 * @param { GeofenceRequest } request - Indicates the Geo-fence configuration parameters. 179 * @param { WantAgent } want - Indicates which ability to start when the geofence event is triggered. 180 * @returns { void }. 181 * @throws { BusinessError } 201 - Permission denied. 182 * @throws { BusinessError } 401 - Parameter error. 183 * @throws { BusinessError } 801 - Capability not supported. 184 * @throws { BusinessError } 3301000 - Location service is unavailable. 185 * @throws { BusinessError } 3301100 - The location switch is off. 186 * @throws { BusinessError } 3301600 - Failed to operate the geofence. 187 * @syscap SystemCapability.Location.Location.Geofence 188 * @since 9 189 */ 190 function on(type: 'gnssFenceStatusChange', request: GeofenceRequest, want: WantAgent): void; 191 192 /** 193 * Remove a geofence and unsubscribe geo fence status changed. 194 * @permission ohos.permission.APPROXIMATELY_LOCATION 195 * @param { GeofenceRequest } request - Indicates the Geo-fence configuration parameters. 196 * @param { WantAgent } want - Indicates which ability to start when the geofence event is triggered. 197 * @returns { void }. 198 * @throws { BusinessError } 201 - Permission denied. 199 * @throws { BusinessError } 401 - Parameter error. 200 * @throws { BusinessError } 801 - Capability not supported. 201 * @throws { BusinessError } 3301000 - Location service is unavailable. 202 * @throws { BusinessError } 3301100 - The location switch is off. 203 * @throws { BusinessError } 3301600 - Failed to operate the geofence. 204 * @syscap SystemCapability.Location.Location.Geofence 205 * @since 9 206 */ 207 function off(type: 'gnssFenceStatusChange', request: GeofenceRequest, want: WantAgent): void; 208 209 /** 210 * Registering the callback function for listening to country code changes. 211 * @param { Callback<CountryCode> } callback - Indicates the callback for reporting country code changes. 212 * @returns { void }. 213 * @throws { BusinessError } 401 - Parameter error. 214 * @throws { BusinessError } 801 - Capability not supported. 215 * @throws { BusinessError } 3301000 - Location service is unavailable. 216 * @throws { BusinessError } 3301500 - Failed to query the area information. 217 * @syscap SystemCapability.Location.Location.Core 218 * @since 9 219 */ 220 function on(type: 'countryCodeChange', callback: Callback<CountryCode>): void; 221 222 /** 223 * Unregistering the callback function for listening to country code changes. 224 * @param { Callback<CountryCode> } [callback] - Indicates the callback for reporting country code changes. 225 * @returns { void }. 226 * @throws { BusinessError } 401 - Parameter error. 227 * @throws { BusinessError } 801 - Capability not supported. 228 * @throws { BusinessError } 3301000 - Location service is unavailable. 229 * @throws { BusinessError } 3301500 - Failed to query the area information. 230 * @syscap SystemCapability.Location.Location.Core 231 * @since 9 232 */ 233 function off(type: 'countryCodeChange', callback?: Callback<CountryCode>): void; 234 235 /** 236 * Obtain current location. 237 * @permission ohos.permission.APPROXIMATELY_LOCATION 238 * @param { CurrentLocationRequest } request - Indicates the location request parameters. 239 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 240 * @returns { void }. 241 * @throws { BusinessError } 201 - Permission denied. 242 * @throws { BusinessError } 401 - Parameter error. 243 * @throws { BusinessError } 801 - Capability not supported. 244 * @throws { BusinessError } 3301000 - Location service is unavailable. 245 * @throws { BusinessError } 3301100 - The location switch is off. 246 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 247 * @syscap SystemCapability.Location.Location.Core 248 * @since 9 249 */ 250 function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>): void; 251 252 /** 253 * Obtain current location. 254 * @permission ohos.permission.APPROXIMATELY_LOCATION 255 * @param { AsyncCallback<Location> } callback - Indicates the callback for reporting the location result. 256 * @returns { void }. 257 * @throws { BusinessError } 201 - Permission denied. 258 * @throws { BusinessError } 401 - Parameter error. 259 * @throws { BusinessError } 801 - Capability not supported. 260 * @throws { BusinessError } 3301000 - Location service is unavailable. 261 * @throws { BusinessError } 3301100 - The location switch is off. 262 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 263 * @syscap SystemCapability.Location.Location.Core 264 * @since 9 265 */ 266 function getCurrentLocation(callback: AsyncCallback<Location>): void; 267 268 /** 269 * Obtain current location. 270 * @permission ohos.permission.APPROXIMATELY_LOCATION 271 * @param { CurrentLocationRequest } [request] - Indicates the location request parameters. 272 * @returns { Promise<Location> } The promise returned by the function. 273 * @throws { BusinessError } 201 - Permission denied. 274 * @throws { BusinessError } 401 - Parameter error. 275 * @throws { BusinessError } 801 - Capability not supported. 276 * @throws { BusinessError } 3301000 - Location service is unavailable. 277 * @throws { BusinessError } 3301100 - The location switch is off. 278 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 279 * @syscap SystemCapability.Location.Location.Core 280 * @since 9 281 */ 282 function getCurrentLocation(request?: CurrentLocationRequest): Promise<Location>; 283 284 /** 285 * Obtain last known location. 286 * @permission ohos.permission.APPROXIMATELY_LOCATION 287 * @returns { Location } The last known location information. 288 * @throws { BusinessError } 201 - Permission denied. 289 * @throws { BusinessError } 801 - Capability not supported. 290 * @throws { BusinessError } 3301000 - Location service is unavailable. 291 * @throws { BusinessError } 3301100 - The location switch is off. 292 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 293 * @syscap SystemCapability.Location.Location.Core 294 * @since 9 295 */ 296 function getLastLocation(): Location; 297 298 /** 299 * Obtain current location switch status. 300 * @returns { boolean } Returns {@code true} if the location switch on, returns {@code false} otherwise. 301 * @throws { BusinessError } 801 - Capability not supported. 302 * @throws { BusinessError } 3301000 - Location service is unavailable. 303 * @syscap SystemCapability.Location.Location.Core 304 * @since 9 305 */ 306 function isLocationEnabled(): boolean; 307 308 /** 309 * Enable location switch. 310 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 311 * @param { AsyncCallback<void> } callback - Indicates the callback for reporting the error message. 312 * @returns { void }. 313 * @throws { BusinessError } 201 - Permission denied. 314 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 315 * @throws { BusinessError } 401 - Parameter error. 316 * @throws { BusinessError } 801 - Capability not supported. 317 * @throws { BusinessError } 3301000 - Location service is unavailable. 318 * @syscap SystemCapability.Location.Location.Core 319 * @systemapi 320 * @since 9 321 */ 322 function enableLocation(callback: AsyncCallback<void>): void; 323 324 /** 325 * Enable location switch. 326 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 327 * @returns { Promise<void> } The promise returned by the function. 328 * @throws { BusinessError } 201 - Permission denied. 329 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 330 * @throws { BusinessError } 801 - Capability not supported. 331 * @throws { BusinessError } 3301000 - Location service is unavailable. 332 * @syscap SystemCapability.Location.Location.Core 333 * @systemapi 334 * @since 9 335 */ 336 function enableLocation(): Promise<void>; 337 338 /** 339 * Disable location switch. 340 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 341 * @returns { void }. 342 * @throws { BusinessError } 201 - Permission denied. 343 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 344 * @throws { BusinessError } 801 - Capability not supported. 345 * @throws { BusinessError } 3301000 - Location service is unavailable. 346 * @syscap SystemCapability.Location.Location.Core 347 * @systemapi 348 * @since 9 349 */ 350 function disableLocation(): void; 351 352 /** 353 * Obtain address info from location. 354 * @param { ReverseGeoCodeRequest } request - Indicates the reverse geocode query parameters. 355 * @param { AsyncCallback<Array<GeoAddress>> } callback - Indicates the callback for reporting the address info. 356 * @returns { void }. 357 * @throws { BusinessError } 401 - Parameter error. 358 * @throws { BusinessError } 801 - Capability not supported. 359 * @throws { BusinessError } 3301000 - Location service is unavailable. 360 * @throws { BusinessError } 3301300 - Reverse geocoding query failed. 361 * @syscap SystemCapability.Location.Location.Geocoder 362 * @since 9 363 */ 364 function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; 365 366 /** 367 * Obtain address info from location. 368 * @param { ReverseGeoCodeRequest } request - Indicates the reverse geocode query parameters. 369 * @returns { Promise<Array<GeoAddress>> } The promise returned by the function. 370 * @throws { BusinessError } 401 - Parameter error. 371 * @throws { BusinessError } 801 - Capability not supported. 372 * @throws { BusinessError } 3301000 - Location service is unavailable. 373 * @throws { BusinessError } 3301300 - Reverse geocoding query failed. 374 * @syscap SystemCapability.Location.Location.Geocoder 375 * @since 9 376 */ 377 function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise<Array<GeoAddress>>; 378 379 /** 380 * Obtain latitude and longitude info from location address. 381 * @param { GeoCodeRequest } request - Indicates the geocode query parameters. 382 * @param { AsyncCallback<Array<GeoAddress>> } callback - Indicates the callback for reporting the latitude and longitude result. 383 * @returns { void }. 384 * @throws { BusinessError } 401 - Parameter error. 385 * @throws { BusinessError } 801 - Capability not supported. 386 * @throws { BusinessError } 3301000 - Location service is unavailable. 387 * @throws { BusinessError } 3301400 - Geocoding query failed. 388 * @syscap SystemCapability.Location.Location.Geocoder 389 * @since 9 390 */ 391 function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>): void; 392 393 /** 394 * Obtain latitude and longitude info from location address. 395 * @param { GeoCodeRequest } request - Indicates the geocode query parameters. 396 * @returns { Promise<Array<GeoAddress>> } The promise returned by the function. 397 * @throws { BusinessError } 401 - Parameter error. 398 * @throws { BusinessError } 801 - Capability not supported. 399 * @throws { BusinessError } 3301000 - Location service is unavailable. 400 * @throws { BusinessError } 3301400 - Geocoding query failed. 401 * @syscap SystemCapability.Location.Location.Geocoder 402 * @since 9 403 */ 404 function getAddressesFromLocationName(request: GeoCodeRequest): Promise<Array<GeoAddress>>; 405 406 /** 407 * Obtain geocoding service status. 408 * @returns { boolean } Returns {@code true} if geocoding service is available, returns {@code false} otherwise. 409 * @throws { BusinessError } 801 - Capability not supported. 410 * @throws { BusinessError } 3301000 - Location service is unavailable. 411 * @syscap SystemCapability.Location.Location.Geocoder 412 * @since 9 413 */ 414 function isGeocoderAvailable(): boolean; 415 416 /** 417 * Obtain the number of cached GNSS locations reported at a time. 418 * @permission ohos.permission.APPROXIMATELY_LOCATION 419 * @param { AsyncCallback<number> } callback - Indicates the callback for reporting the cached GNSS locations size. 420 * @returns { void }. 421 * @throws { BusinessError } 201 - Permission denied. 422 * @throws { BusinessError } 401 - Parameter error. 423 * @throws { BusinessError } 801 - Capability not supported. 424 * @throws { BusinessError } 3301000 - Location service is unavailable. 425 * @throws { BusinessError } 3301100 - The location switch is off. 426 * @syscap SystemCapability.Location.Location.Gnss 427 * @since 9 428 */ 429 function getCachedGnssLocationsSize(callback: AsyncCallback<number>): void; 430 431 /** 432 * Obtain the number of cached GNSS locations. 433 * @permission ohos.permission.APPROXIMATELY_LOCATION 434 * @returns { Promise<number> } The promise returned by the function. 435 * @throws { BusinessError } 201 - Permission denied. 436 * @throws { BusinessError } 801 - Capability not supported. 437 * @throws { BusinessError } 3301000 - Location service is unavailable. 438 * @throws { BusinessError } 3301100 - The location switch is off. 439 * @syscap SystemCapability.Location.Location.Gnss 440 * @since 9 441 */ 442 function getCachedGnssLocationsSize(): Promise<number>; 443 444 /** 445 * All prepared GNSS locations are returned to the application through the callback function, 446 * and the bottom-layer buffer is cleared. 447 * @permission ohos.permission.APPROXIMATELY_LOCATION 448 * @param { AsyncCallback<void> } callback - Indicates the callback for reporting the error message. 449 * If the function fails to execute, the error message will be carried in the first parameter err of AsyncCallback, 450 * If the function executes successfully, execute the callback function only, no data will be returned. 451 * @returns { void }. 452 * @throws { BusinessError } 201 - Permission denied. 453 * @throws { BusinessError } 401 - Parameter error. 454 * @throws { BusinessError } 801 - Capability not supported. 455 * @throws { BusinessError } 3301000 - Location service is unavailable. 456 * @throws { BusinessError } 3301100 - The location switch is off. 457 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 458 * @syscap SystemCapability.Location.Location.Gnss 459 * @since 9 460 */ 461 function flushCachedGnssLocations(callback: AsyncCallback<void>): void; 462 463 /** 464 * All prepared GNSS locations are returned to the application, 465 * and the bottom-layer buffer is cleared. 466 * @permission ohos.permission.APPROXIMATELY_LOCATION 467 * @returns { Promise<void> } The promise returned by the function. 468 * @throws { BusinessError } 201 - Permission denied. 469 * @throws { BusinessError } 801 - Capability not supported. 470 * @throws { BusinessError } 3301000 - Location service is unavailable. 471 * @throws { BusinessError } 3301100 - The location switch is off. 472 * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. 473 * @syscap SystemCapability.Location.Location.Gnss 474 * @since 9 475 */ 476 function flushCachedGnssLocations(): Promise<void>; 477 478 /** 479 * Send extended commands to location subsystem. 480 * @param { LocationCommand } command - Indicates the extended command message body. 481 * @param { AsyncCallback<void> } callback - Indicates the callback for reporting the error message. 482 * If the function fails to execute, the error message will be carried in the first parameter err of AsyncCallback, 483 * If the function executes successfully, execute the callback function only, no data will be returned. 484 * @returns { void }. 485 * @throws { BusinessError } 401 - Parameter error. 486 * @throws { BusinessError } 801 - Capability not supported. 487 * @throws { BusinessError } 3301000 - Location service is unavailable. 488 * @syscap SystemCapability.Location.Location.Core 489 * @since 9 490 */ 491 function sendCommand(command: LocationCommand, callback: AsyncCallback<void>): void; 492 493 /** 494 * Send extended commands to location subsystem. 495 * @param { LocationCommand } command - Indicates the extended command message body. 496 * @returns { Promise<void> } The promise returned by the function. 497 * @throws { BusinessError } 401 - Parameter error. 498 * @throws { BusinessError } 801 - Capability not supported. 499 * @throws { BusinessError } 3301000 - Location service is unavailable. 500 * @syscap SystemCapability.Location.Location.Core 501 * @since 9 502 */ 503 function sendCommand(command: LocationCommand): Promise<void>; 504 505 /** 506 * Obtain the current country code. 507 * @param { AsyncCallback<CountryCode> } callback - Indicates the callback for reporting the country code. 508 * @returns { void }. 509 * @throws { BusinessError } 401 - Parameter error. 510 * @throws { BusinessError } 801 - Capability not supported. 511 * @throws { BusinessError } 3301000 - Location service is unavailable. 512 * @throws { BusinessError } 3301500 - Failed to query the area information. 513 * @syscap SystemCapability.Location.Location.Core 514 * @since 9 515 */ 516 function getCountryCode(callback: AsyncCallback<CountryCode>): void; 517 518 /** 519 * Obtain the current country code. 520 * @returns { Promise<CountryCode> } The promise returned by the function. 521 * @throws { BusinessError } 801 - Capability not supported. 522 * @throws { BusinessError } 3301000 - Location service is unavailable. 523 * @throws { BusinessError } 3301500 - Failed to query the area information. 524 * @syscap SystemCapability.Location.Location.Core 525 * @since 9 526 */ 527 function getCountryCode(): Promise<CountryCode>; 528 529 /** 530 * Enable the geographical location simulation function. 531 * @returns { void }. 532 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 533 * @throws { BusinessError } 801 - Capability not supported. 534 * @throws { BusinessError } 3301000 - Location service is unavailable. 535 * @throws { BusinessError } 3301100 - The location switch is off. 536 * @syscap SystemCapability.Location.Location.Core 537 * @systemapi 538 * @since 9 539 */ 540 function enableLocationMock(): void; 541 542 /** 543 * Disable the geographical location simulation function. 544 * @returns { void }. 545 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 546 * @throws { BusinessError } 801 - Capability not supported. 547 * @throws { BusinessError } 3301000 - Location service is unavailable. 548 * @throws { BusinessError } 3301100 - The location switch is off. 549 * @syscap SystemCapability.Location.Location.Core 550 * @systemapi 551 * @since 9 552 */ 553 function disableLocationMock(): void; 554 555 /** 556 * Set the configuration parameters for location simulation. 557 * @param { LocationMockConfig } config - Indicates the configuration parameters for location simulation. 558 * Contains the array of locations and reporting intervals that need to be simulated. 559 * @returns { void }. 560 * @throws { BusinessError } 401 - Parameter error. 561 * @throws { BusinessError } 801 - Capability not supported. 562 * @throws { BusinessError } 3301000 - Location service is unavailable. 563 * @throws { BusinessError } 3301100 - The location switch is off. 564 * @syscap SystemCapability.Location.Location.Core 565 * @systemapi 566 * @since 9 567 */ 568 function setMockedLocations(config: LocationMockConfig): void; 569 570 /** 571 * Enable the reverse geocoding simulation function. 572 * @returns { void }. 573 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 574 * @throws { BusinessError } 801 - Capability not supported. 575 * @throws { BusinessError } 3301000 - Location service is unavailable. 576 * @syscap SystemCapability.Location.Location.Core 577 * @systemapi 578 * @since 9 579 */ 580 function enableReverseGeocodingMock(): void; 581 582 /** 583 * Disable the reverse geocoding simulation function. 584 * @returns { void }. 585 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 586 * @throws { BusinessError } 801 - Capability not supported. 587 * @throws { BusinessError } 3301000 - Location service is unavailable. 588 * @syscap SystemCapability.Location.Location.Core 589 * @systemapi 590 * @since 9 591 */ 592 function disableReverseGeocodingMock(): void; 593 594 /** 595 * Set the configuration parameters for simulating reverse geocoding. 596 * @param { Array<ReverseGeocodingMockInfo> } mockInfos - Indicates the set of locations and place names to be simulated. 597 * @returns { void }. 598 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 599 * @throws { BusinessError } 401 - Parameter error. 600 * @throws { BusinessError } 801 - Capability not supported. 601 * @throws { BusinessError } 3301000 - Location service is unavailable. 602 * @syscap SystemCapability.Location.Location.Core 603 * @systemapi 604 * @since 9 605 */ 606 function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>): void; 607 608 /** 609 * Querying location privacy protocol confirmation status. 610 * @param { LocationPrivacyType } type - Indicates location privacy protocol type. 611 * @returns { boolean } Returns {@code true} if the location privacy protocol has been confirmed, returns {@code false} otherwise. 612 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 613 * @throws { BusinessError } 401 - Parameter error. 614 * @throws { BusinessError } 801 - Capability not supported. 615 * @throws { BusinessError } 3301000 - Location service is unavailable. 616 * @syscap SystemCapability.Location.Location.Core 617 * @systemapi 618 * @since 9 619 */ 620 function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean; 621 622 /** 623 * Set location privacy protocol confirmation status. 624 * @permission ohos.permission.MANAGE_SECURE_SETTINGS 625 * @param { LocationPrivacyType } type - Indicates location privacy protocol type. 626 * @param { boolean } isConfirmed - Indicates whether the location privacy protocol has been confirmed. 627 * @returns { void }. 628 * @throws { BusinessError } 201 - Permission denied. 629 * @throws { BusinessError } 202 - System API is not allowed called by third HAP. 630 * @throws { BusinessError } 401 - Parameter error. 631 * @throws { BusinessError } 801 - Capability not supported. 632 * @throws { BusinessError } 3301000 - Location service is unavailable. 633 * @syscap SystemCapability.Location.Location.Core 634 * @systemapi 635 * @since 9 636 */ 637 function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void; 638 639 /** 640 * Configuration parameters for simulating reverse geocoding. 641 * @typedef ReverseGeocodingMockInfo 642 * @syscap SystemCapability.Location.Location.Core 643 * @systemapi 644 * @since 9 645 */ 646 export interface ReverseGeocodingMockInfo { 647 /** 648 * Location for which reverse geocoding query is required. 649 * @type { ReverseGeoCodeRequest } 650 * @systemapi 651 * @since 9 652 */ 653 location: ReverseGeoCodeRequest; 654 655 /** 656 * Actual address information corresponding to the location. 657 * @type { GeoAddress } 658 * @systemapi 659 * @since 9 660 */ 661 geoAddress: GeoAddress; 662 } 663 664 /** 665 * Parameters for configuring the location simulation function. 666 * @typedef LocationMockConfig 667 * @syscap SystemCapability.Location.Location.Core 668 * @systemapi 669 * @since 9 670 */ 671 export interface LocationMockConfig { 672 /** 673 * Interval for reporting simulated locations. 674 * @type { number } 675 * @systemapi 676 * @since 9 677 */ 678 timeInterval: number; 679 680 /** 681 * Mock location array. 682 * @type { Array<Location> } 683 * @systemapi 684 * @since 9 685 */ 686 locations: Array<Location>; 687 } 688 689 /** 690 * Satellite status information. 691 * @typedef SatelliteStatusInfo 692 * @syscap SystemCapability.Location.Location.Gnss 693 * @since 9 694 */ 695 export interface SatelliteStatusInfo { 696 /** 697 * Number of satellites. 698 * @type { number } 699 * @since 9 700 */ 701 satellitesNumber: number; 702 703 /** 704 * Satellite ID array. 705 * @type { Array<number> } 706 * @since 9 707 */ 708 satelliteIds: Array<number>; 709 710 /** 711 * Carrier to noise density array. 712 * @type { Array<number> } 713 * @since 9 714 */ 715 carrierToNoiseDensitys: Array<number>; 716 717 /** 718 * Satellite altitude array. 719 * @type { Array<number> } 720 * @since 9 721 */ 722 altitudes: Array<number>; 723 724 /** 725 * Satellite azimuth array. 726 * @type { Array<number> } 727 * @since 9 728 */ 729 azimuths: Array<number>; 730 731 /** 732 * Satellite carrier frequency array. 733 * @type { Array<number> } 734 * @since 9 735 */ 736 carrierFrequencies: Array<number>; 737 } 738 739 /** 740 * Parameters for requesting to report cache location information. 741 * @typedef CachedGnssLocationsRequest 742 * @syscap SystemCapability.Location.Location.Gnss 743 * @since 9 744 */ 745 export interface CachedGnssLocationsRequest { 746 /** 747 * GNSS cache location report period. 748 * @type { number } 749 * @since 9 750 */ 751 reportingPeriodSec: number; 752 753 /** 754 * Indicates whether to wake up the listener when the GNSS cache location queue is full. 755 * @type { boolean } 756 * @since 9 757 */ 758 wakeUpCacheQueueFull: boolean; 759 } 760 761 /** 762 * Configuring parameters in geo fence requests. 763 * @typedef GeofenceRequest 764 * @syscap SystemCapability.Location.Location.Geofence 765 * @since 9 766 */ 767 export interface GeofenceRequest { 768 /** 769 * Indicate the user scenario. 770 * @type { LocationRequestScenario } 771 * @since 9 772 */ 773 scenario: LocationRequestScenario; 774 775 /** 776 * Circular fence information. 777 * @type { Geofence } 778 * @since 9 779 */ 780 geofence: Geofence; 781 } 782 783 /** 784 * Circular fence information. 785 * @typedef Geofence 786 * @syscap SystemCapability.Location.Location.Geofence 787 * @since 9 788 */ 789 export interface Geofence { 790 /** 791 * Latitude of the center point of the circular fence. 792 * @type { number } 793 * @since 9 794 */ 795 latitude: number; 796 797 /** 798 * Longitude of the center point of the circular fence. 799 * @type { number } 800 * @since 9 801 */ 802 longitude: number; 803 804 /** 805 * Radius of the circular fence. 806 * @type { number } 807 * @since 9 808 */ 809 radius: number; 810 811 /** 812 * Expiration of the circular fence. 813 * @type { number } 814 * @since 9 815 */ 816 expiration: number; 817 } 818 819 /** 820 * Configuring parameters in reverse geocode requests. 821 * @typedef ReverseGeoCodeRequest 822 * @syscap SystemCapability.Location.Location.Geocoder 823 * @since 9 824 */ 825 export interface ReverseGeoCodeRequest { 826 /** 827 * Indicates the language area information. 828 * @type { ?string } 829 * @since 9 830 */ 831 locale?: string; 832 833 /** 834 * Latitude for reverse geocoding query. 835 * @type { number } 836 * @since 9 837 */ 838 latitude: number; 839 840 /** 841 * Longitude for reverse geocoding query. 842 * @type { number } 843 * @since 9 844 */ 845 longitude: number; 846 847 /** 848 * Indicates the maximum number of addresses returned by reverse geocoding query. 849 * @type { ?number } 850 * @since 9 851 */ 852 maxItems?: number; 853 } 854 855 /** 856 * Configuring parameters in geocode requests. 857 * @typedef GeoCodeRequest 858 * @syscap SystemCapability.Location.Location.Geocoder 859 * @since 9 860 */ 861 export interface GeoCodeRequest { 862 /** 863 * Indicates the language area information. 864 * @type { ?string } 865 * @since 9 866 */ 867 locale?: string; 868 869 /** 870 * Address information that needs to be geocoded. 871 * @type { string } 872 * @since 9 873 */ 874 description: string; 875 876 /** 877 * Indicates the maximum number of geocode query results. 878 * @type { ?number } 879 * @since 9 880 */ 881 maxItems?: number; 882 883 /** 884 * Indicates the minimum latitude for geocoding query results. 885 * @type { ?number } 886 * @since 9 887 */ 888 minLatitude?: number; 889 890 /** 891 * Indicates the minimum longitude for geocoding query results. 892 * @type { ?number } 893 * @since 9 894 */ 895 minLongitude?: number; 896 897 /** 898 * Indicates the maximum latitude for geocoding query results. 899 * @type { ?number } 900 * @since 9 901 */ 902 maxLatitude?: number; 903 904 /** 905 * Indicates the maximum longitude for geocoding query results. 906 * @type { ?number } 907 * @since 9 908 */ 909 maxLongitude?: number; 910 } 911 912 /** 913 * Data struct describes geographic locations. 914 * @typedef GeoAddress 915 * @syscap SystemCapability.Location.Location.Geocoder 916 * @since 9 917 */ 918 export interface GeoAddress { 919 /** 920 * Indicates latitude information. 921 * A positive value indicates north latitude, 922 * and a negative value indicates south latitude. 923 * @type { ?number } 924 * @since 9 925 */ 926 latitude?: number; 927 928 /** 929 * Indicates longitude information. 930 * A positive value indicates east longitude , 931 * and a negative value indicates west longitude. 932 * @type { ?number } 933 * @since 9 934 */ 935 longitude?: number; 936 937 /** 938 * Indicates language used for the location description. 939 * zh indicates Chinese, and en indicates English. 940 * @type { ?string } 941 * @since 9 942 */ 943 locale?: string; 944 945 /** 946 * Indicates landmark of the location. 947 * @type { ?string } 948 * @since 9 949 */ 950 placeName?: string; 951 952 /** 953 * Indicates country code. 954 * @type { ?string } 955 * @since 9 956 */ 957 countryCode?: string; 958 959 /** 960 * Indicates country name. 961 * @type { ?string } 962 * @since 9 963 */ 964 countryName?: string; 965 966 /** 967 * Indicates administrative region name. 968 * @type { ?string } 969 * @since 9 970 */ 971 administrativeArea?: string; 972 973 /** 974 * Indicates sub-administrative region name. 975 * @type { ?string } 976 * @since 9 977 */ 978 subAdministrativeArea?: string; 979 980 /** 981 * Indicates locality information. 982 * @type { ?string } 983 * @since 9 984 */ 985 locality?: string; 986 987 /** 988 * Indicates sub-locality information. 989 * @type { ?string } 990 * @since 9 991 */ 992 subLocality?: string; 993 994 /** 995 * Indicates road name. 996 * @type { ?string } 997 * @since 9 998 */ 999 roadName?: string; 1000 1001 /** 1002 * Indicates auxiliary road information. 1003 * @type { ?string } 1004 * @since 9 1005 */ 1006 subRoadName?: string; 1007 1008 /** 1009 * Indicates house information. 1010 * @type { ?string } 1011 * @since 9 1012 */ 1013 premises?: string; 1014 1015 /** 1016 * Indicates postal code. 1017 * @type { ?string } 1018 * @since 9 1019 */ 1020 postalCode?: string; 1021 1022 /** 1023 * Indicates phone number. 1024 * @type { ?string } 1025 * @since 9 1026 */ 1027 phoneNumber?: string; 1028 1029 /** 1030 * Indicates website URL. 1031 * @type { ?string } 1032 * @since 9 1033 */ 1034 addressUrl?: string; 1035 1036 /** 1037 * Indicates additional information. 1038 * @type { ?Array<string> } 1039 * @since 9 1040 */ 1041 descriptions?: Array<string>; 1042 1043 /** 1044 * Indicates the amount of additional descriptive information. 1045 * @type { ?number } 1046 * @since 9 1047 */ 1048 descriptionsSize?: number; 1049 1050 /** 1051 * Indicates whether it is an mock GeoAddress 1052 * @type { ?Boolean } 1053 * @systemapi 1054 * @since 9 1055 */ 1056 isFromMock?: Boolean; 1057 } 1058 1059 /** 1060 * Configuring parameters in location requests. 1061 * @typedef LocationRequest 1062 * @syscap SystemCapability.Location.Location.Core 1063 * @since 9 1064 */ 1065 export interface LocationRequest { 1066 /** 1067 * Priority of the location request. 1068 * @type { ?LocationRequestPriority } 1069 * @since 9 1070 */ 1071 priority?: LocationRequestPriority; 1072 1073 /** 1074 * User scenario of the location request. 1075 * @type { ?LocationRequestScenario } 1076 * @since 9 1077 */ 1078 scenario?: LocationRequestScenario; 1079 1080 /** 1081 * Location report interval. 1082 * @type { ?number } 1083 * @since 9 1084 */ 1085 timeInterval?: number; 1086 1087 /** 1088 * Location report distance interval. 1089 * @type { ?number } 1090 * @since 9 1091 */ 1092 distanceInterval?: number; 1093 1094 /** 1095 * Accuracy requirements for reporting locations. 1096 * @type { ?number } 1097 * @since 9 1098 */ 1099 maxAccuracy?: number; 1100 } 1101 1102 /** 1103 * Configuring parameters in current location requests. 1104 * @typedef CurrentLocationRequest 1105 * @syscap SystemCapability.Location.Location.Core 1106 * @since 9 1107 */ 1108 export interface CurrentLocationRequest { 1109 /** 1110 * Priority of the location request. 1111 * @type { ?LocationRequestPriority } 1112 * @since 9 1113 */ 1114 priority?: LocationRequestPriority; 1115 1116 /** 1117 * User scenario of the location request. 1118 * @type { ?LocationRequestScenario } 1119 * @since 9 1120 */ 1121 scenario?: LocationRequestScenario; 1122 1123 /** 1124 * Accuracy requirements for reporting locations. 1125 * @type { ?number } 1126 * @since 9 1127 */ 1128 maxAccuracy?: number; 1129 1130 /** 1131 * Timeout interval of a single location request. 1132 * @type { ?number } 1133 * @since 9 1134 */ 1135 timeoutMs?: number; 1136 } 1137 1138 /** 1139 * Provides information about geographic locations. 1140 * @typedef Location 1141 * @syscap SystemCapability.Location.Location.Core 1142 * @since 9 1143 */ 1144 export interface Location { 1145 /** 1146 * Indicates latitude information. 1147 * A positive value indicates north latitude, 1148 * and a negative value indicates south latitude. 1149 * @type { number } 1150 * @since 9 1151 */ 1152 latitude: number; 1153 1154 /** 1155 * Indicates Longitude information. 1156 * A positive value indicates east longitude , 1157 * and a negative value indicates west longitude. 1158 * @type { number } 1159 * @since 9 1160 */ 1161 longitude: number; 1162 1163 /** 1164 * Indicates location altitude, in meters. 1165 * @type { number } 1166 * @since 9 1167 */ 1168 altitude: number; 1169 1170 /** 1171 * Indicates location accuracy, in meters. 1172 * @type { number } 1173 * @since 9 1174 */ 1175 accuracy: number; 1176 1177 /** 1178 * Indicates speed, in m/s. 1179 * @type { number } 1180 * @since 9 1181 */ 1182 speed: number; 1183 1184 /** 1185 * Indicates location timestamp in the UTC format. 1186 * @type { number } 1187 * @since 9 1188 */ 1189 timeStamp: number; 1190 1191 /** 1192 * Indicates direction information. 1193 * @type { number } 1194 * @since 9 1195 */ 1196 direction: number; 1197 1198 /** 1199 * Indicates location timestamp since boot. 1200 * @type { number } 1201 * @since 9 1202 */ 1203 timeSinceBoot: number; 1204 1205 /** 1206 * Indicates additional information. 1207 * @type { ?Array<string> } 1208 * @since 9 1209 */ 1210 additions?: Array<string>; 1211 1212 /** 1213 * Indicates the amount of additional descriptive information. 1214 * @type { ?number } 1215 * @since 9 1216 */ 1217 additionSize?: number; 1218 1219 /** 1220 * Indicates whether it is an mock location. 1221 * @type { ?Boolean } 1222 * @systemapi 1223 * @since 9 1224 */ 1225 isFromMock?: Boolean; 1226 } 1227 1228 /** 1229 * Enum for location priority. 1230 * @enum { number } 1231 * @syscap SystemCapability.Location.Location.Core 1232 * @since 9 1233 */ 1234 export enum LocationRequestPriority { 1235 /** 1236 * Default priority. 1237 * @syscap SystemCapability.Location.Location.Core 1238 * @since 9 1239 */ 1240 UNSET = 0x200, 1241 1242 /** 1243 * Preferentially ensure the locating accuracy. 1244 * @syscap SystemCapability.Location.Location.Core 1245 * @since 9 1246 */ 1247 ACCURACY, 1248 1249 /** 1250 * Preferentially ensure low power consumption for locating. 1251 * @syscap SystemCapability.Location.Location.Core 1252 * @since 9 1253 */ 1254 LOW_POWER, 1255 1256 /** 1257 * Preferentially ensure that the first location is time-consuming. 1258 * @syscap SystemCapability.Location.Location.Core 1259 * @since 9 1260 */ 1261 FIRST_FIX, 1262 } 1263 1264 /** 1265 * Enum for location scenario. 1266 * @enum { number } 1267 * @syscap SystemCapability.Location.Location.Core 1268 * @since 9 1269 */ 1270 export enum LocationRequestScenario { 1271 /** 1272 * Default scenario. 1273 * @syscap SystemCapability.Location.Location.Core 1274 * @since 9 1275 */ 1276 UNSET = 0x300, 1277 1278 /** 1279 * Navigation scenario. High positioning precision and real-time performance are required. 1280 * @syscap SystemCapability.Location.Location.Core 1281 * @since 9 1282 */ 1283 NAVIGATION, 1284 1285 /** 1286 * Trajectory tracking scenario. High positioning precision is required. 1287 * @syscap SystemCapability.Location.Location.Core 1288 * @since 9 1289 */ 1290 TRAJECTORY_TRACKING, 1291 1292 /** 1293 * Car hailing scenario. High positioning precision and real-time performance are required. 1294 * @syscap SystemCapability.Location.Location.Core 1295 * @since 9 1296 */ 1297 CAR_HAILING, 1298 1299 /** 1300 * Daily life scenarios. Low requirements on positioning precision and real-time performance. 1301 * @syscap SystemCapability.Location.Location.Core 1302 * @since 9 1303 */ 1304 DAILY_LIFE_SERVICE, 1305 1306 /** 1307 * Power saving scenarios. 1308 * @syscap SystemCapability.Location.Location.Core 1309 * @since 9 1310 */ 1311 NO_POWER, 1312 } 1313 1314 /** 1315 * Enum for location privacy type. 1316 * @enum { number } 1317 * @syscap SystemCapability.Location.Location.Core 1318 * @systemapi 1319 * @since 9 1320 */ 1321 export enum LocationPrivacyType { 1322 /** 1323 * Other scenarios. 1324 * @syscap SystemCapability.Location.Location.Core 1325 * @systemapi 1326 * @since 9 1327 */ 1328 OTHERS = 0, 1329 1330 /** 1331 * Privacy agreement for the startup wizard scenario. 1332 * @syscap SystemCapability.Location.Location.Core 1333 * @systemapi 1334 * @since 9 1335 */ 1336 STARTUP, 1337 1338 /** 1339 * Privacy agreement pop-up when network location is enabled. 1340 * @syscap SystemCapability.Location.Location.Core 1341 * @systemapi 1342 * @since 9 1343 */ 1344 CORE_LOCATION, 1345 } 1346 1347 /** 1348 * Location subsystem command structure. 1349 * @typedef LocationCommand 1350 * @syscap SystemCapability.Location.Location.Core 1351 * @since 9 1352 */ 1353 export interface LocationCommand { 1354 /** 1355 * Information about the scenario where the command is sent. 1356 * @type { LocationRequestScenario } 1357 * @since 9 1358 */ 1359 scenario: LocationRequestScenario; 1360 1361 /** 1362 * Sent command content. 1363 * @type { string } 1364 * @since 9 1365 */ 1366 command: string; 1367 } 1368 1369 /** 1370 * Country code structure. 1371 * @typedef CountryCode 1372 * @syscap SystemCapability.Location.Location.Core 1373 * @since 9 1374 */ 1375 export interface CountryCode { 1376 /** 1377 * Country code character string. 1378 * @type { string } 1379 * @since 9 1380 */ 1381 country: string; 1382 1383 /** 1384 * Country code source. 1385 * @type { CountryCodeType } 1386 * @since 9 1387 */ 1388 type: CountryCodeType; 1389 } 1390 1391 /** 1392 * Enum for country code type. 1393 * @enum { number } 1394 * @syscap SystemCapability.Location.Location.Core 1395 * @since 9 1396 */ 1397 export enum CountryCodeType { 1398 /** 1399 * Country code obtained from the locale setting. 1400 * @syscap SystemCapability.Location.Location.Core 1401 * @since 9 1402 */ 1403 COUNTRY_CODE_FROM_LOCALE = 1, 1404 1405 /** 1406 * Country code obtained from the SIM information. 1407 * @syscap SystemCapability.Location.Location.Core 1408 * @since 9 1409 */ 1410 COUNTRY_CODE_FROM_SIM, 1411 1412 /** 1413 * Obtains the current location for geocoded query and obtains the country code from the result. 1414 * @syscap SystemCapability.Location.Location.Core 1415 * @since 9 1416 */ 1417 COUNTRY_CODE_FROM_LOCATION, 1418 1419 /** 1420 * Obtain the country code from the cell registration information. 1421 * @syscap SystemCapability.Location.Location.Core 1422 * @since 9 1423 */ 1424 COUNTRY_CODE_FROM_NETWORK, 1425 } 1426} 1427 1428export default geoLocationManager; 1429