1 /* 2 * Copyright (c) 2022-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 16 #ifndef I_INPUTER_DATA_IMPL_H 17 #define I_INPUTER_DATA_IMPL_H 18 19 #include <cstdint> 20 #include <mutex> 21 #include <vector> 22 23 #include "inputer_set_data_stub.h" 24 #include "pin_auth_all_in_one_hdi.h" 25 #include "pin_auth_collector_hdi.h" 26 27 namespace OHOS { 28 namespace UserIam { 29 namespace PinAuth { 30 class IInputerDataImpl : public InputerSetDataStub { 31 public: 32 IInputerDataImpl(uint64_t scheduleId, std::shared_ptr<PinAuthAllInOneHdi> hdi); 33 IInputerDataImpl(uint64_t scheduleId, std::shared_ptr<PinAuthCollectorHdi> hdi); 34 ~IInputerDataImpl() override; 35 void OnSetData(int32_t authSubType, std::vector<uint8_t> data, int32_t errorCode) override; 36 37 private: 38 std::mutex mutex_; 39 uint64_t scheduleId_ {0}; 40 std::shared_ptr<PinAuthAllInOneHdi> allInOneHdi_ {nullptr}; 41 std::shared_ptr<PinAuthCollectorHdi> collectorHdi_ {nullptr}; 42 }; 43 } // namespace PinAuth 44 } // namespace UserIam 45 } // namespace OHOS 46 47 #endif // I_INPUTER_DATA_IMPL_H 48