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 USER_IDM_CALLBACK_SERVICE_H 17 #define USER_IDM_CALLBACK_SERVICE_H 18 19 #include "user_idm_callback_stub.h" 20 21 #include "iam_hitrace_helper.h" 22 #include "user_idm_client_callback.h" 23 24 namespace OHOS { 25 namespace UserIam { 26 namespace UserAuth { 27 class IdmCallbackService : public IdmCallbackStub { 28 public: 29 explicit IdmCallbackService(const std::shared_ptr<UserIdmClientCallback> &impl); 30 ~IdmCallbackService() override = default; 31 void OnResult(int32_t result, const Attributes &extraInfo) override; 32 void OnAcquireInfo(int32_t module, int32_t acquireInfo, const Attributes &extraInfo) override; 33 34 private: 35 std::shared_ptr<UserIdmClientCallback> idmClientCallback_ {nullptr}; 36 std::shared_ptr<UserIam::UserAuth::IamHitraceHelper> iamHitraceHelper_ {nullptr}; 37 }; 38 39 class IdmGetCredInfoCallbackService : public IdmGetCredInfoCallbackStub { 40 public: 41 explicit IdmGetCredInfoCallbackService(const std::shared_ptr<GetCredentialInfoCallback> &impl); 42 ~IdmGetCredInfoCallbackService() override = default; 43 void OnCredentialInfos(const std::vector<std::shared_ptr<CredentialInfo>> infoList, 44 const std::optional<PinSubType> pinSubType) override; 45 46 private: 47 std::shared_ptr<GetCredentialInfoCallback> getCredInfoCallback_ {nullptr}; 48 }; 49 50 class IdmGetSecureUserInfoCallbackService : public IdmGetSecureUserInfoCallbackStub { 51 public: 52 explicit IdmGetSecureUserInfoCallbackService(const std::shared_ptr<GetSecUserInfoCallback> &impl); 53 ~IdmGetSecureUserInfoCallbackService() override = default; 54 void OnSecureUserInfo(const std::shared_ptr<SecureUserInfo> info) override; 55 56 private: 57 std::shared_ptr<GetSecUserInfoCallback> getSecInfoCallback_ {nullptr}; 58 }; 59 } // namespace UserAuth 60 } // namespace UserIam 61 } // namespace OHOS 62 #endif // USER_IDM_CALLBACK_SERVICE_H