1 /*
2  * Copyright (c) 2021-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 #include "ability_local_record.h"
17 
18 #include "ability_thread.h"
19 
20 namespace OHOS {
21 namespace AppExecFwk {
AbilityLocalRecord(const std::shared_ptr<AbilityInfo> & info,const sptr<IRemoteObject> & token)22 AbilityLocalRecord::AbilityLocalRecord(const std::shared_ptr<AbilityInfo> &info, const sptr<IRemoteObject> &token)
23     : abilityInfo_(info), token_(token) {}
24 
~AbilityLocalRecord()25 AbilityLocalRecord::~AbilityLocalRecord() {}
26 
GetAbilityInfo()27 const std::shared_ptr<AbilityInfo> &AbilityLocalRecord::GetAbilityInfo()
28 {
29     return abilityInfo_;
30 }
31 
GetEventHandler()32 const std::shared_ptr<EventHandler> &AbilityLocalRecord::GetEventHandler()
33 {
34     return handler_;
35 }
36 
SetEventHandler(const std::shared_ptr<EventHandler> & handler)37 void AbilityLocalRecord::SetEventHandler(const std::shared_ptr<EventHandler> &handler)
38 {
39     handler_ = handler;
40 }
41 
GetEventRunner()42 const std::shared_ptr<EventRunner> &AbilityLocalRecord::GetEventRunner()
43 {
44     return runner_;
45 }
46 
SetEventRunner(const std::shared_ptr<EventRunner> & runner)47 void AbilityLocalRecord::SetEventRunner(const std::shared_ptr<EventRunner> &runner)
48 {
49     runner_ = runner;
50 }
51 
GetToken()52 const sptr<IRemoteObject> &AbilityLocalRecord::GetToken()
53 {
54     return token_;
55 }
56 
GetAbilityThread()57 const sptr<AbilityThread> &AbilityLocalRecord::GetAbilityThread()
58 {
59     return abilityThread_;
60 }
61 
SetAbilityThread(const sptr<AbilityThread> & abilityThread)62 void AbilityLocalRecord::SetAbilityThread(const sptr<AbilityThread> &abilityThread)
63 {
64     abilityThread_ = abilityThread;
65 }
66 
SetWant(const std::shared_ptr<AAFwk::Want> & want)67 void AbilityLocalRecord::SetWant(const std::shared_ptr<AAFwk::Want> &want)
68 {
69     want_ = want;
70 }
71 
GetWant()72 const std::shared_ptr<AAFwk::Want> &AbilityLocalRecord::GetWant()
73 {
74     return want_;
75 }
76 }  // namespace AppExecFwk
77 }  // namespace OHOS
78