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 #ifndef DSLM_CALLBACK_PROXY 17 #define DSLM_CALLBACK_PROXY 18 19 #include <cstdint> 20 #include <functional> 21 22 #include "iremote_broker.h" 23 #include "iremote_object.h" 24 #include "iremote_proxy.h" 25 #include "nocopyable.h" 26 #include "refbase.h" 27 28 #include "idevice_security_level.h" 29 30 namespace OHOS { 31 namespace Security { 32 namespace DeviceSecurityLevel { 33 using namespace OHOS; 34 class DslmCallbackProxy : public IRemoteProxy<IDeviceSecurityLevelCallback>, public NoCopyable { 35 public: 36 explicit DslmCallbackProxy(const sptr<IRemoteObject> &impl); 37 ~DslmCallbackProxy() override = default; 38 39 struct ResponseInfo { 40 uint32_t result {0}; 41 uint32_t level {0}; 42 const uint8_t *extraBuff {nullptr}; 43 uint32_t extraLen {0}; 44 }; 45 46 int32_t ResponseDeviceSecurityLevel(uint32_t cookie, const ResponseInfo &response); 47 48 private: 49 static inline BrokerDelegator<DslmCallbackProxy> delegator_; 50 }; 51 } // namespace DeviceSecurityLevel 52 } // namespace Security 53 } // namespace OHOS 54 55 #endif // DSLM_CALLBACK_PROXY