1 /* 2 * Copyright (c) 2022 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 OHOS_WINDOW_MANAGER_RESSCHED_REPORT_H 17 #define OHOS_WINDOW_MANAGER_RESSCHED_REPORT_H 18 19 #include <cstdint> 20 #include <string> 21 #include <unordered_map> 22 #ifdef RESOURCE_SCHEDULE_SERVICE_ENABLE 23 #include "res_sched_client.h" 24 #endif 25 26 namespace OHOS::Rosen { 27 constexpr uint32_t RES_TYPE_SHOW_REMOTE_ANIMATION = 33; 28 constexpr int32_t REMOTE_ANIMATION_BEGIN = 0; 29 constexpr int32_t REMOTE_ANIMATION_END = 1; 30 class ResSchedReport final { 31 public: GetInstance()32 static ResSchedReport& GetInstance() 33 { 34 static ResSchedReport instance; 35 return instance; 36 } 37 void ResSchedDataReport(uint32_t resType, int32_t value = 0, 38 const std::unordered_map<std::string, std::string>& payload = {}) 39 { 40 #ifdef RESOURCE_SCHEDULE_SERVICE_ENABLE 41 OHOS::ResourceSchedule::ResSchedClient::GetInstance().ReportData(resType, value, payload); 42 #endif 43 } 44 private: ResSchedReport()45 ResSchedReport() {} ~ResSchedReport()46 ~ResSchedReport() {} 47 }; 48 } // namespace OHOS::Rosen 49 #endif // OHOS_WINDOW_MANAGER_RESSCHED_REPORT_H