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 FOUNDATION_RESOURCESCHEDULE_BACKGROUND_TASK_MGR_SERVICES_COMMON_REPORT_HISYSTEM_DATA_H 17 #define FOUNDATION_RESOURCESCHEDULE_BACKGROUND_TASK_MGR_SERVICES_COMMON_REPORT_HISYSTEM_DATA_H 18 19 #include <string> 20 21 #include "efficiency_resource_info.h" 22 #include "resource_callback_info.h" 23 #include "resources_subscriber_mgr.h" 24 25 namespace OHOS { 26 namespace BackgroundTaskMgr { 27 const int32_t MAX_EFFICIENTCY_RESOURCE_HISYSEVCENT_DATA_LENGTH = 20; 28 29 struct EfficiencyResourceApplyReportHisysEvent { 30 int32_t length_ {0}; 31 std::vector<int32_t> appUid_ {}; 32 std::vector<int32_t> appPid_ {}; 33 std::vector<std::string> appName_ {}; 34 std::vector<int32_t> uiabilityIdentity_ {}; 35 std::vector<int32_t> resourceType_ {}; 36 std::vector<int64_t> timeout_ {}; 37 std::vector<bool> persist_ {}; 38 std::vector<bool> process_ {}; 39 EfficiencyResourceApplyReportHisysEvent() = default; 40 41 bool AddData(const sptr<EfficiencyResourceInfo> &resourceInfo, 42 const std::shared_ptr<ResourceCallbackInfo> &callbackInfo); 43 44 void ClearData(); 45 }; 46 47 struct EfficiencyResourceResetReportHisysEvent { 48 int32_t length_ {0}; 49 std::vector<int32_t> appUid_ {}; 50 std::vector<int32_t> appPid_ {}; 51 std::vector<std::string> appName_ {}; 52 std::vector<int32_t> uiabilityIdentity_ {}; 53 std::vector<int32_t> resourceType_ {}; 54 std::vector<bool> process_ {}; 55 std::vector<int64_t> quota_ {}; 56 std::vector<int64_t> allQuota_ {}; 57 EfficiencyResourceResetReportHisysEvent() = default; 58 59 bool AddData(const std::shared_ptr<ResourceCallbackInfo> &callbackInfo, 60 EfficiencyResourcesEventType type); 61 62 void ClearData(); 63 }; 64 65 } // namespace BackgroundTaskMgr 66 } // namespace OHOS 67 #endif // FOUNDATION_RESOURCESCHEDULE_BACKGROUND_TASK_MGR_INTERFACES_INNERKITS_INCLUDE_CONTINUOUS_TASK_PARAMS_H