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