diff --git a/frameworks/src/app_group_observer_napi.cpp b/frameworks/src/app_group_observer_napi.cpp index 028b50dd7f22b99ac84c195bd447d3b572e0a0d9..f9ab0c16c4a0b09fbec68dbb7adcb0f05751330d 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 cff62f52c97ae826c24f087d6fd032aaf9d04c9f..8fbdb5ceef2214645d4b9807c804441a6e4d65ad 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 5c486ca185e80e46d6583f2e8a7eab2308c19ccf..065d9eef4c975484cbc9b6f40c3a6585803abbfa 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 edb88d86ffeebc953154eb00778fd6c81aa82758..14778aa64d24995fe79d84bc70e15014207ac8bf 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 e7e775d383740595353d72bc28751d0766a86cc7..c44d6fde917800ed0030aa69b7caf71859a78ab8 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) { @@ -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) { @@ -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 2dcc8bdf45155e95a01271f0a07ac9a6fbe96050..1de0867b717b766d2cbd2f094a71b72073cdc73b 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 96d90b7353edec6a7bdb464696d9b0efbcfd5a83..50272de6ee325cc4b35d2586bed9a15a9501b662 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 f895d67881442d85a1eb0a3b6b21862f5281f7bd..695044875237e0f325b8101a245380f0a70c5733 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 86e099963729da54916538df4813ec0404d4eb94..b281135a04b7bcb1a17a5deeac06860171ce637d 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 8e65667bcfce6f98b9cc62e4a618ef0c9968bb8d..cb34bc7f63e8ee598ab768ec7c65443f3fa1537b 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 4da128846f6b1d641bbcd2eae28db1d3ba51e769..ca7f97ebab0a2d5eb385a6fe596e575ad63e9c78 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 6ec2ff17d6e6023fdb831ce91634e797685f33a2..7d344d2fc5feedefebf5f89a6154189728d004dc 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 9593b6271573de53d28d139635db1c14e321ec6f..d739e91916d44b7353cf69d7b8f951e3f5b11292 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 41230b14395405bb8141e4b250df72885d23652f..5f9aefe2389314ae6e0f4ecbf1a850e1683bf0fd 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 5b632398ca7ec664e23ced93f89e08eac76c6dda..a9b4949b50b23065cce3f4459b5f9cbf0e835b03 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 57d0c1c11026776a0d02931f7bb49884d7cf4eae..0155e043208c0aa5f59622f3e62ef75ffa90a1f7 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 0112a18ee812f412dcbc0e4649e1963781cef123..5146339d1c0bcf5d80b65c19cc211a4924f7fb43 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();