• 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 "pending_want_key.h"
17 #include "iremote_object.h"
18 
19 namespace OHOS {
20 namespace AAFwk {
SetType(const int32_t type)21 void PendingWantKey::SetType(const int32_t type)
22 {
23     type_ = type;
24 }
25 
SetBundleName(const std::string & bundleName)26 void PendingWantKey::SetBundleName(const std::string &bundleName)
27 {
28     bundleName_ = bundleName;
29 }
30 
SetRequestWho(const std::string & requestWho)31 void PendingWantKey::SetRequestWho(const std::string &requestWho)
32 {
33     requestWho_ = requestWho;
34 }
35 
SetRequestCode(int32_t requestCode)36 void PendingWantKey::SetRequestCode(int32_t requestCode)
37 {
38     requestCode_ = requestCode;
39 }
40 
SetRequestWant(const Want & requestWant)41 void PendingWantKey::SetRequestWant(const Want &requestWant)
42 {
43     requestWant_ = requestWant;
44 }
45 
SetRequestResolvedType(const std::string & requestResolvedType)46 void PendingWantKey::SetRequestResolvedType(const std::string &requestResolvedType)
47 {
48     requestResolvedType_ = requestResolvedType;
49 }
50 
SetAllWantsInfos(const std::vector<WantsInfo> & allWantsInfos)51 void PendingWantKey::SetAllWantsInfos(const std::vector<WantsInfo> &allWantsInfos)
52 {
53     std::lock_guard<std::mutex> lock(wantsInfosMutex_);
54     allWantsInfos_ = allWantsInfos;
55 }
56 
SetFlags(int32_t flags)57 void PendingWantKey::SetFlags(int32_t flags)
58 {
59     flags_ = flags;
60 }
61 
SetCode(int32_t code)62 void PendingWantKey::SetCode(int32_t code)
63 {
64     code_ = code;
65 }
66 
SetUserId(int32_t userId)67 void PendingWantKey::SetUserId(int32_t userId)
68 {
69     userId_ = userId;
70 }
71 
GetType()72 int32_t PendingWantKey::GetType()
73 {
74     return type_;
75 }
76 
GetBundleName()77 std::string PendingWantKey::GetBundleName()
78 {
79     return bundleName_;
80 }
81 
GetRequestWho()82 std::string PendingWantKey::GetRequestWho()
83 {
84     return requestWho_;
85 }
86 
GetRequestCode()87 int32_t PendingWantKey::GetRequestCode()
88 {
89     return requestCode_;
90 }
91 
GetRequestWant()92 Want PendingWantKey::GetRequestWant()
93 {
94     return requestWant_;
95 }
96 
GetRequestWantRef()97 Want& PendingWantKey::GetRequestWantRef()
98 {
99     return requestWant_;
100 }
101 
GetRequestResolvedType()102 std::string PendingWantKey::GetRequestResolvedType()
103 {
104     return requestResolvedType_;
105 }
106 
GetAllWantsInfos()107 std::vector<WantsInfo> PendingWantKey::GetAllWantsInfos()
108 {
109     std::lock_guard<std::mutex> lock(wantsInfosMutex_);
110     return allWantsInfos_;
111 }
112 
GetFlags()113 int32_t PendingWantKey::GetFlags()
114 {
115     return flags_;
116 }
117 
GetCode()118 int32_t PendingWantKey::GetCode()
119 {
120     return code_;
121 }
122 
GetUserId()123 int32_t PendingWantKey::GetUserId()
124 {
125     return userId_;
126 }
127 }  // namespace AAFwk
128 }  // namespace OHOS
129