diff --git a/ohos.build b/bundle.json similarity index 32% rename from ohos.build rename to bundle.json index 59995c055a28f389812fe9a7e3abb7f1499404b7..a204d9be796eba742087e201944c150c96928e7f 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 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 31107e981e814871f5c8240f6b66c397d7e4ae47..87a6c77e7aca126b1bf74ab4b6e6f4c5dd8b128c 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); }