!353 feat(startup_init_lite): 修改syscap ndk接口

Merge pull request !353 from lnlan/modify_syscap_ndk_name
This commit is contained in:
openharmony_ci 2022-03-10 06:23:25 +00:00 committed by Gitee
commit 53dfd1a971
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 37 additions and 9 deletions

View File

@ -43,6 +43,7 @@
"//base/startup/init_lite/services/begetctl:paramshell",
"//base/startup/init_lite/services/plugin:plugin",
"//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/file:libfile",
"//base/startup/init_lite/interfaces/innerkits/socket:libsocket",

View File

@ -54,8 +54,6 @@ ohos_shared_library("libbegetutil") {
deps += [ "//base/startup/init_lite/services/log:init_log" ]
symlink_target_name = [ "libdeviceinfo_ndk.z.so" ]
public_configs = [ ":exported_header_files" ]
part_name = "init"
install_images = [

View File

@ -13,6 +13,13 @@
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") {
output_name = "deviceinfo_ndk"
ndk_description_file = "./libdeviceinfo.ndk.json"
@ -21,5 +28,5 @@ ohos_ndk_library("libdeviceinfo_ndk") {
ohos_ndk_headers("deviceinfo_header") {
dest_dir = "$ndk_headers_out_dir/"
sources = [ "./include/systemcapability.h" ]
sources = [ "./include/syscap_ndk.h" ]
}

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
#ifndef INIT_SYSCAP_API_H
#define INIT_SYSCAP_API_H
#ifndef SYSCAP_NDK_H
#define SYSCAP_NDK_H
#include <stdbool.h>
@ -24,8 +24,7 @@ extern "C" {
#endif
#endif
bool HasSystemCapability(const char *cap);
bool canIUse(const char *cap);
#ifdef __cplusplus
#if __cplusplus

View File

@ -1,5 +1,5 @@
[
{
"name": "HasSystemCapability"
"name": "canIUse"
}
]

View File

@ -0,0 +1,23 @@
/*
* 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);
}