• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 "manage_keep_alive_apps_info.h"
17 #include "parcel_macro.h"
18 #include "edm_log.h"
19 
20 namespace OHOS {
21 namespace EDM {
Marshalling(MessageParcel & parcel) const22 bool ManageKeepAliveAppInfo::Marshalling(MessageParcel &parcel) const
23 {
24     WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, bundleName_);
25     WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Bool, parcel, disallowModify_);
26     return true;
27 }
28 
Unmarshalling(MessageParcel & parcel,ManageKeepAliveAppInfo & appInfo)29 bool ManageKeepAliveAppInfo::Unmarshalling(MessageParcel &parcel, ManageKeepAliveAppInfo &appInfo)
30 {
31     std::string bundleName = parcel.ReadString();
32     bool disallowModify = parcel.ReadBool();
33     appInfo.SetBundleName(bundleName);
34     appInfo.SetDisallowModify(disallowModify);
35     return true;
36 }
37 
SetBundleName(std::string bundleName)38 void ManageKeepAliveAppInfo::SetBundleName(std::string bundleName)
39 {
40     bundleName_ = bundleName;
41 }
42 
SetDisallowModify(bool disallowModify)43 void ManageKeepAliveAppInfo::SetDisallowModify(bool disallowModify)
44 {
45     disallowModify_ = disallowModify;
46 }
47 
GetBundleName() const48 std::string ManageKeepAliveAppInfo::GetBundleName() const
49 {
50     return bundleName_;
51 }
52 
GetDisallowModify() const53 bool ManageKeepAliveAppInfo::GetDisallowModify() const
54 {
55     return disallowModify_;
56 }
57 } // namespace EDM
58 } // namespace OHOS