122c0b7e4Sopenharmony_ci/*
222c0b7e4Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
322c0b7e4Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
422c0b7e4Sopenharmony_ci * you may not use this file except in compliance with the License.
522c0b7e4Sopenharmony_ci * You may obtain a copy of the License at
622c0b7e4Sopenharmony_ci *
722c0b7e4Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
822c0b7e4Sopenharmony_ci *
922c0b7e4Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1022c0b7e4Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1122c0b7e4Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1222c0b7e4Sopenharmony_ci * See the License for the specific language governing permissions and
1322c0b7e4Sopenharmony_ci * limitations under the License.
1422c0b7e4Sopenharmony_ci */
1522c0b7e4Sopenharmony_ci
1622c0b7e4Sopenharmony_ci#ifndef BUNDLE_ACTIVE_GROUP_UTIL_H
1722c0b7e4Sopenharmony_ci#define BUNDLE_ACTIVE_GROUP_UTIL_H
1822c0b7e4Sopenharmony_ci
1922c0b7e4Sopenharmony_ci#include <string>
2022c0b7e4Sopenharmony_cinamespace OHOS {
2122c0b7e4Sopenharmony_cinamespace DeviceUsageStats {
2222c0b7e4Sopenharmony_ciclass BundleActiveUtil {
2322c0b7e4Sopenharmony_cipublic:
2422c0b7e4Sopenharmony_ci    BundleActiveUtil() = delete;
2522c0b7e4Sopenharmony_ci    ~BundleActiveUtil() = delete;
2622c0b7e4Sopenharmony_ci    static constexpr int32_t PERIOD_DAILY = 0;
2722c0b7e4Sopenharmony_ci    static constexpr int32_t PERIOD_WEEKLY = 1;
2822c0b7e4Sopenharmony_ci    static constexpr int32_t PERIOD_MONTHLY = 2;
2922c0b7e4Sopenharmony_ci    static constexpr int32_t PERIOD_YEARLY = 3;
3022c0b7e4Sopenharmony_ci    static std::string GetBundleUsageKey(const std::string& bundleName, const int32_t uid);
3122c0b7e4Sopenharmony_ci    static int64_t GetFFRTDelayTime(const int64_t& delayTime);
3222c0b7e4Sopenharmony_ci    static int64_t GetIntervalTypeStartTime(const int64_t& timeStamp, const int32_t& intervalType);
3322c0b7e4Sopenharmony_ci};
3422c0b7e4Sopenharmony_ci}  // namespace DeviceUsageStats
3522c0b7e4Sopenharmony_ci}  // namespace OHOS
3622c0b7e4Sopenharmony_ci#endif  // BUNDLE_ACTIVE_GROUP_UTIL_H
3722c0b7e4Sopenharmony_ci
38