1 /* 2 * Copyright (c) 2021-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 #ifndef OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_OSACCOUNT_OS_ACCOUNT_DELETE_USER_IAM_CALLBACK_H 16 #define OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_OSACCOUNT_OS_ACCOUNT_DELETE_USER_IAM_CALLBACK_H 17 #ifdef HAS_USER_AUTH_PART 18 #include "user_idm_client_callback.h" 19 #include <mutex> 20 #include <thread> 21 #endif // HAS_USER_AUTH_PART 22 23 namespace OHOS { 24 namespace AccountSA { 25 #ifdef HAS_USER_AUTH_PART 26 class OsAccountDeleteUserIdmCallback : public OHOS::UserIam::UserAuth::UserIdmClientCallback { 27 public: OsAccountDeleteUserIdmCallback()28 OsAccountDeleteUserIdmCallback() {} ~OsAccountDeleteUserIdmCallback()29 virtual ~OsAccountDeleteUserIdmCallback() {} 30 /** 31 * @brief 32 * @param result . 33 * @param strcut reqRet . 34 * @return void. 35 */ 36 void OnResult(int32_t result, const UserIam::UserAuth::Attributes &extraInfo) override; 37 38 /** 39 * @brief 40 * @param module . 41 * @param acquire . 42 * @param reqRet . 43 * @return void. 44 */ 45 void OnAcquireInfo(int32_t module, uint32_t acquireInfo, const UserIam::UserAuth::Attributes &extraInfo) override; 46 47 public: 48 bool isIdmOnResultCallBack_ = false; 49 int32_t resultCode_ = -1; 50 std::mutex mutex_; 51 std::condition_variable onResultCondition_; 52 }; 53 #endif // HAS_USER_AUTH_PART 54 } // namespace AccountSA 55 } // namespace OHOS 56 57 #endif // OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_OSACCOUNT_OS_ACCOUNT_STOP_USER_CALLBACK_H 58