• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 #ifndef BASE_NOTIFICATION_ANS_STANDARD_INNERKITS_BASE_INCLUDE_ANS_CONST_DEFINE_H
17 #define BASE_NOTIFICATION_ANS_STANDARD_INNERKITS_BASE_INCLUDE_ANS_CONST_DEFINE_H
18 
19 #include <vector>
20 
21 #include "uri.h"
22 
23 #include "notification_constant.h"
24 
25 namespace OHOS {
26 namespace Notification {
27 // Max active notification number
28 constexpr size_t MAX_ACTIVE_NUM = 1000;
29 constexpr uint32_t MAX_ACTIVE_NUM_PERAPP = 100;
30 constexpr uint32_t MAX_CREATE_NUM_PERSECOND = 15;
31 constexpr uint32_t MAX_UPDATE_NUM_PERSECOND = 30;
32 constexpr uint32_t MAX_CREATE_NUM_PERSECOND_PERAPP = 10;
33 constexpr uint32_t MAX_UPDATE_NUM_PERSECOND_PERAPP = 20;
34 constexpr std::chrono::seconds CALLER_FLOW_CONTRL_EXPIRE_TIME = std::chrono::seconds(1);
35 constexpr size_t MAX_SLOT_NUM = 5;
36 constexpr uint32_t MAX_ICON_SIZE = 192 * 1024;
37 constexpr uint32_t MAX_PICTURE_SIZE = 2 * 1024 * 1024;
38 constexpr uint32_t MAX_LIVE_VIEW_ICON_NUM = 11;
39 constexpr bool SUPPORT_DO_NOT_DISTRUB = true;
40 constexpr uint32_t SYSTEM_SERVICE_UID = 1000;
41 constexpr uint32_t MAX_CONVERSATIONAL_NUM = 10000;
42 constexpr uint32_t MAX_PERMIT_MIME_TYPE_NUM = 10000;
43 constexpr uint32_t MAX_ACTION_BUTTON_NUM = 3;
44 constexpr int32_t MAX_PARCELABLE_VECTOR_NUM = 10000;
45 constexpr int32_t MAX_STATUS_VECTOR_NUM = 1000;
46 constexpr uint32_t MAX_CANCELED_PARCELABLE_VECTOR_NUM = 200;
47 
48 constexpr int32_t DEFAULT_UID = 0;
49 constexpr int32_t INVALID_USER_ID = -1;
50 constexpr int64_t INVALID_PROFILE_ID = -1;
51 constexpr int32_t SUBSCRIBE_USER_INIT = -1;
52 constexpr int32_t SUBSCRIBE_USER_ALL = -2;
53 constexpr int32_t DEFAULT_USER_ID = 100;
54 constexpr int32_t ZERO_USERID = 0;
55 constexpr int32_t SUBSCRIBE_USER_SYSTEM_BEGIN = 0;
56 constexpr int32_t SUBSCRIBE_USER_SYSTEM_END = 99;
57 constexpr int32_t NOTIFICATION_MIN_COUNT = 0;
58 constexpr int32_t NOTIFICATION_MAX_COUNT = 1024;
59 constexpr int32_t DO_NOT_DISTURB_PROFILE_MIN_ID = 1;
60 constexpr int32_t DO_NOT_DISTURB_PROFILE_MAX_ID = 10;
61 
62 // Default sound for notification
63 const static Uri DEFAULT_NOTIFICATION_SOUND("file://system/etc/Light.ogg");
64 const static std::vector<int64_t> DEFAULT_NOTIFICATION_VIBRATION = {200};
65 
66 // Default path for template
67 const static std::string DEFAULT_TEMPLATE_PATH("/system/etc/notification_template/external.json");
68 const std::string CURRENT_DEVICE_TYPE = "current";
69 const std::string RING_TRUST_PKG_KEY = "RING_TRUSTLIST_PKG";
70 const std::string DOWNLOAD_TEMPLATE_NAME = "downloadTemplate";
71 
72 const std::string DEVICE_TYPE_WEARABLE = "wearable";
73 const std::string DEVICE_TYPE_LITE_WEARABLE = "liteWearable";
74 const std::string DEVICE_TYPE_HEADSET = "headset";
75 const std::string ANS_EXTENDINFO_INFO_PRE = "notification_collaboration_";
76 const std::string ANS_EXTENDINFO_DEVICE_ID = "deviceId";
77 
78 #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED
79 constexpr NotificationConstant::DistributedReminderPolicy DEFAULT_DISTRIBUTED_REMINDER_POLICY =
80     NotificationConstant::DistributedReminderPolicy::DEFAULT;
81 constexpr bool DEFAULT_DISTRIBUTED_ENABLE_IN_APPLICATION_INFO = false;
82 #endif
83 }  // namespace Notification
84 }  // namespace OHOS
85 
86 #endif  // BASE_NOTIFICATION_ANS_STANDARD_INNERKITS_BASE_INCLUDE_ANS_CONST_DEFINE_H
87