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 #include "app_account_authenticator_callback.h"
17 
18 #include "account_log_wrapper.h"
19 #include "app_account_authenticator_session.h"
20 
21 namespace OHOS {
22 namespace AccountSA {
AppAccountAuthenticatorCallback(const std::string & sessionId)23 AppAccountAuthenticatorCallback::AppAccountAuthenticatorCallback(const std::string &sessionId)
24     : sessionId_(sessionId)
25 {}
26 
~AppAccountAuthenticatorCallback()27 AppAccountAuthenticatorCallback::~AppAccountAuthenticatorCallback()
28 {}
29 
OnResult(int32_t resultCode,const AAFwk::Want & result)30 void AppAccountAuthenticatorCallback::OnResult(int32_t resultCode, const AAFwk::Want &result)
31 {
32     AppAccountAuthenticatorSessionManager::GetInstance().OnSessionResult(sessionId_, resultCode, result);
33 }
34 
OnRequestRedirected(AAFwk::Want & request)35 void AppAccountAuthenticatorCallback::OnRequestRedirected(AAFwk::Want &request)
36 {
37     AppAccountAuthenticatorSessionManager::GetInstance().OnSessionRequestRedirected(sessionId_, request);
38 }
39 
OnRequestContinued()40 void AppAccountAuthenticatorCallback::OnRequestContinued()
41 {
42     AppAccountAuthenticatorSessionManager::GetInstance().OnSessionRequestContinued(sessionId_);
43 }
44 }  // namespace AccountSA
45 }  // namespace OHOS
46