diff --git a/interfaces/kits/js/napi/src/workscheduler_napi.cpp b/interfaces/kits/js/napi/src/workscheduler_napi.cpp index 0427dd98f5efe7b0e51e9f9ae8e10babb0fe8020..85515d25d49f622471df929fdfb9b10e0fced54c 100644 --- a/interfaces/kits/js/napi/src/workscheduler_napi.cpp +++ b/interfaces/kits/js/napi/src/workscheduler_napi.cpp @@ -19,7 +19,6 @@ namespace OHOS { namespace WorkScheduler { - EXTERN_C_START static const uint8_t ARG_FIRST = 1; @@ -56,9 +55,12 @@ napi_value InitNetworkType(napi_env env, napi_value exports) napi_create_uint32(env, static_cast(WorkCondition::Network::NETWORK_TYPE_ANY), &network_type_any); napi_create_uint32(env, static_cast(WorkCondition::Network::NETWORK_TYPE_MOBILE), &network_type_mobile); napi_create_uint32(env, static_cast(WorkCondition::Network::NETWORK_TYPE_WIFI), &network_type_wifi); - napi_create_uint32(env, static_cast(WorkCondition::Network::NETWORK_TYPE_BLUETOOTH), &network_type_bluetooth); - napi_create_uint32(env, static_cast(WorkCondition::Network::NETWORK_TYPE_WIFI_P2P), &network_type_wifi_p2p); - napi_create_uint32(env, static_cast(WorkCondition::Network::NETWORK_TYPE_ETHERNET), &network_type_ethernet); + napi_create_uint32(env, + static_cast(WorkCondition::Network::NETWORK_TYPE_BLUETOOTH), &network_type_bluetooth); + napi_create_uint32(env, + static_cast(WorkCondition::Network::NETWORK_TYPE_WIFI_P2P), &network_type_wifi_p2p); + napi_create_uint32(env, + static_cast(WorkCondition::Network::NETWORK_TYPE_ETHERNET), &network_type_ethernet); napi_property_descriptor desc[] = { DECLARE_NAPI_STATIC_PROPERTY("NETWORK_TYPE_ANY", network_type_any), @@ -110,7 +112,8 @@ napi_value InitChargingType(napi_env env, napi_value exports) napi_create_uint32(env, static_cast(WorkCondition::Charger::CHARGER_PLUGGED_ANY), &charging_plugged_any); napi_create_uint32(env, static_cast(WorkCondition::Charger::CHARGER_PLUGGED_AC), &charging_plugged_ac); napi_create_uint32(env, static_cast(WorkCondition::Charger::CHARGER_PLUGGED_USB), &charging_plugged_usb); - napi_create_uint32(env, static_cast(WorkCondition::Charger::CHARGER_PLUGGED_WIRELESS), &charging_plugged_wireless); + napi_create_uint32(env, static_cast(WorkCondition::Charger::CHARGER_PLUGGED_WIRELESS), + &charging_plugged_wireless); napi_property_descriptor desc[] = { DECLARE_NAPI_STATIC_PROPERTY("CHARGING_PLUGGED_ANY", charging_plugged_any), @@ -120,7 +123,8 @@ napi_value InitChargingType(napi_env env, napi_value exports) }; napi_value result = nullptr; - napi_define_class(env, "ChargingType", NAPI_AUTO_LENGTH, EnumChargingTypeConstructor, nullptr, sizeof(desc) / sizeof(*desc), desc, &result); + napi_define_class(env, "ChargingType", NAPI_AUTO_LENGTH, + EnumChargingTypeConstructor, nullptr, sizeof(desc) / sizeof(*desc), desc, &result); napi_create_reference(env, result, refCount, &chargingTypeConstructor_); napi_set_named_property(env, exports, "ChargingType", result); return exports; @@ -152,9 +156,12 @@ napi_value InitBatteryStatus(napi_env env, napi_value exports) napi_value battery_status_low_or_okay; int32_t refCount = 1; - napi_create_uint32(env, static_cast(WorkCondition::BatteryStatus::BATTERY_STATUS_LOW), &battery_status_low); - napi_create_uint32(env, static_cast(WorkCondition::BatteryStatus::BATTERY_STATUS_OKAY), &battery_status_okay); - napi_create_uint32(env, static_cast(WorkCondition::BatteryStatus::BATTERY_STATUS_LOW_OR_OKAY), &battery_status_low_or_okay); + napi_create_uint32(env, + static_cast(WorkCondition::BatteryStatus::BATTERY_STATUS_LOW), &battery_status_low); + napi_create_uint32(env, + static_cast(WorkCondition::BatteryStatus::BATTERY_STATUS_OKAY), &battery_status_okay); + napi_create_uint32(env, + static_cast(WorkCondition::BatteryStatus::BATTERY_STATUS_LOW_OR_OKAY), &battery_status_low_or_okay); napi_property_descriptor desc[] = { DECLARE_NAPI_STATIC_PROPERTY("BATTERY_STATUS_LOW", battery_status_low), @@ -238,6 +245,5 @@ __attribute__((constructor)) void RegisterModule(void) napi_module_register(&_module); } EXTERN_C_END - } } \ No newline at end of file diff --git a/services/native/src/work_scheduler_service.cpp b/services/native/src/work_scheduler_service.cpp index b2b98e0af3933b61b51de708f8967b388f66939c..f628a6b179ecb3bad5c1c3d45bdab76231dbd477 100644 --- a/services/native/src/work_scheduler_service.cpp +++ b/services/native/src/work_scheduler_service.cpp @@ -18,7 +18,6 @@ namespace OHOS { namespace WorkScheduler { - namespace { const std::string WORKSCHEDULER_SERVICE_NAME = "WorkSchedulerService"; const bool G_REGISTER_RESULT = SystemAbility::MakeAndRegisterAbility( diff --git a/utils/native/include/work_sched_errors.h b/utils/native/include/work_sched_errors.h index 4e2520a92cc94bae93e28074a9212913408e3a24..492ca29648eeaf6d98b422917a804b21aa1f0833 100644 --- a/utils/native/include/work_sched_errors.h +++ b/utils/native/include/work_sched_errors.h @@ -20,7 +20,6 @@ namespace OHOS { namespace WorkScheduler { - // WorkScheduler's module const defined. enum { WORKSCHED_MODULE_TYPE = 0x00, @@ -45,5 +44,4 @@ enum { } // namespace WorkScheduler } // namespace OHOS - #endif // WORK_SCHED_UTILS_ERRORS_H \ No newline at end of file