From d6c638fdb712feae1898ebfe1afa985a22d10b34 Mon Sep 17 00:00:00 2001 From: toutes Date: Mon, 28 Mar 2022 01:06:05 -0700 Subject: [PATCH] fix:Modify file permission information specification Signed-off-by: toutes --- LICENSE | 0 README.md | 4 +- figures/en-us_image_0000001079710638.png | Bin frameworks/src/small/power_manage.c | 4 +- interfaces/kits/battery/js/builtin/BUILD.gn | 34 --------- .../kits/battery/js/builtin/CMakeLists.txt | 35 ---------- .../battery/js/builtin/include/battery_impl.h | 35 ---------- .../js/builtin/include/battery_module.h | 35 ---------- .../battery/js/builtin/src/battery_module.cpp | 65 ------------------ services/include/small/screen_saver_handler.h | 2 +- services/src/screen_saver_feature.c | 4 +- utils/src/power_mgr_timer_util.c | 4 +- 12 files changed, 11 insertions(+), 211 deletions(-) mode change 100755 => 100644 LICENSE mode change 100755 => 100644 figures/en-us_image_0000001079710638.png delete mode 100644 interfaces/kits/battery/js/builtin/BUILD.gn delete mode 100755 interfaces/kits/battery/js/builtin/CMakeLists.txt delete mode 100755 interfaces/kits/battery/js/builtin/include/battery_impl.h delete mode 100755 interfaces/kits/battery/js/builtin/include/battery_module.h delete mode 100755 interfaces/kits/battery/js/builtin/src/battery_module.cpp mode change 100755 => 100644 services/include/small/screen_saver_handler.h diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md index 548b028..6c86b22 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 a0b7323..9bce216 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 5c94b1a..0000000 --- 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 3c0fd09..0000000 --- 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 31adcb9..0000000 --- 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 975c86b..0000000 --- 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 6083bc1..0000000 --- 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 ccb8a9a..28fabf9 --- 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 7bcf58e..cef5a0e 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 95eaa9f..afc48fa 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; -- Gitee