122c0b7e4Sopenharmony_ci# Copyright (c) 2022  Huawei Device Co., Ltd.
222c0b7e4Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
322c0b7e4Sopenharmony_ci# you may not use this file except in compliance with the License.
422c0b7e4Sopenharmony_ci# You may obtain a copy of the License at
522c0b7e4Sopenharmony_ci#
622c0b7e4Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
722c0b7e4Sopenharmony_ci#
822c0b7e4Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
922c0b7e4Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1022c0b7e4Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1122c0b7e4Sopenharmony_ci# See the License for the specific language governing permissions and
1222c0b7e4Sopenharmony_ci# limitations under the License.
1322c0b7e4Sopenharmony_ci
1422c0b7e4Sopenharmony_ciimport("//build/ohos.gni")
1522c0b7e4Sopenharmony_ci
1622c0b7e4Sopenharmony_cidevice_usage_statistics_part_name = "device_usage_statistics"
1722c0b7e4Sopenharmony_ci
1822c0b7e4Sopenharmony_ciusage_statistics_path = "//foundation/resourceschedule/device_usage_statistics"
1922c0b7e4Sopenharmony_ci
2022c0b7e4Sopenharmony_ciif (!defined(global_parts_info) ||
2122c0b7e4Sopenharmony_ci    defined(global_parts_info.account_os_account)) {
2222c0b7e4Sopenharmony_ci  os_account_part_enabled = true
2322c0b7e4Sopenharmony_ci} else {
2422c0b7e4Sopenharmony_ci  os_account_part_enabled = false
2522c0b7e4Sopenharmony_ci}
2622c0b7e4Sopenharmony_cidevice_usage_statistics_with_powermgr_power_manager_enable = true
2722c0b7e4Sopenharmony_ciif (defined(global_parts_info) &&
2822c0b7e4Sopenharmony_ci    !defined(global_parts_info.powermgr_power_manager)) {
2922c0b7e4Sopenharmony_ci  device_usage_statistics_with_powermgr_power_manager_enable = false
3022c0b7e4Sopenharmony_ci}
3122c0b7e4Sopenharmony_ci
3222c0b7e4Sopenharmony_cideclare_args() {
3322c0b7e4Sopenharmony_ci  bgtaskmgr_enable = true
3422c0b7e4Sopenharmony_ci  device_usage_statistics_device_enable = true
3522c0b7e4Sopenharmony_ci  if (defined(global_parts_info) &&
3622c0b7e4Sopenharmony_ci      !defined(global_parts_info.resourceschedule_background_task_mgr)) {
3722c0b7e4Sopenharmony_ci    bgtaskmgr_enable = false
3822c0b7e4Sopenharmony_ci  }
3922c0b7e4Sopenharmony_ci}
40