1 /* 2 * Copyright (c) 2024 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 #ifndef ACE_MOKC_INTERFACES_INNER_API_SECURITY_COMPONENT_KIT_H 16 #define ACE_MOKC_INTERFACES_INNER_API_SECURITY_COMPONENT_KIT_H 17 18 #include <string> 19 #include "iremote_object.h" 20 #include "i_sec_comp_probe.h" 21 #include "sec_comp_base_mock.h" 22 23 namespace OHOS { 24 namespace Security { 25 namespace SecurityComponent { 26 struct ExtraInfo { 27 uint32_t dataSize; 28 uint8_t* data; 29 }; 30 31 enum class ClickEventType : int32_t { 32 UNKNOWN_EVENT_TYPE, 33 POINT_EVENT_TYPE, 34 KEY_EVENT_TYPE 35 }; 36 37 struct SecCompPointEvent { 38 double touchX; 39 double touchY; 40 uint64_t timestamp; 41 }; 42 43 struct SecCompKeyEvent { 44 uint64_t timestamp; 45 int32_t keyCode; 46 }; 47 48 struct SecCompClickEvent { 49 ClickEventType type; 50 union { 51 SecCompPointEvent point; 52 SecCompKeyEvent key; 53 }; 54 ExtraInfo extraInfo; 55 }; 56 57 class SecCompUiRegister { 58 public: SecCompUiRegister(std::vector<uintptr_t> & callerList,ISecCompProbe * probe)59 SecCompUiRegister(std::vector<uintptr_t>& callerList, ISecCompProbe* probe) {}; 60 virtual ~SecCompUiRegister() = default; 61 static ISecCompProbe* callbackProbe; 62 }; 63 64 class SecCompKit { 65 public: RegisterSecurityComponent(SecCompType type,std::string & componentInfo,int32_t & scId)66 static int32_t RegisterSecurityComponent(SecCompType type, std::string& componentInfo, int32_t& scId) 67 { 68 scId = 1; 69 return 0; 70 }; 71 UpdateSecurityComponent(int32_t scId,std::string & componentInfo)72 static int32_t UpdateSecurityComponent(int32_t scId, std::string& componentInfo) 73 { 74 return 0; 75 }; 76 UnregisterSecurityComponent(int32_t scId)77 static int32_t UnregisterSecurityComponent(int32_t scId) 78 { 79 return 0; 80 }; 81 PreRegisterSecCompProcess()82 static int32_t PreRegisterSecCompProcess() 83 { 84 return 0; 85 }; 86 87 static int32_t ReportSecurityComponentClickEvent(int32_t scId, 88 std::string& componentInfo, const SecCompClickEvent& clickInfo, sptr<IRemoteObject> callerToken = nullptr) 89 { 90 return 0; 91 }; 92 }; 93 } // namespace SecurityComponent 94 } // namespace Security 95 } // namespace OHOS 96 #endif // ACE_MOKC_INTERFACES_INNER_API_SECURITY_COMPONENT_KIT_H 97