mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-24 16:49:58 +00:00
!353 feat(startup_init_lite): 修改syscap ndk接口
Merge pull request !353 from lnlan/modify_syscap_ndk_name
This commit is contained in:
commit
53dfd1a971
@ -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",
|
||||
|
@ -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 = [
|
||||
|
@ -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" ]
|
||||
}
|
||||
|
@ -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
|
@ -1,5 +1,5 @@
|
||||
[
|
||||
{
|
||||
"name": "HasSystemCapability"
|
||||
"name": "canIUse"
|
||||
}
|
||||
]
|
||||
|
23
interfaces/kits/src/syscap_ndk.c
Normal file
23
interfaces/kits/src/syscap_ndk.c
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user