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 auto sessionMgr = AppAccountAuthenticatorSessionManager::GetInstance();
33 if (sessionMgr != nullptr) {
34 sessionMgr->OnSessionResult(sessionId_, resultCode, result);
35 }
36 }
37
OnRequestRedirected(AAFwk::Want & request)38 void AppAccountAuthenticatorCallback::OnRequestRedirected(AAFwk::Want &request)
39 {
40 auto sessionMgr = AppAccountAuthenticatorSessionManager::GetInstance();
41 if (sessionMgr != nullptr) {
42 sessionMgr->OnSessionRequestRedirected(sessionId_, request);
43 }
44 }
45
OnRequestContinued()46 void AppAccountAuthenticatorCallback::OnRequestContinued()
47 {
48 auto sessionMgr = AppAccountAuthenticatorSessionManager::GetInstance();
49 if (sessionMgr != nullptr) {
50 sessionMgr->OnSessionRequestContinued(sessionId_);
51 }
52 }
53 } // namespace AccountSA
54 } // namespace OHOS
55