From 88a104fe06daee26ec73042748168f97340c2890 Mon Sep 17 00:00:00 2001 From: caochao <2930650069@qq.com> Date: Sat, 22 Jan 2022 10:55:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=8E=A5=E5=8F=A3=E6=97=B6=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E7=A9=BA=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cao_liu_chao --- interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp index 31107e981..87a6c77e7 100644 --- a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp +++ b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp @@ -70,6 +70,11 @@ bool DeviceManagerImpl::isSystemAppCalling(void) LOGI("get bundle manager proxy success."); sptr iBundleMgr = iface_cast(remoteObject); + if (iBundleMgr == nullptr) { + LOGI("iBundleMgr is nullptr, caller may be a process"); + return true; + } + return iBundleMgr->CheckIsSystemAppByUid(uid); } -- Gitee From 734dec644e5d1c0d7ad4a1cc4ab5ad7a018e7f35 Mon Sep 17 00:00:00 2001 From: caochao <2930650069@qq.com> Date: Sat, 22 Jan 2022 16:00:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?device=5Fmanager=E6=A0=87=E5=87=86=E9=83=A8?= =?UTF-8?q?=E4=BB=B6=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cao_liu_chao caochao12@huawei.com --- ohos.build => bundle.json | 86 ++++++++++++++++++++++++++++----------- 1 file changed, 62 insertions(+), 24 deletions(-) rename ohos.build => bundle.json (32%) diff --git a/ohos.build b/bundle.json similarity index 32% rename from ohos.build rename to bundle.json index 59995c055..a204d9be7 100644 --- a/ohos.build +++ b/bundle.json @@ -1,23 +1,48 @@ { - "parts": { - "device_manager_base": { - "variants": ["phone", "wearable", "ivi"], - "inner_kits": [ - { - "type": "so", - "name": "//foundation/distributedhardware/devicemanager/interfaces/inner_kits/native_cpp:devicemanagersdk", - "header": { - "header_base": "//foundation/distributedhardware/devicemanager/interfaces/inner_kits/native_cpp/include", - "header_files": [ - "device_manager.h", - "device_manager_callback.h", - "dm_device_info.h", - "dm_subscribe_info.h" - ] - } - } + "name": "@ohos/device_manager_base", + "description": "device manager service", + "version": "3.1", + "license": "Apache License 2.0", + "repository": "https://gitee.com/openharmony/device_manager", + "publishAs": "code-segment", + "segment": { + "destPath": "foundation/distributedhardware/devicemanager" + }, + "dirs": {}, + "scripts": {}, + "component": { + "name": "device_manager_base", + "subsystem": "distributedhardware", + "syscap":[ "systemcapbility.distributedhardware.devicemanager" ], + "features":[], + "adapted_system_type": [ "standard", "small" ], + "rom": "2M", + "ram": "16M", + "deps": { + "components": [ + "aafwk_standard", + "appexecfwk_standard", + "hiviewdfx_hilog_native", + "ipc", + "safwk", + "startup_l2", + "device_profile_core", + "samgr_standard", + "ces_standard", + "dsoftbus_standard", + "utils_base", + "napi", + "deviceauth_standard" ], - "module_list": [ + "third_party": [ + "json", + "node", + "googletest", + "mbedtls" + ] + }, + "build": { + "sub_component": [ "//foundation/distributedhardware/devicemanager/utils:devicemanagerutils", "//foundation/distributedhardware/devicemanager/interfaces/inner_kits/native_cpp:devicemanagersdk", "//foundation/distributedhardware/devicemanager/interfaces/kits/js:devicemanager_native_js", @@ -26,11 +51,24 @@ "//foundation/distributedhardware/devicemanager/ext/pin_auth:devicemanagerext_pin_auth", "//foundation/distributedhardware/devicemanager/ext/profile:devicemanagerext_profile" ], - "test_list": [ - "//foundation/distributedhardware/devicemanager/test:test" + "inner_kits": [ + { + "type": "so", + "name": "//foundation/distributedhardware/devicemanager/interfaces/inner_kits/native_cpp:devicemanagersdk", + "header": { + "header_files": [ + "device_manager.h", + "device_manager_callback.h", + "dm_device_info.h", + "dm_subscribe_info.h" + ], + "header_base": "//foundation/distributedhardware/devicemanager/interfaces/inner_kits/native_cpp/include" + } + } ], - "system_kits": [] + "test": [ + "//foundation/distributedhardware/devicemanager/test:test" + ] } - }, - "subsystem": "distributedhardware" -} + } +} \ No newline at end of file -- Gitee