• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-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 
16 #ifndef OHOS_DP_I_DISTRIBUTED_DEVICE_PROFILE_H
17 #define OHOS_DP_I_DISTRIBUTED_DEVICE_PROFILE_H
18 
19 #include <vector>
20 
21 #include "iremote_broker.h"
22 
23 #include "access_control_profile.h"
24 #include "characteristic_profile.h"
25 #include "device_icon_info.h"
26 #include "device_icon_info_filter_options.h"
27 #include "device_profile.h"
28 #include "device_profile_filter_options.h"
29 #include "dp_subscribe_info.h"
30 #include "dp_sync_options.h"
31 #include "i_sync_completed_callback.h"
32 #include "product_info.h"
33 #include "service_info_profile.h"
34 #include "service_info_unique_key.h"
35 #include "service_profile.h"
36 #include "trust_device_profile.h"
37 #include "trusted_device_info.h"
38 #include "local_service_info.h"
39 #include "business_event.h"
40 
41 namespace OHOS {
42 namespace DistributedDeviceProfile {
43 class IDistributedDeviceProfile : public OHOS::IRemoteBroker {
44 public:
45     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.DeviceProfile.IDistributedDeviceProfile");
46     IDistributedDeviceProfile() = default;
47     virtual ~IDistributedDeviceProfile() = default;
48     virtual int32_t PutAccessControlProfile(const AccessControlProfile& aclProfile) = 0;
49     virtual int32_t UpdateAccessControlProfile(const AccessControlProfile& aclProfile) = 0;
50     virtual int32_t GetTrustDeviceProfile(const std::string& deviceId, TrustDeviceProfile& trustDeviceProfile) = 0;
51     virtual int32_t GetAllTrustDeviceProfile(std::vector<TrustDeviceProfile>& trustDeviceProfiles) = 0;
52     virtual int32_t GetAccessControlProfile(std::map<std::string, std::string> queryParams,
53          std::vector<AccessControlProfile>& accessControlProfiles) = 0;
54     virtual int32_t GetAllAccessControlProfile(std::vector<AccessControlProfile>& accessControlProfiles) = 0;
55     virtual int32_t GetAllAclIncludeLnnAcl(std::vector<AccessControlProfile>& accessControlProfiles) = 0;
56     virtual int32_t DeleteAccessControlProfile(int32_t accessControlId) = 0;
57     virtual int32_t PutSessionKey(uint32_t userId, const std::vector<uint8_t>& sessionKey, int32_t& sessionKeyId) = 0;
58     virtual int32_t GetSessionKey(uint32_t userId, int32_t sessionKeyId, std::vector<uint8_t>& sessionKey) = 0;
59     virtual int32_t UpdateSessionKey(uint32_t userId, int32_t sessionKeyId, const std::vector<uint8_t>& sessionKey) = 0;
60     virtual int32_t DeleteSessionKey(uint32_t userId, int32_t sessionKeyId) = 0;
61     virtual int32_t PutDeviceProfileBatch(std::vector<DeviceProfile>& deviceProfiles) = 0;
62     virtual int32_t PutServiceProfile(const ServiceProfile& serviceProfile) = 0;
63     virtual int32_t PutServiceProfileBatch(const std::vector<ServiceProfile>& serviceProfiles) = 0;
64     virtual int32_t PutCharacteristicProfile(const CharacteristicProfile& charProfile) = 0;
65     virtual int32_t PutCharacteristicProfileBatch(const std::vector<CharacteristicProfile>& charProfiles) = 0;
66     virtual int32_t GetDeviceProfile(const std::string& deviceId, DeviceProfile& deviceProfile) = 0;
67     virtual int32_t GetDeviceProfiles(DeviceProfileFilterOptions& options,
68         std::vector<DeviceProfile>& deviceProfiles) = 0;
69     virtual int32_t DeleteDeviceProfileBatch(std::vector<DeviceProfile>& deviceProfiles) = 0;
70     virtual int32_t GetServiceProfile(const std::string& deviceId, const std::string& serviceName,
71         ServiceProfile& serviceProfile) = 0;
72     virtual int32_t GetCharacteristicProfile(const std::string& deviceId, const std::string& serviceName,
73         const std::string& characteristicId, CharacteristicProfile& charProfile) = 0;
74     virtual int32_t DeleteServiceProfile(const std::string& deviceId, const std::string& serviceName,
75         bool isMultiUser = false, int32_t userId = DEFAULT_USER_ID) = 0;
76     virtual int32_t DeleteCharacteristicProfile(const std::string& deviceId, const std::string& serviceName,
77         const std::string& characteristicId, bool isMultiUser = false, int32_t userId = DEFAULT_USER_ID) = 0;
78     virtual int32_t SubscribeDeviceProfile(const SubscribeInfo& subscribeInfo) = 0;
79     virtual int32_t UnSubscribeDeviceProfile(const SubscribeInfo& subscribeInfo) = 0;
80     virtual int32_t SubscribeDeviceProfileInited(int32_t saId, sptr<IRemoteObject> dpInitedCallback) = 0;
81     virtual int32_t UnSubscribeDeviceProfileInited(int32_t saId) = 0;
82     virtual int32_t SubscribePinCodeInvalid(const std::string& bundleName, int32_t pinExchangeType,
83         sptr<IRemoteObject> pinCodeCallback) = 0;
84     virtual int32_t UnSubscribePinCodeInvalid(const std::string& bundleName, int32_t pinExchangeType) = 0;
85     virtual int32_t SyncDeviceProfile(const DistributedDeviceProfile::DpSyncOptions& syncOptions,
86         sptr<IRemoteObject> syncCompletedCallback) = 0;
87     virtual int32_t SendSubscribeInfos(std::map<std::string, SubscribeInfo> listenerMap) = 0;
88     virtual int32_t PutAllTrustedDevices(const std::vector<TrustedDeviceInfo> deviceInfos) = 0;
89     virtual int32_t PutProductInfoBatch(const std::vector<ProductInfo>& productInfos) = 0;
90     virtual int32_t PutDeviceIconInfoBatch(const std::vector<DeviceIconInfo>& deviceIconInfos) = 0;
91     virtual int32_t GetDeviceIconInfos(const DeviceIconInfoFilterOptions& filterOptions,
92         std::vector<DeviceIconInfo>& deviceIconInfos) = 0;
93     virtual int32_t PutServiceInfoProfile(const ServiceInfoProfile& serviceInfoProfile) = 0;
94     virtual int32_t DeleteServiceInfoProfile(const ServiceInfoUniqueKey& key) = 0;
95     virtual int32_t UpdateServiceInfoProfile(const ServiceInfoProfile& serviceInfoProfile) = 0;
96     virtual int32_t GetServiceInfoProfileByUniqueKey(const ServiceInfoUniqueKey& key,
97         ServiceInfoProfile& serviceInfoProfile) = 0;
98     virtual int32_t GetServiceInfoProfileListByTokenId(const ServiceInfoUniqueKey& key,
99         std::vector<ServiceInfoProfile>& serviceInfoProfiles) = 0;
100     virtual int32_t GetAllServiceInfoProfileList(std::vector<ServiceInfoProfile>& serviceInfoProfiles) = 0;
101     virtual int32_t GetServiceInfoProfileListByBundleName(const ServiceInfoUniqueKey& key,
102         std::vector<ServiceInfoProfile>& serviceInfoProfiles) = 0;
103     virtual int32_t PutLocalServiceInfo(const LocalServiceInfo& localServiceInfo) = 0;
104     virtual int32_t UpdateLocalServiceInfo(const LocalServiceInfo& localServiceInfo) = 0;
105     virtual int32_t GetLocalServiceInfoByBundleAndPinType(const std::string& bundleName,
106         int32_t pinExchangeType, LocalServiceInfo& localServiceInfo) = 0;
107     virtual int32_t DeleteLocalServiceInfo(const std::string& bundleName, int32_t pinExchangeType) = 0;
108     virtual int32_t RegisterBusinessCallback(const std::string& saId, const std::string& businessKey,
109         sptr<IRemoteObject> businessCallback) = 0;
110     virtual int32_t UnRegisterBusinessCallback(const std::string& saId, const std::string& businessKey) = 0;
111     virtual int32_t PutBusinessEvent(const BusinessEvent& event) = 0;
112     virtual int32_t GetBusinessEvent(BusinessEvent& event) = 0;
113 };
114 } // namespace DistributedDeviceProfile
115 } // namespace OHOS
116 #endif // OHOS_DP_I_DISTRIBUTED_DEVICE_PROFILE_H
117