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 #include "res_helper.h"
17
18 #include "hilog_tag_wrapper.h"
19 #ifdef RESOURCE_SCHEDULE_SERVICE_ENABLE
20 #include "res_sched_client.h"
21 #include "res_type.h"
22 #endif
23
24 namespace OHOS {
25 namespace AppExecFwk {
ReportLoadAbcCompletedInfoToRss(int32_t uid,int32_t pid,const std::string & bundleName)26 void ResHelper::ReportLoadAbcCompletedInfoToRss(int32_t uid, int32_t pid, const std::string &bundleName)
27 {
28 #ifdef RESOURCE_SCHEDULE_SERVICE_ENABLE
29 uint32_t resType = ResourceSchedule::ResType::RES_TYPE_RECV_ABC_LOAD_COMPLETED;
30 std::unordered_map<std::string, std::string> eventParams {
31 { "name", "abc_load_completed" },
32 { "uid", std::to_string(uid) },
33 { "pid", std::to_string(pid) },
34 { "bundleName", bundleName }
35 };
36 bool isColdStart = true;
37 TAG_LOGD(AAFwkTag::APPKIT, "report load abc completed info to rss.");
38 ResourceSchedule::ResSchedClient::GetInstance().ReportData(resType, isColdStart, eventParams);
39 #endif
40 }
41 } // namespace AppExecFwk
42 } // namespace OHOS
43