1 /*
2 * Copyright (c) 2024 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 #include "report_statistics_task.h"
16
17 #include "parameters.h"
18 #include "utils_log.h"
19
20 namespace OHOS {
21 namespace FileManagement {
22 namespace CloudSync {
ReportStatisticsTask(std::shared_ptr<CloudFile::DataSyncManager> dataSyncManager)23 ReportStatisticsTask::ReportStatisticsTask(std::shared_ptr<CloudFile::DataSyncManager> dataSyncManager)
24 : CycleTask("report_statistics_task", {"com.ohos.photos"}, ONE_DAY, dataSyncManager)
25 {
26 }
27
RunTaskForBundle(int32_t userId,std::string bundleName)28 int32_t ReportStatisticsTask::RunTaskForBundle(int32_t userId, std::string bundleName)
29 {
30 int32_t ret = dataSyncManager_->ReportEntry(bundleName, userId);
31 if (ret != E_OK) {
32 LOGE("report failed");
33 }
34 return ret;
35 }
36 } // namespace CloudSync
37 } // namespace FileManagement
38 } // namespace OHOS