• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 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 "distributed_local_config.h"
17 
18 
19 namespace OHOS {
20 namespace Notification {
21 
GetInstance()22 DistributedLocalConfig& DistributedLocalConfig::GetInstance()
23 {
24     static DistributedLocalConfig distributedLocalConfig;
25     return distributedLocalConfig;
26 }
27 
SetLocalDevice(const DistributedDeviceConfig config)28 void DistributedLocalConfig::SetLocalDevice(const DistributedDeviceConfig config)
29 {
30     localConfig_ = config;
31 }
32 
GetTitleLength() const33 int32_t DistributedLocalConfig::GetTitleLength() const
34 {
35     return localConfig_.maxTitleLength;
36 }
37 
GetContentLength() const38 int32_t DistributedLocalConfig::GetContentLength() const
39 {
40     return localConfig_.maxContentLength;
41 }
42 
GetStartAbilityTimeout() const43 uint32_t DistributedLocalConfig::GetStartAbilityTimeout() const
44 {
45     return localConfig_.startAbilityTimeout;
46 }
47 
GetCollaborativeDeleteTypes() const48 std::unordered_set<std::string> DistributedLocalConfig::GetCollaborativeDeleteTypes() const
49 {
50     return localConfig_.collaborativeDeleteTypes;
51 }
52 
GetCollaborativeDeleteTypesByDevices(std::map<std::string,std::map<std::string,std::unordered_set<std::string>>> & config) const53 void DistributedLocalConfig::GetCollaborativeDeleteTypesByDevices(
54     std::map<std::string, std::map<std::string, std::unordered_set<std::string>>>& config) const
55 {
56     config =  localConfig_.collaborativeDeleteTypesByDevice;
57 }
58 }
59 }
60