1 /* 2 * Copyright (c) 2023 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 OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_APPACCOUNT_APP_ACCOUNT_AUTHORIZATION_EXTENSION_SERVICE_H 17 #define OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_APPACCOUNT_APP_ACCOUNT_AUTHORIZATION_EXTENSION_SERVICE_H 18 19 #include <string> 20 #include "account_error_no.h" 21 #include "app_account_common.h" 22 #include "app_account_authorization_extension_callback_client.h" 23 #include "app_account_authorization_extension_stub.h" 24 #include "want.h" 25 26 namespace OHOS { 27 namespace AccountSA { 28 using AuthorizationExtensionServiceFunc = std::function<void(const AccountSA::AuthorizationRequest &, 29 const std::shared_ptr<AccountSA::AppAccountAuthorizationExtensionCallbackClient> &)>; 30 31 class AppAccountAuthorizationExtensionService : public AppAccountAuthorizationExtensionStub { 32 public: 33 AppAccountAuthorizationExtensionService(const AuthorizationExtensionServiceFunc &func); 34 ~AppAccountAuthorizationExtensionService() override; 35 ErrCode StartAuthorization(const AuthorizationRequest &request) override; 36 37 private: 38 AuthorizationExtensionServiceFunc func_; 39 DISALLOW_COPY_AND_MOVE(AppAccountAuthorizationExtensionService); 40 }; 41 } // namespace AccountSA 42 } // namespace OHOS 43 #endif // OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_APPACCOUNT_APP_ACCOUNT_AUTHORIZATION_EXTENSION_SERVICE_H 44