diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md index 548b028cc752c55dccc9e985308e01d1d881a380..6c86b2240d854186cd4086745a9c3ae8d9c8154a 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ DestroyRunningLock(lock); // Must release runninglock before destroyed [powermgr_power_manager](https://gitee.com/openharmony/powermgr_power_manager) -[**powermgr_display_manager](https://gitee.com/openharmony/powermgr_display_manager) +[powermgr_display_manager](https://gitee.com/openharmony/powermgr_display_manager) [powermgr_battery_manager](https://gitee.com/openharmony/powermgr_battery_manager) @@ -112,5 +112,5 @@ DestroyRunningLock(lock); // Must release runninglock before destroyed [powermgr_battery_lite](https://gitee.com/openharmony/powermgr_battery_lite) -**powermgr_powermgr_lite** +[powermgr_powermgr_lite](https://gitee.com/openharmony/powermgr_powermgr_lite) diff --git a/figures/en-us_image_0000001079710638.png b/figures/en-us_image_0000001079710638.png old mode 100755 new mode 100644 diff --git a/frameworks/src/small/power_manage.c b/frameworks/src/small/power_manage.c index a0b7323eeef0a0839956b7ebf75414ee3ade0aaf..9bce21658c8b9d127d79e6cf25a509c107fd0ec7 100644 --- a/frameworks/src/small/power_manage.c +++ b/frameworks/src/small/power_manage.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -71,6 +71,8 @@ static void *CreatClient(const char *service, const char *feature, uint32_t size static void DestroyClient(const char *service, const char *feature, void *iproxy) { + (void)service; + (void)feature; free(iproxy); } diff --git a/interfaces/kits/battery/js/builtin/BUILD.gn b/interfaces/kits/battery/js/builtin/BUILD.gn deleted file mode 100644 index 5c94b1a5c1b6dba1ac343b6c6ed074252844f3d7..0000000000000000000000000000000000000000 --- a/interfaces/kits/battery/js/builtin/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") - -ohos_static_library("libnativeapi_battery_simulator") { - public_configs = [ ":nativeapi_battery_simulator_config" ] - - sources = [ "src/battery_module.cpp" ] - include_dirs = [ - "//third_party/bounds_checking_function/include", - "include", - "//foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/jsi", - "//foundation/ace/ace_engine_lite/interfaces/innerkits/builtin/base", - ] - cflags = [ "-Wno-unused-variable" ] - deps = [] -} - -config("nativeapi_battery_simulator_config") { - include_dirs = [ - "//base/powermgr/powermgr_lite/interfaces/kits/battery/js/builtin/include", - ] -} diff --git a/interfaces/kits/battery/js/builtin/CMakeLists.txt b/interfaces/kits/battery/js/builtin/CMakeLists.txt deleted file mode 100755 index 3c0fd090f6f41e0443ca3962e52d8d802d45d9ab..0000000000000000000000000000000000000000 --- a/interfaces/kits/battery/js/builtin/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -cmake_minimum_required(VERSION 3.16.5) - -project(nativeapi_battery) - -set(MODULE_NAME nativeapi_battery) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -# header files -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../../third_party/bounds_checking_function/include) - -# source files -aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src BATTERY) - -add_library(${MODULE_NAME} STATIC - ${BATTERY} - ) -target_link_libraries(${MODULE_NAME} ui jsfwk) -target_include_directories(${MODULE_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) \ No newline at end of file diff --git a/interfaces/kits/battery/js/builtin/include/battery_impl.h b/interfaces/kits/battery/js/builtin/include/battery_impl.h deleted file mode 100755 index 31adcb9259290f3ae73f29af2aadcdd64dd156a1..0000000000000000000000000000000000000000 --- a/interfaces/kits/battery/js/builtin/include/battery_impl.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef BATTERY_IMPL_H -#define BATTERY_IMPL_H - -#include - -#ifdef __cplusplus -#if __cplusplus -extern "C" { -#endif -#endif /* __cplusplus */ - -int32_t GetBatteryStatus(bool* charging, double* level); - -#ifdef __cplusplus -#if __cplusplus -} -#endif -#endif /* __cplusplus */ - -#endif /* BATTERY_IMPL_H */ diff --git a/interfaces/kits/battery/js/builtin/include/battery_module.h b/interfaces/kits/battery/js/builtin/include/battery_module.h deleted file mode 100755 index 975c86be765935f343dba99c170ea0ff3759b51b..0000000000000000000000000000000000000000 --- a/interfaces/kits/battery/js/builtin/include/battery_module.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef BATTERY_MODULE_H -#define BATTERY_MODULE_H - -#include "jsi.h" - -namespace OHOS { -namespace ACELite { -using namespace OHOS::ACELite; -class BatteryModule { -public: - BatteryModule() {} - ~BatteryModule() {} - static JSIValue GetStatus(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); -}; - -void InitBatteryModule(JSIValue exports); -} // namespace ACELite -} // namespace OHOS - -#endif // BATTERY_MODULE_H \ No newline at end of file diff --git a/interfaces/kits/battery/js/builtin/src/battery_module.cpp b/interfaces/kits/battery/js/builtin/src/battery_module.cpp deleted file mode 100755 index 6083bc137c74884d65b0e02e079b9dde24548c7b..0000000000000000000000000000000000000000 --- a/interfaces/kits/battery/js/builtin/src/battery_module.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "battery_module.h" -#include "battery_impl.h" - -namespace OHOS { -namespace ACELite { -using namespace OHOS::ACELite; -void SuccessCallBack(const JSIValue thisVal, const JSIValue args, JSIValue jsiValue) -{ - if (JSI::ValueIsUndefined(args)) { - return; - } - JSIValue success = JSI::GetNamedProperty(args, CB_SUCCESS); - JSIValue complete = JSI::GetNamedProperty(args, CB_COMPLETE); - if (!JSI::ValueIsUndefined(success)) { - if (JSI::ValueIsUndefined(jsiValue)) { - JSI::CallFunction(success, thisVal, nullptr, 0); - } else { - JSI::CallFunction(success, thisVal, &jsiValue, ARGC_ONE); - } - } - if (!JSI::ValueIsUndefined(complete)) { - JSI::CallFunction(complete, thisVal, nullptr, 0); - } - JSI::ReleaseValueList(success, complete, ARGS_END); -} - -JSIValue BatteryModule::GetStatus(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) -{ - JSIValue undefValue = JSI::CreateUndefined(); - if ((args == nullptr) || (argsNum == 0) || JSI::ValueIsUndefined(args[0])) { - return undefValue; - } - - double level = 0; - bool charging = false; - (void)GetBatteryStatus(&charging, &level); - JSIValue result = JSI::CreateObject(); - JSI::SetBooleanProperty(result, "charging", charging); - JSI::SetNumberProperty(result, "level", level); - SuccessCallBack(thisVal, args[0], result); - JSI::ReleaseValue(result); - return undefValue; -} - -void InitBatteryModule(JSIValue exports) -{ - JSI::SetModuleAPI(exports, "getStatus", BatteryModule::GetStatus); -} -} // namespace ACELite -} // namespace OHOS diff --git a/services/include/small/screen_saver_handler.h b/services/include/small/screen_saver_handler.h old mode 100755 new mode 100644 index ccb8a9a5436f5c21db53fd1e56243af1b7b35d25..28fabf99bb8cf346cd76b0d83c85f02848949258 --- a/services/include/small/screen_saver_handler.h +++ b/services/include/small/screen_saver_handler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/services/src/screen_saver_feature.c b/services/src/screen_saver_feature.c index 7bcf58ec3601f9155794db3422378404fe6f591d..cef5a0ec63033e345ba0395c7e80153fc9dc58e4 100644 --- a/services/src/screen_saver_feature.c +++ b/services/src/screen_saver_feature.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -32,6 +32,8 @@ const char *GetScreenSaverFeatureName(Feature *feature) void OnScreenSaverFeatureInitialize(Feature *feature, Service *parent, Identity identity) { + (void)parent; + (void)identity; if (feature == NULL) { POWER_HILOGE("Invalid feature"); return; diff --git a/utils/src/power_mgr_timer_util.c b/utils/src/power_mgr_timer_util.c index 95eaa9fcf2da3937d469b70596c940f920233835..afc48fae877737d43501eda40b92f03186165aae 100644 --- a/utils/src/power_mgr_timer_util.c +++ b/utils/src/power_mgr_timer_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -85,7 +85,7 @@ PowerTimer *PowerMgrCreateTimer(int64_t whenMsec, int64_t intervalMsec, PowerTim info->timerCb = cb; struct sigevent evp; - memset_s(&evp, sizeof(evp), 0, sizeof(evp)); + (void)memset_s(&evp, sizeof(evp), 0, sizeof(evp)); evp.sigev_value.sival_ptr = info; evp.sigev_notify = SIGEV_THREAD; evp.sigev_notify_function = TimerHandle;