From 046415a08d8b73ed0ffcee8c6afee04ddc1474e6 Mon Sep 17 00:00:00 2001 From: houdisheng Date: Thu, 10 Nov 2022 15:06:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?reviewbot=E5=91=8A=E8=AD=A6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=90=8C=E6=AD=A5monthly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- frameworks/src/app_group_observer_napi.cpp | 2 +- .../src/bundle_active_app_group_napi.cpp | 8 +++---- frameworks/src/bundle_state_common.cpp | 24 +++++++++---------- frameworks/src/bundle_state_query.cpp | 12 +++++----- frameworks/src/bundle_state_query_napi.cpp | 14 +++++------ .../include/app_group_callback_proxy.h | 4 ++-- .../include/app_group_callback_stub.h | 4 ++-- .../napi/include/app_group_observer_napi.h | 2 +- .../napi/include/bundle_state_condition.h | 2 -- .../napi/include/bundle_state_init.h | 2 +- .../bundle_active_continuous_task_observer.h | 6 ++--- ...undle_active_power_state_callback_stub.cpp | 2 +- .../src/bundle_active_usage_database.cpp | 8 +++---- .../include/bundle_active_calendar.h | 2 +- .../include/bundle_active_event_stats.h | 2 +- .../include/bundle_active_form_record.h | 2 +- .../include/bundle_active_module_record.h | 2 +- 17 files changed, 48 insertions(+), 50 deletions(-) diff --git a/frameworks/src/app_group_observer_napi.cpp b/frameworks/src/app_group_observer_napi.cpp index 028b50d..f9ab0c1 100644 --- a/frameworks/src/app_group_observer_napi.cpp +++ b/frameworks/src/app_group_observer_napi.cpp @@ -157,7 +157,7 @@ void AppGroupObserver::OnAppGroupChanged(const AppGroupCallbackInfo &appGroupCal callbackReceiveDataWorker->ref = bundleGroupCallbackInfo_.ref; delete callBackInfo; - work->data = (void *)callbackReceiveDataWorker; + work->data = static_cast(callbackReceiveDataWorker); int ret = uv_queue_work(loop, work, [](uv_work_t *work) {}, UvQueueWorkOnAppGroupChanged); if (ret != 0) { delete callbackReceiveDataWorker; diff --git a/frameworks/src/bundle_active_app_group_napi.cpp b/frameworks/src/bundle_active_app_group_napi.cpp index cff62f5..8fbdb5c 100644 --- a/frameworks/src/bundle_active_app_group_napi.cpp +++ b/frameworks/src/bundle_active_app_group_napi.cpp @@ -133,7 +133,7 @@ napi_value QueryAppGroup(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -242,7 +242,7 @@ napi_value SetAppGroup(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -347,7 +347,7 @@ napi_value RegisterAppGroupCallBack(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -427,7 +427,7 @@ napi_value UnRegisterAppGroupCallBack(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { diff --git a/frameworks/src/bundle_state_common.cpp b/frameworks/src/bundle_state_common.cpp index 5c486ca..065d9ee 100644 --- a/frameworks/src/bundle_state_common.cpp +++ b/frameworks/src/bundle_state_common.cpp @@ -245,45 +245,45 @@ void BundleStateCommon::GetBundleStateInfoForResult(napi_env env, } void BundleStateCommon::GetModuleRecordBasicForResult(napi_env env, - const BundleActiveModuleRecord &oneModuleRecord, napi_value moduleObject) + const BundleActiveModuleRecord &moduleRecords, napi_value moduleObject) { napi_value bundleName = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_string_utf8(env, oneModuleRecord.bundleName_.c_str(), + NAPI_CALL_RETURN_VOID(env, napi_create_string_utf8(env, moduleRecords.bundleName_.c_str(), NAPI_AUTO_LENGTH, &bundleName)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "bundleName", bundleName)); napi_value appLabelId = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, oneModuleRecord.appLabelId_, &appLabelId)); + NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, moduleRecords.appLabelId_, &appLabelId)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "appLabelId", appLabelId)); napi_value moduleName = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_string_utf8(env, oneModuleRecord.moduleName_.c_str(), NAPI_AUTO_LENGTH, + NAPI_CALL_RETURN_VOID(env, napi_create_string_utf8(env, moduleRecords.moduleName_.c_str(), NAPI_AUTO_LENGTH, &moduleName)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "moduleName", moduleName)); napi_value labelId = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, oneModuleRecord.labelId_, &labelId)); + NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, moduleRecords.labelId_, &labelId)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "labelId", labelId)); napi_value descriptionId = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, oneModuleRecord.descriptionId_, &descriptionId)); + NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, moduleRecords.descriptionId_, &descriptionId)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "descriptionId", descriptionId)); napi_value abilityName = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_string_utf8(env, oneModuleRecord.abilityName_.c_str(), NAPI_AUTO_LENGTH, + NAPI_CALL_RETURN_VOID(env, napi_create_string_utf8(env, moduleRecords.abilityName_.c_str(), NAPI_AUTO_LENGTH, &abilityName)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "abilityName", abilityName)); napi_value abilityLableId = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, oneModuleRecord.abilityLableId_, &abilityLableId)); + NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, moduleRecords.abilityLableId_, &abilityLableId)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "abilityLableId", abilityLableId)); napi_value abilityDescriptionId = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, oneModuleRecord.abilityDescriptionId_, + NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, moduleRecords.abilityDescriptionId_, &abilityDescriptionId)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "abilityDescriptionId", abilityDescriptionId)); napi_value abilityIconId = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, oneModuleRecord.abilityIconId_, &abilityIconId)); + NAPI_CALL_RETURN_VOID(env, napi_create_uint32(env, moduleRecords.abilityIconId_, &abilityIconId)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "abilityIconId", abilityIconId)); napi_value launchedCount = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, oneModuleRecord.launchedCount_, &launchedCount)); + NAPI_CALL_RETURN_VOID(env, napi_create_int32(env, moduleRecords.launchedCount_, &launchedCount)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "launchedCount", launchedCount)); napi_value lastModuleUsedTime = nullptr; - NAPI_CALL_RETURN_VOID(env, napi_create_int64(env, oneModuleRecord.lastModuleUsedTime_, &lastModuleUsedTime)); + NAPI_CALL_RETURN_VOID(env, napi_create_int64(env, moduleRecords.lastModuleUsedTime_, &lastModuleUsedTime)); NAPI_CALL_RETURN_VOID(env, napi_set_named_property(env, moduleObject, "lastModuleUsedTime", lastModuleUsedTime)); } diff --git a/frameworks/src/bundle_state_query.cpp b/frameworks/src/bundle_state_query.cpp index edb88d8..14778aa 100644 --- a/frameworks/src/bundle_state_query.cpp +++ b/frameworks/src/bundle_state_query.cpp @@ -117,7 +117,7 @@ napi_value IsIdleState(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -209,7 +209,7 @@ napi_value QueryAppUsagePriorityGroup(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -322,7 +322,7 @@ napi_value QueryCurrentBundleActiveStates(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -389,7 +389,7 @@ napi_value QueryBundleActiveStates(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -516,7 +516,7 @@ napi_value QueryBundleStateInfoByInterval(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -625,7 +625,7 @@ napi_value QueryBundleStateInfos(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { diff --git a/frameworks/src/bundle_state_query_napi.cpp b/frameworks/src/bundle_state_query_napi.cpp index e7e775d..23ec75c 100644 --- a/frameworks/src/bundle_state_query_napi.cpp +++ b/frameworks/src/bundle_state_query_napi.cpp @@ -139,7 +139,7 @@ napi_value QueryModuleUsageRecords(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -229,7 +229,7 @@ napi_value IsIdleState(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -336,7 +336,7 @@ napi_value QueryCurrentBundleEvents(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -392,7 +392,7 @@ napi_value QueryBundleEvents(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -508,7 +508,7 @@ napi_value QueryBundleStatsInfoByInterval(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -610,7 +610,7 @@ napi_value QueryBundleStatsInfos(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { @@ -766,7 +766,7 @@ napi_value QueryNotificationEventStats(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { diff --git a/interfaces/innerkits/include/app_group_callback_proxy.h b/interfaces/innerkits/include/app_group_callback_proxy.h index 2dcc8bd..1de0867 100644 --- a/interfaces/innerkits/include/app_group_callback_proxy.h +++ b/interfaces/innerkits/include/app_group_callback_proxy.h @@ -29,14 +29,14 @@ namespace DeviceUsageStats { class BundleActiveGroupCallbackProxy : public IRemoteProxy { public: explicit BundleActiveGroupCallbackProxy(const sptr& impl); - virtual ~BundleActiveGroupCallbackProxy() override; + ~BundleActiveGroupCallbackProxy() override; DISALLOW_COPY_AND_MOVE(BundleActiveGroupCallbackProxy); /* * function: OnAppGroupChanged, bundleGroupChanged callback, IPC proxy, send message to stub. * parameters: AppGroupCallbackInfo * return: void. */ - virtual void OnAppGroupChanged( + void OnAppGroupChanged( const AppGroupCallbackInfo& appGroupCallbackInfo) override; private: diff --git a/interfaces/innerkits/include/app_group_callback_stub.h b/interfaces/innerkits/include/app_group_callback_stub.h index 96d90b7..50272de 100644 --- a/interfaces/innerkits/include/app_group_callback_stub.h +++ b/interfaces/innerkits/include/app_group_callback_stub.h @@ -30,14 +30,14 @@ public: * parameters: code, data, reply, option * return: errorcode. */ - virtual int OnRemoteRequest( + int OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; /* * function: OnAppGroupChanged, bundleGroupChanged callback, handle message from proxy. * parameters: AppGroupCallbackInfo * return: void. */ - virtual void OnAppGroupChanged(const AppGroupCallbackInfo &appGroupCallbackInfo) override; + void OnAppGroupChanged(const AppGroupCallbackInfo &appGroupCallbackInfo) override; private: DISALLOW_COPY_AND_MOVE(AppGroupCallbackStub); }; diff --git a/interfaces/kits/bundlestats/napi/include/app_group_observer_napi.h b/interfaces/kits/bundlestats/napi/include/app_group_observer_napi.h index f895d67..6950448 100644 --- a/interfaces/kits/bundlestats/napi/include/app_group_observer_napi.h +++ b/interfaces/kits/bundlestats/napi/include/app_group_observer_napi.h @@ -30,7 +30,7 @@ public: ~AppGroupObserver(); - virtual void OnAppGroupChanged(const AppGroupCallbackInfo &appGroupCallbackInfo) override; + void OnAppGroupChanged(const AppGroupCallbackInfo &appGroupCallbackInfo) override; void SetCallbackInfo(const napi_env &env, const napi_ref &ref); diff --git a/interfaces/kits/bundlestats/napi/include/bundle_state_condition.h b/interfaces/kits/bundlestats/napi/include/bundle_state_condition.h index 86e0999..b281135 100644 --- a/interfaces/kits/bundlestats/napi/include/bundle_state_condition.h +++ b/interfaces/kits/bundlestats/napi/include/bundle_state_condition.h @@ -15,8 +15,6 @@ #ifndef FOUNDATION_RESOURCESCHEDULE_DEVICE_USAGE_STATISTICS_BUNDLE_STATE_CONDITION_H #define FOUNDATION_RESOURCESCHEDULE_DEVICE_USAGE_STATISTICS_BUNDLE_STATE_CONDITION_H -#include - namespace OHOS { namespace DeviceUsageStats { class BundleStateCondition { diff --git a/interfaces/kits/bundlestats/napi/include/bundle_state_init.h b/interfaces/kits/bundlestats/napi/include/bundle_state_init.h index 8e65667..cb34bc7 100644 --- a/interfaces/kits/bundlestats/napi/include/bundle_state_init.h +++ b/interfaces/kits/bundlestats/napi/include/bundle_state_init.h @@ -44,7 +44,7 @@ napi_module _module = { .nm_filename = nullptr, .nm_register_func = BundleStateInit, .nm_modname = "bundleState", - .nm_priv = ((void *)0), + .nm_priv = (static_cast(0)), .reserved = {0} }; } // namespace DeviceUsageStats diff --git a/services/common/include/bundle_active_continuous_task_observer.h b/services/common/include/bundle_active_continuous_task_observer.h index 4da1288..ca7f97e 100644 --- a/services/common/include/bundle_active_continuous_task_observer.h +++ b/services/common/include/bundle_active_continuous_task_observer.h @@ -33,11 +33,11 @@ namespace DeviceUsageStats { class BundleActiveContinuousTaskObserver : public OHOS::BackgroundTaskMgr::BackgroundTaskSubscriber { public: using IBundleMgr = OHOS::AppExecFwk::IBundleMgr; - virtual void OnContinuousTaskStart(const std::shared_ptr + void OnContinuousTaskStart(const std::shared_ptr &continuousTaskCallbackInfo) override; - virtual void OnContinuousTaskStop(const std::shared_ptr + void OnContinuousTaskStop(const std::shared_ptr &continuousTaskCallbackInfo) override; - virtual void OnRemoteDied(const wptr &object) override; + void OnRemoteDied(const wptr &object) override; void Init(const std::shared_ptr& reportHandler); std::atomic isRemoteDied_ {false}; private: diff --git a/services/common/src/bundle_active_power_state_callback_stub.cpp b/services/common/src/bundle_active_power_state_callback_stub.cpp index 6ec2ff1..7d344d2 100644 --- a/services/common/src/bundle_active_power_state_callback_stub.cpp +++ b/services/common/src/bundle_active_power_state_callback_stub.cpp @@ -23,7 +23,7 @@ int32_t BundleActivePowerStateCallbackStub::OnRemoteRequest(uint32_t code, Messa { std::u16string descriptor = BundleActivePowerStateCallbackStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); - PowerMgr::PowerState state = (PowerMgr::PowerState)data.ReadInt32(); + PowerMgr::PowerState state = static_cast(data.ReadInt32()); if (descriptor != remoteDescriptor) { BUNDLE_ACTIVE_LOGE("BundleActivePowerStateCallbackStub::OnRemoteRequest cannot get power mgr service"); return -1; diff --git a/services/common/src/bundle_active_usage_database.cpp b/services/common/src/bundle_active_usage_database.cpp index 9593b62..d739e91 100644 --- a/services/common/src/bundle_active_usage_database.cpp +++ b/services/common/src/bundle_active_usage_database.cpp @@ -1122,7 +1122,7 @@ void BundleActiveUsageDatabase::RemoveOldData(int64_t currentTime) } } -void BundleActiveUsageDatabase::RenewTableTime(int64_t changedTime) +void BundleActiveUsageDatabase::RenewTableTime(int64_t timeDiffMillis) { lock_guard lock(databaseMutex_); for (uint32_t i = 0; i < sortedTableArray_.size(); i++) { @@ -1131,7 +1131,7 @@ void BundleActiveUsageDatabase::RenewTableTime(int64_t changedTime) } vector tableArray = sortedTableArray_.at(i); for (uint32_t j = 0; j < tableArray.size(); j++) { - int64_t newTime = tableArray.at(j) + changedTime; + int64_t newTime = tableArray.at(j) + timeDiffMillis; BUNDLE_ACTIVE_LOGI("new table time is %{public}lld", (long long)newTime); if (newTime < 0) { DeleteInvalidTable(i, tableArray.at(j)); @@ -1145,7 +1145,7 @@ void BundleActiveUsageDatabase::RenewTableTime(int64_t changedTime) } if (eventTableName_ != UNKNOWN_TABLE_NAME) { int64_t oldTime = ParseStartTime(eventTableName_); - int64_t newTime = oldTime + changedTime; + int64_t newTime = oldTime + timeDiffMillis; if (newTime < 0) { int32_t deletedResult = DeleteInvalidTable(EVENT_DATABASE_INDEX, oldTime); if (deletedResult == BUNDLE_ACTIVE_SUCCESS) { @@ -1160,7 +1160,7 @@ void BundleActiveUsageDatabase::RenewTableTime(int64_t changedTime) } if (formRecordsTableName_ != UNKNOWN_TABLE_NAME && moduleRecordsTableName_ != UNKNOWN_TABLE_NAME) { int64_t oldTime = ParseStartTime(moduleRecordsTableName_); - int64_t newTime = oldTime + changedTime; + int64_t newTime = oldTime + timeDiffMillis; int32_t renamedResult = RenameTableName(APP_GROUP_DATABASE_INDEX, oldTime, newTime); if (renamedResult == BUNDLE_ACTIVE_SUCCESS) { moduleRecordsTableName_ = MODULE_RECORD_LOG_TABLE + to_string(newTime); diff --git a/services/packageusage/include/bundle_active_calendar.h b/services/packageusage/include/bundle_active_calendar.h index 41230b1..5f9aefe 100644 --- a/services/packageusage/include/bundle_active_calendar.h +++ b/services/packageusage/include/bundle_active_calendar.h @@ -16,7 +16,7 @@ #ifndef BUNDLE_ACTIVE_CALENDER_H #define BUNDLE_ACTIVE_CALENDER_H -#include +#include #include "bundle_active_constant.h" diff --git a/services/packageusage/include/bundle_active_event_stats.h b/services/packageusage/include/bundle_active_event_stats.h index 5b63239..a9b4949 100644 --- a/services/packageusage/include/bundle_active_event_stats.h +++ b/services/packageusage/include/bundle_active_event_stats.h @@ -83,7 +83,7 @@ public: * parameters: parcel * return: result of mashalling, true means successful, flase means failed. */ - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; /* * function: UnMarshalling, Unmashalling event stats object from parcel. diff --git a/services/packageusage/include/bundle_active_form_record.h b/services/packageusage/include/bundle_active_form_record.h index 57d0c1c..0155e04 100644 --- a/services/packageusage/include/bundle_active_form_record.h +++ b/services/packageusage/include/bundle_active_form_record.h @@ -86,7 +86,7 @@ public: * parameters: parcel * return: result of mashalling, true means successful, flase means failed. */ - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; /* * function: UnMarshalling, Unmashalling record object from parcel. * parameters: parcel diff --git a/services/packageusage/include/bundle_active_module_record.h b/services/packageusage/include/bundle_active_module_record.h index 0112a18..5146339 100644 --- a/services/packageusage/include/bundle_active_module_record.h +++ b/services/packageusage/include/bundle_active_module_record.h @@ -30,7 +30,7 @@ public: BundleActiveModuleRecord(); ~BundleActiveModuleRecord() {} static bool cmp(const BundleActiveModuleRecord& moduleRecordA, const BundleActiveModuleRecord& moduleRecordB); - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; std::shared_ptr UnMarshalling(Parcel &parcel); std::string ToString(); -- Gitee From 23a2875a4eb685582ff3aafd81245c4146660869 Mon Sep 17 00:00:00 2001 From: houdisheng Date: Thu, 10 Nov 2022 15:11:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?reviewbot=E5=91=8A=E8=AD=A6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=90=8C=E6=AD=A5monthly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- frameworks/src/bundle_state_query_napi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/src/bundle_state_query_napi.cpp b/frameworks/src/bundle_state_query_napi.cpp index 23ec75c..c44d6fd 100644 --- a/frameworks/src/bundle_state_query_napi.cpp +++ b/frameworks/src/bundle_state_query_napi.cpp @@ -713,7 +713,7 @@ napi_value QueryDeviceEventStats(napi_env env, napi_callback_info info) BundleStateCommon::GetCallbackPromiseResult(env, *asyncCallbackInfo, result); } }, - (void *)asyncCallbackInfo, + static_cast(asyncCallbackInfo), &asyncCallbackInfo->asyncWork)); NAPI_CALL(env, napi_queue_async_work(env, callbackPtr->asyncWork)); if (callbackPtr->isCallback) { -- Gitee