1/* 2 * Copyright (C) 2025 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 16import type/IDataTypes; 17 18sequenceable OHOS.IRemoteObject; 19sequenceable OHOS.Location.LocatingRequiredDataConfig; 20sequenceable OHOS.Location.Location; 21sequenceable OHOS.Location.RequestConfig; 22sequenceable OHOS.Location.GeocodeConvertAddressRequest; 23sequenceable OHOS.Location.GeocodeConvertLocationRequest; 24sequenceable OHOS.Location.GeocodingMockInfo; 25sequenceable OHOS.Location.GeofenceRequest; 26sequenceable OHOS.Location.BeaconFenceRequest; 27sequenceable OHOS.Location.BeaconFence; 28 29interface OHOS.Location.ILocatorCallback; 30interface OHOS.Location.ICachedLocationsCallback; 31interface OHOS.Location.ILocatingRequiredDataCallback; 32interface OHOS.Location.IBluetoothScanResultCallback; 33 34option_stub_hooks on; 35 36interface OHOS.Location.ILocatorService { 37 [ipccode 1] void GetSwitchState([out] int state); 38 [ipccode 3] void StartLocating([in] RequestConfig requestConfig, [in] ILocatorCallback cb); 39 [ipccode 4] void StopLocating([in] ILocatorCallback cb); 40 [ipccode 5] void GetCacheLocation([out] Location location); 41 [ipccode 9] void EnableAbility([in] boolean isEnabled); 42 [ipccode 11] void IsGeoConvertAvailable([out] boolean isAvailable); 43 [ipccode 12] void GetAddressByCoordinate([in] IRemoteObject cb, [in] GeocodeConvertLocationRequest request); 44 [ipccode 13] void GetAddressByLocationName([in] IRemoteObject cb, [in] GeocodeConvertAddressRequest request); 45 [ipccode 16] void RegisterGnssStatusCallback([in] IRemoteObject cb); 46 [ipccode 17] void UnregisterGnssStatusCallback([in] IRemoteObject cb); 47 [ipccode 18] void RegisterNmeaMessageCallback([in] IRemoteObject cb); 48 [ipccode 19] void UnregisterNmeaMessageCallback([in] IRemoteObject cb); 49 [ipccode 20] void IsLocationPrivacyConfirmed([in] int type, [out] boolean state); 50 [ipccode 21] void SetLocationPrivacyConfirmStatus([in] int type, [in] boolean isConfirmed); 51 [ipccode 22] void RegisterCachedLocationCallback([in] int reportingPeriodSec, [in] boolean wakeUpCacheQueueFull, [in] ICachedLocationsCallback cb, [in] String bundleName); 52 [ipccode 23] void UnregisterCachedLocationCallback([in] ICachedLocationsCallback cb); 53 [ipccode 24] void GetCachedGnssLocationsSize([out] int size); 54 [ipccode 25] void FlushCachedGnssLocations(); 55 [ipccode 26] void SendCommand([in] int scenario, [in] String command); 56 [ipccode 27] void AddFence([in] GeofenceRequest request); 57 [ipccode 28] void RemoveFence([in] GeofenceRequest request); 58 [ipccode 30] void EnableLocationMock(); 59 [ipccode 31] void DisableLocationMock(); 60 [ipccode 32] void SetMockedLocations([in] int timeInterval, [in] List<Location> locations); 61 [ipccode 33] void EnableReverseGeocodingMock(); 62 [ipccode 34] void DisableReverseGeocodingMock(); 63 [ipccode 35] void SetReverseGeocodingMockInfo([in] List<GeocodingMockInfo> geocodingMockInfo); 64 [ipccode 38] void ProxyForFreeze([in] List<int> pidList, [in] boolean isProxy); 65 [ipccode 39] void ResetAllProxy(); 66 [ipccode 42] void ReportLocation([in] String abilityName, [in] Location location); 67 [ipccode 43] void RegisterLocatingRequiredDataCallback([in] LocatingRequiredDataConfig dataConfig, [in] ILocatingRequiredDataCallback cb); 68 [ipccode 44] void UnRegisterLocatingRequiredDataCallback([in] ILocatingRequiredDataCallback cb); 69 [ipccode 45] void AddGnssGeofence([in] GeofenceRequest request); 70 [ipccode 46] void RemoveGnssGeofence([in] int fenceId); 71 [ipccode 47] void QuerySupportCoordinateSystemType([out] List<CoordinateType> coordinateTypes); 72 [ipccode 48] void SubscribeLocationError([in] ILocatorCallback cb); 73 [ipccode 49] void UnSubscribeLocationError([in] ILocatorCallback cb); 74 [ipccode 50] void ReportLocationError([in] int errCodeNum, [in] String errMsg, [in] String uuid); 75 [ipccode 51] void EnableAbilityForUser([in] boolean isEnabled, [in] int userId); 76 [ipccode 52] void GetCurrentWifiBssidForLocating([out] String bssid); 77 [ipccode 53] void SetLocationSwitchIgnored([in] boolean isEnabled); 78 [ipccode 54] void SubscribeBluetoothScanResultChange([in] IBluetoothScanResultCallback cb); 79 [ipccode 55] void UnSubscribeBluetoothScanResultChange([in] IBluetoothScanResultCallback cb); 80 [ipccode 56] void IsPoiServiceSupported([out] boolean isPoiAvailable); 81 [ipccode 57] void AddBeaconFence([in] BeaconFenceRequest request); 82 [ipccode 58] void RemoveBeaconFence([in] BeaconFence beaconFence); 83}