提交 c7bfb2c5 编写于 作者: L lnlan

feat(startup_init_lite): 修改syscap ndk接口

【背景】修改syscap ndk接口

【修改方案】
change syscap ndk name:
HasSystemCapability to canIUse

【影响】
对现有的产品编译不会有影响。

Change-Id: I77bc76b536a087884c089fdc27be4126c01a335f
Signed-off-by: Nlnlan <lanleinan3@huawei.com>
上级 dd66b3ad
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
"//base/startup/init_lite/services/begetctl:paramshell", "//base/startup/init_lite/services/begetctl:paramshell",
"//base/startup/init_lite/services/plugin:plugin", "//base/startup/init_lite/services/plugin:plugin",
"//base/startup/init_lite/interfaces/innerkits:libbegetutil", "//base/startup/init_lite/interfaces/innerkits:libbegetutil",
"//base/startup/init_lite/interfaces/kits:deviceinfo_ndk",
"//base/startup/init_lite/interfaces/innerkits:libbeget_proxy", "//base/startup/init_lite/interfaces/innerkits:libbeget_proxy",
"//base/startup/init_lite/interfaces/innerkits/file:libfile", "//base/startup/init_lite/interfaces/innerkits/file:libfile",
"//base/startup/init_lite/interfaces/innerkits/socket:libsocket", "//base/startup/init_lite/interfaces/innerkits/socket:libsocket",
...@@ -81,4 +82,4 @@ ...@@ -81,4 +82,4 @@
] ]
} }
} }
} }
\ No newline at end of file
...@@ -54,8 +54,6 @@ ohos_shared_library("libbegetutil") { ...@@ -54,8 +54,6 @@ ohos_shared_library("libbegetutil") {
deps += [ "//base/startup/init_lite/services/log:init_log" ] deps += [ "//base/startup/init_lite/services/log:init_log" ]
symlink_target_name = [ "libdeviceinfo_ndk.z.so" ]
public_configs = [ ":exported_header_files" ] public_configs = [ ":exported_header_files" ]
part_name = "init" part_name = "init"
install_images = [ install_images = [
......
...@@ -13,6 +13,13 @@ ...@@ -13,6 +13,13 @@
import("//build/ohos.gni") import("//build/ohos.gni")
ohos_shared_library("deviceinfo_ndk") {
sources = [ "src/syscap_ndk.c" ]
include_dirs = [ "./include" ]
deps = [ "//base/startup/init_lite/interfaces/innerkits:libbegetutil" ]
part_name = "init"
}
ohos_ndk_library("libdeviceinfo_ndk") { ohos_ndk_library("libdeviceinfo_ndk") {
output_name = "deviceinfo_ndk" output_name = "deviceinfo_ndk"
ndk_description_file = "./libdeviceinfo.ndk.json" ndk_description_file = "./libdeviceinfo.ndk.json"
...@@ -21,5 +28,5 @@ ohos_ndk_library("libdeviceinfo_ndk") { ...@@ -21,5 +28,5 @@ ohos_ndk_library("libdeviceinfo_ndk") {
ohos_ndk_headers("deviceinfo_header") { ohos_ndk_headers("deviceinfo_header") {
dest_dir = "$ndk_headers_out_dir/" dest_dir = "$ndk_headers_out_dir/"
sources = [ "./include/systemcapability.h" ] sources = [ "./include/syscap_ndk.h" ]
} }
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
#ifndef INIT_SYSCAP_API_H #ifndef SYSCAP_NDK_H
#define INIT_SYSCAP_API_H #define SYSCAP_NDK_H
#include <stdbool.h> #include <stdbool.h>
...@@ -24,8 +24,7 @@ extern "C" { ...@@ -24,8 +24,7 @@ extern "C" {
#endif #endif
#endif #endif
bool canIUse(const char *cap);
bool HasSystemCapability(const char *cap);
#ifdef __cplusplus #ifdef __cplusplus
#if __cplusplus #if __cplusplus
......
[ [
{ {
"name": "HasSystemCapability" "name": "canIUse"
} }
] ]
/*
* Copyright (c) 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
*
* 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 <stdbool.h>
#include "systemcapability.h"
#include "syscap_ndk.h"
bool canIUse(const char *cap)
{
return HasSystemCapability(cap);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册