• 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 #ifndef UI_APPEARANCE_BACKGROUND_APP_COLOR_SWICH_SETTINGS_H
17 #define UI_APPEARANCE_BACKGROUND_APP_COLOR_SWICH_SETTINGS_H
18 
19 #include <mutex>
20 #include <list>
21 
22 #include "errors.h"
23 #include "nocopyable.h"
24 
25 namespace OHOS::ArkUi::UiAppearance {
26 class BackGroundAppColorSwitchSettings final : public NoCopyable {
27 public:
28     static BackGroundAppColorSwitchSettings& GetInstance();
29 
30     bool IsSupportHotUpdate();
31 
32     ErrCode Initialize();
33 
34     void Reset();
35 
36     int32_t GetTaskQuantity();
37 
38     int32_t GetDurationMillisecond();
39 
40     bool CheckInWhileList(const std::string& bundleName);
41 
42     std::list<std::string> GetWhileList();
43 private:
44     std::mutex policyMutex_;
45     bool isAllowListEnable_ = false;
46 
47     std::list<std::string> allowList_;
48     int32_t taskQuantity_ = -1;
49     int32_t durationMillisecond_ = -1;
50 };
51 } // namespace OHOS::ArkUi::UiAppearance
52 
53 #endif // UI_APPEARANCE_UPDATE_POLICY_MANAGER_H
54