diff --git a/BUILD.gn b/BUILD.gn index 7e5dfc76c562adc8cc23b22f6b9a1ff6c989cacb..310df489db7630470572381fe337a2e44e3775c9 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# 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 diff --git a/OAT.xml b/OAT.xml index 02e212b1f84de4ae739c280f6024820a107d2f19..54fc1b978e6261a7f39bf38ca02a0b2d50ad609c 100644 --- a/OAT.xml +++ b/OAT.xml @@ -1,5 +1,5 @@ - + +
+ + 是否允许对端连接本机 + + + 用于分享图片 + +
+ + +
+
diff --git a/common/include/dialog_ui/js/pages/index/index.js b/common/include/show_confirm_dialog/dialog_ui/js/pages/index/index.js similarity index 54% rename from common/include/dialog_ui/js/pages/index/index.js rename to common/include/show_confirm_dialog/dialog_ui/js/pages/index/index.js index f579f6a3e554e0dcb02bd8e95b2e1e5577304402..19671312de0b4831c62e1f51e582602a6c7daf26 100644 --- a/common/include/dialog_ui/js/pages/index/index.js +++ b/common/include/show_confirm_dialog/dialog_ui/js/pages/index/index.js @@ -1,9 +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. +*/ + import router from '@ohos.router' var timel = null; export default { data: { - message: router.getParams().targetPkgName, seconds:60, }, onInit() { diff --git a/common/include/single_instance.h b/common/include/single_instance.h index 0bfa9e404ea7e90fbae0732e10d1bf9f22216b7d..5480fd674cb0f0c077358e74924b052e8a93a3da 100644 --- a/common/include/single_instance.h +++ b/common/include/single_instance.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/devicemanager.gni b/devicemanager.gni index 7487a8b3207ca8007a54e97034d8c74366cb9653..517e229e1be8c7e50f9f9598955a23750ee8098c 100644 --- a/devicemanager.gni +++ b/devicemanager.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# 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 @@ -26,3 +26,6 @@ ext_path = "${devicemanager_path}/ext" #----------------------compilation options--------------------------# dm_ldflags = [ "-lpthread" ] +declare_args() { + device_manager_base_no_interaction_auth = false +} diff --git a/display/@ohos.distributedHardware.deviceManager.d.ts b/display/@ohos.distributedHardware.deviceManager.d.ts index 69179ba17e203845da9658da477386deed0167ee..d00376306a92181187afa2623d4f18fff21648cd 100644 --- a/display/@ohos.distributedHardware.deviceManager.d.ts +++ b/display/@ohos.distributedHardware.deviceManager.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * 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 diff --git a/display/build.gradle b/display/build.gradle index 151e80b67a03ddf9df7f7f3ad9e78826244b994c..c1a65d03d55e282bf42aa24c6179a2a3413bc604 100644 --- a/display/build.gradle +++ b/display/build.gradle @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/display/entry/build.gradle b/display/entry/build.gradle index 1f560cd47c2b0a5ce96a574a892a6d06ceb4e6f9..9cdfe117adf8796e13f28ba4c8f22db83c56d37f 100644 --- a/display/entry/build.gradle +++ b/display/entry/build.gradle @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/display/entry/src/main/js/default/app.js b/display/entry/src/main/js/default/app.js index 8e47afff13e928a74fdcc01a108e4422404b9ac9..f052c8a909b68f6e497443771496a070ecbccb1c 100644 --- a/display/entry/src/main/js/default/app.js +++ b/display/entry/src/main/js/default/app.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/display/entry/src/main/js/default/pages/index/index.css b/display/entry/src/main/js/default/pages/index/index.css index 13230219750e97e15bf1d33645ec471e4ca41e60..e76e973b802d6279e756cb40de40cef9ff789e13 100644 --- a/display/entry/src/main/js/default/pages/index/index.css +++ b/display/entry/src/main/js/default/pages/index/index.css @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/display/entry/src/main/js/default/pages/index/index.hml b/display/entry/src/main/js/default/pages/index/index.hml index 7f388b21204e991f72ba51fe0b3f3a1c6d668d46..4702d880b3b7418195b14cd8c60aeb36c6e9b6e6 100644 --- a/display/entry/src/main/js/default/pages/index/index.hml +++ b/display/entry/src/main/js/default/pages/index/index.hml @@ -1,6 +1,6 @@ +
PIN码连接 @@ -10,10 +27,10 @@ PIN码输入错误,请重新输入(3次:还有{{isTimes}}次机会)
- -
diff --git a/ext/input_pin_dialog/dialog_ui/js/pages/index/index.js b/ext/pin_auth/input_pin_dialog/dialog_ui/js/pages/index/index.js similarity index 50% rename from ext/input_pin_dialog/dialog_ui/js/pages/index/index.js rename to ext/pin_auth/input_pin_dialog/dialog_ui/js/pages/index/index.js index 514b6ec77625f87c10ea936fcd20191c9f544f72..65fce494ac1e663e5b479d9b31690b9360a0f1d6 100644 --- a/ext/input_pin_dialog/dialog_ui/js/pages/index/index.js +++ b/ext/pin_auth/input_pin_dialog/dialog_ui/js/pages/index/index.js @@ -1,3 +1,18 @@ +/* + 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. +*/ + import router from '@ohos.router'; var numbs = 0; @@ -19,22 +34,21 @@ export default { onConfirm() { numbs = numbs + 1; if(numbs <= 3){ - console.info('click cancel numbs < 3 '); - console.info('code: ' + code); - console.info('inputVal: ' + inputVal); + console.info('click confirm numbs < 3 '); if(code == inputVal){ - console.info('click cancel code == inputVal'); + console.info('click confirm code == inputVal'); callNativeHandler("EVENT_INPUT", "0"); }else{ if(numbs == 3){ + console.info('click confirm code != inputVal and numbs == 3'); callNativeHandler("EVENT_CONFIRM", "1"); } - console.info('click cancel code != inputVal'); + console.info('click confirm code != inputVal'); this.isShow = true; this.isTimes = 3 - numbs; } }else{ - console.info('click cancel numbs > 3 '); + console.info('click confirm numbs > 3 '); callNativeHandler("EVENT_CONFIRM", "1"); } }, diff --git a/ext/show_pin_dialog/dialog_ui/js/BUILD.gn b/ext/pin_auth/show_pin_dialog/dialog_ui/js/BUILD.gn similarity index 80% rename from ext/show_pin_dialog/dialog_ui/js/BUILD.gn rename to ext/pin_auth/show_pin_dialog/dialog_ui/js/BUILD.gn index 8c623e7f87ffeec940e5f3a0730114001f79f6e0..d0042194c737fbeedf7d0dc50c9410cad8106118 100644 --- a/ext/show_pin_dialog/dialog_ui/js/BUILD.gn +++ b/ext/pin_auth/show_pin_dialog/dialog_ui/js/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# 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 @@ -15,7 +15,9 @@ import("//foundation/ace/ace_engine/build/ace_gen_sa_dialog_js.gni") import("//foundation/distributedhardware/devicemanager/devicemanager.gni") gen_sa_dialog_js("dialog_js_files_etc") { - project_path = "//foundation/distributedhardware/devicemanager/ext/show_pin_dialog/dialog_ui/js" + if (!device_manager_base_no_interaction_auth) { + project_path = "//foundation/distributedhardware/devicemanager/ext/pin_auth/show_pin_dialog/dialog_ui/js" + } dialog_name = "show_pin_service" part_name = "device_manager_base" subsystem_name = "distributedhardware" diff --git a/ext/show_pin_dialog/dialog_ui/js/i18n/en-US.json b/ext/pin_auth/show_pin_dialog/dialog_ui/js/i18n/en-US.json similarity index 100% rename from ext/show_pin_dialog/dialog_ui/js/i18n/en-US.json rename to ext/pin_auth/show_pin_dialog/dialog_ui/js/i18n/en-US.json diff --git a/ext/show_pin_dialog/dialog_ui/js/i18n/zh-CN.json b/ext/pin_auth/show_pin_dialog/dialog_ui/js/i18n/zh-CN.json similarity index 100% rename from ext/show_pin_dialog/dialog_ui/js/i18n/zh-CN.json rename to ext/pin_auth/show_pin_dialog/dialog_ui/js/i18n/zh-CN.json diff --git a/ext/show_pin_dialog/dialog_ui/js/pages/index/index.css b/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.css similarity index 43% rename from ext/show_pin_dialog/dialog_ui/js/pages/index/index.css rename to ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.css index ad2c2c4163304477cc340203355f1f1ea6b60d30..218d178702161438be3274de863d8afb8beb90e5 100644 --- a/ext/show_pin_dialog/dialog_ui/js/pages/index/index.css +++ b/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.css @@ -1,3 +1,18 @@ +/* + 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. +*/ + .container { flex-direction: column; justify-content: center; @@ -23,7 +38,7 @@ font-weight: 800; } -.but { +.but-confirm { width: 30%; font-size: 40px; height: 80px; diff --git a/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.hml b/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..d2796413c185e360cf9be95d1d4ed3efca99f5f5 --- /dev/null +++ b/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.hml @@ -0,0 +1,31 @@ + + +
+ + PIN码连接 + + + 请在设备端输入链接码进行验证 + + + {{ pincode }} + + +
\ No newline at end of file diff --git a/ext/show_pin_dialog/dialog_ui/js/pages/index/index.js b/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.js similarity index 32% rename from ext/show_pin_dialog/dialog_ui/js/pages/index/index.js rename to ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.js index 3a55ac1cc8215df26437b036c9f92ec5dbb7568d..1cf30b5708555cf87932029054ca21eea7dbfa8d 100644 --- a/ext/show_pin_dialog/dialog_ui/js/pages/index/index.js +++ b/ext/pin_auth/show_pin_dialog/dialog_ui/js/pages/index/index.js @@ -1,3 +1,18 @@ +/* + 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. +*/ + import router from '@ohos.router' export default { @@ -5,7 +20,6 @@ export default { pincode: router.getParams().pinCode, }, onInit() { - console.info('getParams: ' + router.getParams()); callNativeHandler("EVENT_CONFIRM", "0"); }, onConfirm() { diff --git a/ext/pin_auth/src/ability/lite/dm_ability_manager.cpp b/ext/pin_auth/src/ability/lite/dm_ability_manager.cpp index d58403aeeb0b4c73e1f99d91bc78ad6cc719e796..e10ee79f7499265a71583b69f04296cdaed1af48 100644 --- a/ext/pin_auth/src/ability/lite/dm_ability_manager.cpp +++ b/ext/pin_auth/src/ability/lite/dm_ability_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -30,7 +30,7 @@ AbilityStatus DmAbilityManager::StartAbility(AbilityRole role) return mStatus_; } -void DmAbilityManager::waitForTimeout(uint32_t timeout_s) +void DmAbilityManager::WaitForTimeout(uint32_t timeout_s) { struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); diff --git a/ext/pin_auth/src/ability/standard/dm_ability_manager.cpp b/ext/pin_auth/src/ability/standard/dm_ability_manager.cpp index 09d7203142859847f2881085371a51fc338a02d8..6e50ef0b4c9d1650320694d3065daef78d0a5ea2 100644 --- a/ext/pin_auth/src/ability/standard/dm_ability_manager.cpp +++ b/ext/pin_auth/src/ability/standard/dm_ability_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -53,11 +53,11 @@ AbilityStatus DmAbilityManager::StartAbility(AbilityRole role) mStatus_ = ABILITY_STATUS_FAILED; return mStatus_; } - waitForTimeout(ABILITY_START_TIMEOUT); + WaitForTimeout(ABILITY_START_TIMEOUT); return mStatus_; } -void DmAbilityManager::waitForTimeout(uint32_t timeout_s) +void DmAbilityManager::WaitForTimeout(uint32_t timeout_s) { struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); diff --git a/ext/pin_auth/src/pin_auth.cpp b/ext/pin_auth/src/pin_auth.cpp index 377cb8fdb1691fe835222a9052333acccf339cc9..3ac16e7bbb0633812f0fbc9b5eba499c006e482d 100644 --- a/ext/pin_auth/src/pin_auth.cpp +++ b/ext/pin_auth/src/pin_auth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -16,7 +16,7 @@ #include "pin_auth.h" #include -#include +#include #include "dm_constants.h" #include "dm_log.h" @@ -66,7 +66,7 @@ int32_t PinAuth::StartAuth(std::string &authToken, std::shared_ptr - - PIN码连接 - - - 请在设备端输入链接码进行验证 - - - {{ pincode }} - - -
\ No newline at end of file diff --git a/interfaces/inner_kits/native_cpp/BUILD.gn b/interfaces/inner_kits/native_cpp/BUILD.gn index a842f4b22d1860015ff9a3330a20bd4cdc946eae..7314d104b006ed50f0881455b45bab578d4288b1 100644 --- a/interfaces/inner_kits/native_cpp/BUILD.gn +++ b/interfaces/inner_kits/native_cpp/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# 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 diff --git a/interfaces/inner_kits/native_cpp/include/device_manager.h b/interfaces/inner_kits/native_cpp/include/device_manager.h index 4b814a7a72dff37daaaa7f514780a1f920b47701..5a903c02e80ee01584c8e57c0b5d3a648ec3a98b 100644 --- a/interfaces/inner_kits/native_cpp/include/device_manager.h +++ b/interfaces/inner_kits/native_cpp/include/device_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/device_manager_callback.h b/interfaces/inner_kits/native_cpp/include/device_manager_callback.h index f175f2344d7e95d5829510acb3b98fd9be1bb8b7..f92ceebf565ff179dfe66a43c90942fbad6a705b 100644 --- a/interfaces/inner_kits/native_cpp/include/device_manager_callback.h +++ b/interfaces/inner_kits/native_cpp/include/device_manager_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/device_manager_impl.h b/interfaces/inner_kits/native_cpp/include/device_manager_impl.h index 805d6640f31ecac2651d9c29b7e656bdfa1ebcb9..97a6a731baf1d229c7b41f613e51e5293cbb82c0 100644 --- a/interfaces/inner_kits/native_cpp/include/device_manager_impl.h +++ b/interfaces/inner_kits/native_cpp/include/device_manager_impl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/dm_app_image_info.h b/interfaces/inner_kits/native_cpp/include/dm_app_image_info.h index 26475008b4e014f07a2aeaa8f5e0ea18610be33d..676def35c1dd1ce2cbb94d48a583d2b72ee27b73 100644 --- a/interfaces/inner_kits/native_cpp/include/dm_app_image_info.h +++ b/interfaces/inner_kits/native_cpp/include/dm_app_image_info.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/dm_device_info.h b/interfaces/inner_kits/native_cpp/include/dm_device_info.h index b17b597b186a7fcf4c7105f14860de42683ebb63..04a14602b515c0c5e65371bb0b9cc49b8f4c4e80 100644 --- a/interfaces/inner_kits/native_cpp/include/dm_device_info.h +++ b/interfaces/inner_kits/native_cpp/include/dm_device_info.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -49,6 +49,7 @@ typedef struct DmDeviceInfo { char deviceId[DM_MAX_DEVICE_ID_LEN]; char deviceName[DM_MAX_DEVICE_NAME_LEN]; uint16_t deviceTypeId; + char networkId[DM_MAX_DEVICE_ID_LEN]; } DmDeviceInfo; typedef struct DmAuthParam { diff --git a/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h b/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h index 87561c4e8ab206e00abfa94c37ad2facfb606df7..603e242109cc3c284491f8e0ee110c9f04cb62b9 100644 --- a/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h +++ b/interfaces/inner_kits/native_cpp/include/dm_subscribe_info.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/ipc/ipc_client.h b/interfaces/inner_kits/native_cpp/include/ipc/ipc_client.h index 85ee63e9cd70e589913e3dd40c8b80ff6e58c4ea..8f2b0074a2bd3a468fe22faf2acc1017a1ede362 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/ipc_client.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/ipc_client.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/ipc/ipc_client_proxy.h b/interfaces/inner_kits/native_cpp/include/ipc/ipc_client_proxy.h index fd38295b5aa8a116efe5cbd8ef0122d68252ac48..9325f68c4584f7163357308c8cf80da494a2b2b3 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/ipc_client_proxy.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/ipc_client_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_manager.h b/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_manager.h index 2142ffad97527fee72b71e97271f401d8474b897..2fd9caba98da462e95085b0e250b20e66e907031 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_manager.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_server_proxy.h b/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_server_proxy.h index c319bafd35b77bb2382e32e5df95ba7509d10126..943920175829dc72e287267e0109760fec575b7b 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_server_proxy.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_server_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_stub.h b/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_stub.h index 8a0d48d93b07de062578fc1ee79d233365fe7862..3f490ecbc0f0856fa8ef8818c39160585bbccaae 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_stub.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/lite/ipc_client_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_manager.h b/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_manager.h index 168f8c9567c8fd6ad4ece0a012b2e9f66d7f81f8..abc5f0acfa3f043428f71be866d56a79a710b16d 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_manager.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_server_proxy.h b/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_server_proxy.h index 4dddcb45cccfda9318dfef81577d976001eff588..1fbf3ac7d5ff60b4a6c6a57e3ef011dc0e7a617e 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_server_proxy.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_server_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_stub.h b/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_stub.h index 44195ac6f564c3e635a8d3eab71f0e1d378b353b..98762d711e8de7f448ffe251873d9d9059a7e18a 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_stub.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_client_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_remote_broker.h b/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_remote_broker.h index ce5ded9cffee889bbe6952d028c13171247b3075..ff84eb9af844e386be1c412fffb4ab131adaf30d 100644 --- a/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_remote_broker.h +++ b/interfaces/inner_kits/native_cpp/include/ipc/standard/ipc_remote_broker.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/include/notify/device_manager_notify.h b/interfaces/inner_kits/native_cpp/include/notify/device_manager_notify.h index 2f882bb120d358236e186089d68bf6a0426d950d..da87262b198fe6f14013a0bf8c32c6ae5e33c02d 100644 --- a/interfaces/inner_kits/native_cpp/include/notify/device_manager_notify.h +++ b/interfaces/inner_kits/native_cpp/include/notify/device_manager_notify.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/src/device_manager.cpp b/interfaces/inner_kits/native_cpp/src/device_manager.cpp index 0e934d8d285278adf5029e144720e7c8ffe06be4..0f33b5a3d271ae209eddda5b19ce1b9bd4edc54c 100644 --- a/interfaces/inner_kits/native_cpp/src/device_manager.cpp +++ b/interfaces/inner_kits/native_cpp/src/device_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 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 91fd9fbe72f6d7f164f98f8bf201c7197085ede4..f314b93ff33927e38521aed3d9896f46ab9e89e2 100644 --- a/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp +++ b/interfaces/inner_kits/native_cpp/src/device_manager_impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/src/ipc/ipc_client_proxy.cpp b/interfaces/inner_kits/native_cpp/src/ipc/ipc_client_proxy.cpp index 57fd0e97b0817cf133f94775bcf2f08e7d7af286..431b7a84cbb114101032eb6886d73efa017bf7a9 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/ipc_client_proxy.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/ipc_client_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_manager.cpp b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_manager.cpp index 0b1a27788378b6717481db14dd55b69529c0ff8a..4a92a1090b88fb169106eedbade0941da1046c8e 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_manager.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp index 0df3527995b6d80a42e6643cc376446f1bb72072..97f8cee6ee2077a8c1e6e01ad0369554bda0ea0d 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_server_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_stub.cpp b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_stub.cpp index 36132ab8bf51098abd6526f1d65c807c7615d543..3549f3e2a59b1aaa392d7a6985aff5a1177fd9a3 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_stub.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_client_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp index e1a881b907105d52639c356acd1a7d089b6d44e4..eeb0b61eaf4915c5a215c73a3a438325306f6f0d 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/lite/ipc_cmd_parser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -229,7 +229,7 @@ ON_IPC_CMD(SERVER_DEVICE_STATE_NOTIFY, IpcIo &reply) DmDeviceState deviceState = static_cast(IpcIoPopInt32(&reply)); uint32_t size; const DmDeviceInfo *deviceInfo = (const DmDeviceInfo *)IpcIoPopFlatObj(&reply, &size); - if (pkgName == "" || len == 0 || deviceInfo == NULL) { + if (pkgName == "" || len == 0 || deviceInfo == nullptr) { LOGE("OnDeviceOnline, get para failed"); return; } @@ -256,7 +256,7 @@ ON_IPC_CMD(SERVER_DEVICE_FOUND, IpcIo &reply) uint16_t subscribeId = IpcIoPopUint16(&reply); uint32_t size; const DmDeviceInfo *deviceInfo = (const DmDeviceInfo *)IpcIoPopFlatObj(&reply, &size); - if (pkgName == "" || len == 0 || deviceInfo == NULL) { + if (pkgName == "" || len == 0 || deviceInfo == nullptr) { LOGE("OnDeviceChanged, get para failed"); return; } diff --git a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_manager.cpp b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_manager.cpp index 06ae13b7536292ed57d5b153f0d25f17203086ba..d7b674e4d0dc875dae2b1b423fd84511c9cd166c 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_manager.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_server_proxy.cpp b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_server_proxy.cpp index 345243a15466d8e2839eaf1f960586dc01183e93..6093b9e048060f93b2e99c6baf6c5906c7b029eb 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_server_proxy.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_server_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_stub.cpp b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_stub.cpp index aa022b55ff41fe7406d413450cf61aa6a349bc9a..1d9ddc12b6ff4b4d7533d3adb89eb0e44d6d1a78 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_stub.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_client_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -25,7 +25,7 @@ namespace OHOS { namespace DistributedHardware { int32_t IpcClientStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - LOGI("code = %d, flags= %d.", code, option.GetFlags()); + LOGI("code = %u, flags= %d.", code, option.GetFlags()); auto remoteDescriptor = data.ReadInterfaceToken(); if (GetDescriptor() != remoteDescriptor) { LOGI("ReadInterfaceToken fail!"); @@ -36,7 +36,7 @@ int32_t IpcClientStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Messa LOGE("on ipc cmd success"); return DM_OK; } - LOGW("unsupport code: %d", code); + LOGW("unsupport code: %u", code); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } diff --git a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp index 38a52f75a389c4be8f7fbcafda21441bd25c3beb..984e12af1f17b6193454c5d068e605003951a9e7 100644 --- a/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp +++ b/interfaces/inner_kits/native_cpp/src/ipc/standard/ipc_cmd_parser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -130,10 +130,9 @@ ON_IPC_READ_RESPONSE(GET_LOCAL_DEVICE_INFO, MessageParcel &reply, std::shared_pt { std::shared_ptr pRsp = std::static_pointer_cast(pBaseRsp); DmDeviceInfo *localDeviceInfo = (DmDeviceInfo *)reply.ReadRawData(sizeof(DmDeviceInfo)); - if (localDeviceInfo == nullptr) { - LOGE("write subscribe info failed"); + if (localDeviceInfo != nullptr) { + pRsp->SetLocalDeviceInfo(*localDeviceInfo); } - pRsp->SetLocalDeviceInfo(*localDeviceInfo); pRsp->SetErrCode(reply.ReadInt32()); return DM_OK; } diff --git a/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp b/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp index 9d68e364fe5bc24852ebf5b925a5963f56a94b6b..9eb01d88efea857a89a1db7052b70d337330f560 100644 --- a/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp +++ b/interfaces/inner_kits/native_cpp/src/notify/device_manager_notify.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -238,7 +238,7 @@ void DeviceManagerNotify::OnDiscoverySuccess(const std::string &pkgName, uint16_ void DeviceManagerNotify::OnAuthResult(const std::string &pkgName, const std::string &deviceId, const std::string &token, uint32_t status, uint32_t reason) { - LOGI("DeviceManagerNotify::OnAuthResult pkgName:%s, status:%d, reason:%d", pkgName.c_str(), status, reason); + LOGI("DeviceManagerNotify::OnAuthResult pkgName:%s, status:%d, reason:%u", pkgName.c_str(), status, reason); std::lock_guard autoLock(lock_); if (authenticateCallback_.count(pkgName) == 0) { LOGE("DeviceManager OnAuthResult: no register authCallback for this package"); diff --git a/interfaces/kits/BUILD.gn b/interfaces/kits/BUILD.gn index 725c517af55510212a3da6358dd97d27450ae9fa..8aaf23fbd565bcf3858df83b390615aee71a567c 100644 --- a/interfaces/kits/BUILD.gn +++ b/interfaces/kits/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# 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 diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index c1b70a129bef76416dad027b23f80ef52e5aed36..50833f2c2605402ba6bdcf727651e5263b86d6c4 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# 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 diff --git a/interfaces/kits/js/include/dm_native_event.h b/interfaces/kits/js/include/dm_native_event.h index 3d619bf9912050f18330e1ebe7c4dcc1d7bd7c0b..2eaea548a95105084418f4d25b0a1564ac137925 100644 --- a/interfaces/kits/js/include/dm_native_event.h +++ b/interfaces/kits/js/include/dm_native_event.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/kits/js/include/native_devicemanager_js.h b/interfaces/kits/js/include/native_devicemanager_js.h index 5736c29b64a7804fb00fa936dd36e722e2bd7e1d..443f0be189e7e566f3a80ceaaf747c388a5d3e8a 100644 --- a/interfaces/kits/js/include/native_devicemanager_js.h +++ b/interfaces/kits/js/include/native_devicemanager_js.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/kits/js/src/dm_native_event.cpp b/interfaces/kits/js/src/dm_native_event.cpp index 205fcddc9022f59780fb73983a7621c8d2628f6a..f06dbd1b174ac1d4bb189682ffa4e014c9a7af02 100644 --- a/interfaces/kits/js/src/dm_native_event.cpp +++ b/interfaces/kits/js/src/dm_native_event.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/interfaces/kits/js/src/native_devicemanager_js.cpp b/interfaces/kits/js/src/native_devicemanager_js.cpp index c1bf2b6e2e7a67ca4467d960f96c44eb0d707b41..e07993ec5bd483f98a0ae541810b338b86fe0aac 100644 --- a/interfaces/kits/js/src/native_devicemanager_js.cpp +++ b/interfaces/kits/js/src/native_devicemanager_js.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -454,6 +454,7 @@ void DeviceManagerNapi::OnDeviceStateChange(DmNapiDevStateChangeAction action, napi_value device = nullptr; napi_create_object(env_, &device); SetValueUtf8String(env_, "deviceId", deviceInfo.deviceId, device); + SetValueUtf8String(env_, "networkId", deviceInfo.networkId, device); SetValueUtf8String(env_, "deviceName", deviceInfo.deviceName, device); SetValueInt32(env_, "deviceType", (int)deviceInfo.deviceTypeId, device); @@ -471,6 +472,7 @@ void DeviceManagerNapi::OnDeviceFound(uint16_t subscribeId, const DmDeviceInfo & napi_value device = nullptr; napi_create_object(env_, &device); SetValueUtf8String(env_, "deviceId", deviceInfo.deviceId, device); + SetValueUtf8String(env_, "networkId", deviceInfo.networkId, device); SetValueUtf8String(env_, "deviceName", deviceInfo.deviceName, device); SetValueInt32(env_, "deviceType", (int)deviceInfo.deviceTypeId, device); diff --git a/sa_profile/4802.xml b/sa_profile/4802.xml index d2e77008ed95ef339e8b26fb1085b66e11c3344f..3dba76f0fc0628a30f031fe87ec903454dff1c45 100644 --- a/sa_profile/4802.xml +++ b/sa_profile/4802.xml @@ -1,6 +1,6 @@ 4802 libdevicemanagerservice.z.so - + 4700 true false diff --git a/sa_profile/BUILD.gn b/sa_profile/BUILD.gn index 89d88fa4cb2abe85d6ee559ede2365302407b1f2..6edcf99eb5075577631190b30ae558b9bfcb553a 100644 --- a/sa_profile/BUILD.gn +++ b/sa_profile/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# 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 diff --git a/services/devicemanagerservice/BUILD.gn b/services/devicemanagerservice/BUILD.gn index ba6da08e0826bbce5cc8027b0d06e2cb3f5c42f4..9deff82fc4350723f648bce73669ff9038ba3437 100755 --- a/services/devicemanagerservice/BUILD.gn +++ b/services/devicemanagerservice/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# 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 @@ -93,7 +93,6 @@ if (defined(ohos_lite)) { ] deps = [ - "${common_path}/include/dialog_ui/js:dialog_js_files_etc", "${innerkits_path}/native_cpp:devicemanagersdk", "${utils_path}:devicemanagerutils", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", @@ -101,10 +100,16 @@ if (defined(ohos_lite)) { "//foundation/aafwk/standard/interfaces/innerkits/ability_manager:ability_manager", "//foundation/aafwk/standard/interfaces/innerkits/want:want", "//foundation/aafwk/standard/services/abilitymgr:abilityms", - "//foundation/ace/ace_engine/interfaces/innerkits/ui_service_manager:ui_service_mgr", - "//foundation/windowmanager/wm:libwm", ] + if (!device_manager_base_no_interaction_auth) { + deps += [ + "${common_path}/include/show_confirm_dialog/dialog_ui/js:dialog_js_files_etc", + "//foundation/ace/ace_engine/interfaces/innerkits/ui_service_manager:ui_service_mgr", + "//foundation/windowmanager/wm:libwm", + ] + defines += [ "SUPPORT_GRAPHICS" ] + } external_deps = [ "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", diff --git a/services/devicemanagerservice/include/ability/dm_ability_manager.h b/services/devicemanagerservice/include/ability/dm_ability_manager.h index 64c27a5e5bffaf97a5f0db3099c61e611c2404bd..cc8557b0a3d0012e830003859c4039fa9472bb63 100644 --- a/services/devicemanagerservice/include/ability/dm_ability_manager.h +++ b/services/devicemanagerservice/include/ability/dm_ability_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -45,7 +45,7 @@ public: void StartAbilityDone(); private: - void waitForTimeout(uint32_t timeout_s); + void WaitForTimeout(uint32_t timeout_s); private: sem_t mSem_; diff --git a/services/devicemanagerservice/include/adapter/crypto_adapter.h b/services/devicemanagerservice/include/adapter/crypto_adapter.h index 137d0b11086cc6f357a89f4fe7e7c0078f7fea62..b8be0249e7214f852fb87b26035c84b0abaab454 100644 --- a/services/devicemanagerservice/include/adapter/crypto_adapter.h +++ b/services/devicemanagerservice/include/adapter/crypto_adapter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/adapter/decision_adapter.h b/services/devicemanagerservice/include/adapter/decision_adapter.h index 4c6a35f2823b699989f9c81a3a1f67e7c37a4582..9549820d199eb2a370652b9a1acbebfec96db419 100644 --- a/services/devicemanagerservice/include/adapter/decision_adapter.h +++ b/services/devicemanagerservice/include/adapter/decision_adapter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/adapter/dm_adapter_manager.h b/services/devicemanagerservice/include/adapter/dm_adapter_manager.h index b290e83675c77685bf62e26b56d5b6a78cf7376f..362a221e0d24256b311d3d5dcb2c1070a5862d59 100644 --- a/services/devicemanagerservice/include/adapter/dm_adapter_manager.h +++ b/services/devicemanagerservice/include/adapter/dm_adapter_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/adapter/profile_adapter.h b/services/devicemanagerservice/include/adapter/profile_adapter.h index d700a5c7669935bd18287a8a61b0386b402e1912..8e872b71bd81a8ffadba224b42ce3dd4b20c6c62 100644 --- a/services/devicemanagerservice/include/adapter/profile_adapter.h +++ b/services/devicemanagerservice/include/adapter/profile_adapter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/authentication/auth_message_processor.h b/services/devicemanagerservice/include/authentication/auth_message_processor.h index 5bc633bc9f39fea8c963bd50a81626dd4bd0aad0..2ebe46b71e4ebfc047937a7a258883129facebeb 100644 --- a/services/devicemanagerservice/include/authentication/auth_message_processor.h +++ b/services/devicemanagerservice/include/authentication/auth_message_processor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/authentication/auth_request_state.h b/services/devicemanagerservice/include/authentication/auth_request_state.h index 81c98308dd7468d624625fd953db14230c5fb136..9e4f99218a5819d34f3a5efdaec5d2ca838e96a7 100644 --- a/services/devicemanagerservice/include/authentication/auth_request_state.h +++ b/services/devicemanagerservice/include/authentication/auth_request_state.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/authentication/auth_response_state.h b/services/devicemanagerservice/include/authentication/auth_response_state.h index f4d67bae16285f720455d477f73da99d6fbd1375..a3ad102975a6f1c8572e3435aadb8895c6a3623a 100644 --- a/services/devicemanagerservice/include/authentication/auth_response_state.h +++ b/services/devicemanagerservice/include/authentication/auth_response_state.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/authentication/auth_ui.h b/services/devicemanagerservice/include/authentication/auth_ui.h index 4ba96cb50c9680afaa424212760915ad8bf64968..a35b5dd7d98bdb4503c24ea2987d3118b22e7a7e 100644 --- a/services/devicemanagerservice/include/authentication/auth_ui.h +++ b/services/devicemanagerservice/include/authentication/auth_ui.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/authentication/authentication.h b/services/devicemanagerservice/include/authentication/authentication.h index 7c59f31c49fe03087aa33a5f99a1ab6663f45866..f73ca272450e1b6cbd1f9871217af08c5b0d2259 100644 --- a/services/devicemanagerservice/include/authentication/authentication.h +++ b/services/devicemanagerservice/include/authentication/authentication.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/authentication/dm_auth_manager.h b/services/devicemanagerservice/include/authentication/dm_auth_manager.h index 9e1dd3b69b87226ad14636df7e4f07bcac202678..8a73fe200cb302ba463bc545a1f0cc593ba538d5 100644 --- a/services/devicemanagerservice/include/authentication/dm_auth_manager.h +++ b/services/devicemanagerservice/include/authentication/dm_auth_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/config/dm_config_manager.h b/services/devicemanagerservice/include/config/dm_config_manager.h index 4a410a1e7616838f97b01a2380f923a0e92366aa..18647186eb1834bae7a1b9dc2aff2fe6a89373b1 100644 --- a/services/devicemanagerservice/include/config/dm_config_manager.h +++ b/services/devicemanagerservice/include/config/dm_config_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/config/json_config.h b/services/devicemanagerservice/include/config/json_config.h index 04c929323feca02bff158421aef27ba12ff72efe..817af97cb03d1e9a2c023ce6f1d2e64cab055b3c 100644 --- a/services/devicemanagerservice/include/config/json_config.h +++ b/services/devicemanagerservice/include/config/json_config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -79,6 +79,15 @@ const std::string authJsonConfigString = "funcName": "CreateNfcAuthObject", "soName": "libdevicemanager_nfcauth.z.so", "soPath": "/system/lib/" + }, + { + "name": "no_interaction_auth", + "type": "AUTHENTICATE", + "version": "1.0", + "authType": 4, + "funcName": "CreatePinAuthObject", + "soName": "libdevicemanagerext_no_interaction_auth.z.so", + "soPath": "/system/lib/" } ] })"; diff --git a/services/devicemanagerservice/include/dependency/commonevent/dm_common_event_manager.h b/services/devicemanagerservice/include/dependency/commonevent/dm_common_event_manager.h index 81d51bb2a6482ffc0f1d329b4cb260503905db5f..2f147ebc09ff13742a7a38579cc35e61ca668b0f 100644 --- a/services/devicemanagerservice/include/dependency/commonevent/dm_common_event_manager.h +++ b/services/devicemanagerservice/include/dependency/commonevent/dm_common_event_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/dependency/hichain/hichain_connector.h b/services/devicemanagerservice/include/dependency/hichain/hichain_connector.h index 6c19fe3fd23f4a89671d3f865536ea078b3104f2..35f4b80c78ee5eba12bccd1a489500844c1851bc 100644 --- a/services/devicemanagerservice/include/dependency/hichain/hichain_connector.h +++ b/services/devicemanagerservice/include/dependency/hichain/hichain_connector.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/dependency/hichain/hichain_connector_callback.h b/services/devicemanagerservice/include/dependency/hichain/hichain_connector_callback.h index f6504949a50d3a82208b775c24e5042c8e65cfcb..a5c573e2d2bb80b7e9731dd1bc14b72cfb17b4e3 100644 --- a/services/devicemanagerservice/include/dependency/hichain/hichain_connector_callback.h +++ b/services/devicemanagerservice/include/dependency/hichain/hichain_connector_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/dependency/multipleuser/multiple_user_connector.h b/services/devicemanagerservice/include/dependency/multipleuser/multiple_user_connector.h index 9bcb63b6ad536a13c3fdd8a6904ed8922af6a059..d56fce8d3ae6b581dc9e2f90fa0d60c2b6cf5a77 100644 --- a/services/devicemanagerservice/include/dependency/multipleuser/multiple_user_connector.h +++ b/services/devicemanagerservice/include/dependency/multipleuser/multiple_user_connector.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/dependency/softbus/softbus_connector.h b/services/devicemanagerservice/include/dependency/softbus/softbus_connector.h index a957f42a83d211cfe2e686401bc6fa317c027f99..830e6e81ce25d1e0dd621a1e62dfb3fd794b3033 100644 --- a/services/devicemanagerservice/include/dependency/softbus/softbus_connector.h +++ b/services/devicemanagerservice/include/dependency/softbus/softbus_connector.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/dependency/softbus/softbus_discovery_callback.h b/services/devicemanagerservice/include/dependency/softbus/softbus_discovery_callback.h index c8b1f57cd514be32caaa04a9bca3ed1e10cc7f0b..87b78649365527dcbff9543ccb4027e7aa4fad3b 100644 --- a/services/devicemanagerservice/include/dependency/softbus/softbus_discovery_callback.h +++ b/services/devicemanagerservice/include/dependency/softbus/softbus_discovery_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/dependency/softbus/softbus_session.h b/services/devicemanagerservice/include/dependency/softbus/softbus_session.h index 2eab337e692ca65a2ae63244959faa744c7c644c..6fa4e2f882cef0a70dd6df11df71a22235657470 100644 --- a/services/devicemanagerservice/include/dependency/softbus/softbus_session.h +++ b/services/devicemanagerservice/include/dependency/softbus/softbus_session.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/dependency/softbus/softbus_session_callback.h b/services/devicemanagerservice/include/dependency/softbus/softbus_session_callback.h index 207928fd7d16025073a2ea939454feea582d6322..c2999f8b8a9522e171644ecc7691b0ab0445a86e 100644 --- a/services/devicemanagerservice/include/dependency/softbus/softbus_session_callback.h +++ b/services/devicemanagerservice/include/dependency/softbus/softbus_session_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/dependency/softbus/softbus_state_callback.h b/services/devicemanagerservice/include/dependency/softbus/softbus_state_callback.h index 15a08a2e345a787aec759d734ef2673ff4154f0e..9c49750ea84e7f180f6ee6eef96f388867f0ae4f 100644 --- a/services/devicemanagerservice/include/dependency/softbus/softbus_state_callback.h +++ b/services/devicemanagerservice/include/dependency/softbus/softbus_state_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/dependency/timer/dm_timer.h b/services/devicemanagerservice/include/dependency/timer/dm_timer.h index a4ffec0fdddc84600365578547bde4c5f67e169c..ebb4886cb8aa794fcc695b8611615394f2abcfe2 100644 --- a/services/devicemanagerservice/include/dependency/timer/dm_timer.h +++ b/services/devicemanagerservice/include/dependency/timer/dm_timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/device_manager_service.h b/services/devicemanagerservice/include/device_manager_service.h index d5e63692861a9a54f863e885d19ee4bedd5e9969..54847d1c2ab87f29ae74c79d0dd98ac8ccbc3a04 100644 --- a/services/devicemanagerservice/include/device_manager_service.h +++ b/services/devicemanagerservice/include/device_manager_service.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/device_manager_service_listener.h b/services/devicemanagerservice/include/device_manager_service_listener.h index e52d9ed7300ed939a0f626fbe4d316c76f908377..0f5112ae77b6b8a51413b062699c67b090ad614c 100644 --- a/services/devicemanagerservice/include/device_manager_service_listener.h +++ b/services/devicemanagerservice/include/device_manager_service_listener.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/deviceinfo/dm_device_info_manager.h b/services/devicemanagerservice/include/deviceinfo/dm_device_info_manager.h index 9a9fbfc515bb2229fd343d5231e2ab064d4839f4..91d4b6c28deaacb0392dd8b5b326ec1f7d7dfeef 100644 --- a/services/devicemanagerservice/include/deviceinfo/dm_device_info_manager.h +++ b/services/devicemanagerservice/include/deviceinfo/dm_device_info_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/devicestate/dm_device_state_manager.h b/services/devicemanagerservice/include/devicestate/dm_device_state_manager.h index 7817313fc7a3af962550f2886f9560afa8ee4cbc..bf931f3d9a4f3645ad5e395ab1f9cfb4efeba618 100755 --- a/services/devicemanagerservice/include/devicestate/dm_device_state_manager.h +++ b/services/devicemanagerservice/include/devicestate/dm_device_state_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/discovery/dm_discovery_manager.h b/services/devicemanagerservice/include/discovery/dm_discovery_manager.h index c7381387bf6bd124543239be846269de05e550e3..eead18dd906a0b3bb11851c012cc37eb650d1910 100644 --- a/services/devicemanagerservice/include/discovery/dm_discovery_manager.h +++ b/services/devicemanagerservice/include/discovery/dm_discovery_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/ipc/lite/ipc_server_listener.h b/services/devicemanagerservice/include/ipc/lite/ipc_server_listener.h index 4cf1b62ce5666a0a86f729fcc3f9090cdd9fcfbe..dd91c43cbe45f61d5944690312ef63b212918c81 100644 --- a/services/devicemanagerservice/include/ipc/lite/ipc_server_listener.h +++ b/services/devicemanagerservice/include/ipc/lite/ipc_server_listener.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/ipc/lite/ipc_server_listenermgr.h b/services/devicemanagerservice/include/ipc/lite/ipc_server_listenermgr.h index 2d0ed61c4b32e29d3d674799a17dfbdc57540eeb..e1742325d4230c675c7ece669bf085c073d2da02 100644 --- a/services/devicemanagerservice/include/ipc/lite/ipc_server_listenermgr.h +++ b/services/devicemanagerservice/include/ipc/lite/ipc_server_listenermgr.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/ipc/lite/ipc_server_stub.h b/services/devicemanagerservice/include/ipc/lite/ipc_server_stub.h index fc22d94711a22cd24a54c100403e4da3d7b7121b..f8473fdd020bd23dfdd71149caa481249659987f 100644 --- a/services/devicemanagerservice/include/ipc/lite/ipc_server_stub.h +++ b/services/devicemanagerservice/include/ipc/lite/ipc_server_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/ipc/standard/ipc_server_client_proxy.h b/services/devicemanagerservice/include/ipc/standard/ipc_server_client_proxy.h index 27d02a0178188bf04e588b58046c12fed4ae9f42..022a007f82f210c0a139785cc08d5cae5b338dd9 100644 --- a/services/devicemanagerservice/include/ipc/standard/ipc_server_client_proxy.h +++ b/services/devicemanagerservice/include/ipc/standard/ipc_server_client_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/ipc/standard/ipc_server_listener.h b/services/devicemanagerservice/include/ipc/standard/ipc_server_listener.h index 1ee6680b9b01795fac399c7b3a4a8ef4904ff5b4..b9c76ddd4d675552f9bec4a05749da7a99472b97 100644 --- a/services/devicemanagerservice/include/ipc/standard/ipc_server_listener.h +++ b/services/devicemanagerservice/include/ipc/standard/ipc_server_listener.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/include/ipc/standard/ipc_server_stub.h b/services/devicemanagerservice/include/ipc/standard/ipc_server_stub.h index 93d0f7878bd5190dfcbf4cba21a1cc959369e528..cad61e746f64162319cdc0b07cbd17f248733951 100644 --- a/services/devicemanagerservice/include/ipc/standard/ipc_server_stub.h +++ b/services/devicemanagerservice/include/ipc/standard/ipc_server_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/ability/lite/dm_ability_manager.cpp b/services/devicemanagerservice/src/ability/lite/dm_ability_manager.cpp index fed65776c76e2d993accfce7eb5dc0668c6b6cc7..c90a5e8618e4f87c1c896263a976a94a69ed5bf0 100644 --- a/services/devicemanagerservice/src/ability/lite/dm_ability_manager.cpp +++ b/services/devicemanagerservice/src/ability/lite/dm_ability_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -32,7 +32,7 @@ AbilityStatus DmAbilityManager::StartAbility(AbilityRole role) return mStatus_; } -void DmAbilityManager::waitForTimeout(uint32_t timeout_s) +void DmAbilityManager::WaitForTimeout(uint32_t timeout_s) { struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); diff --git a/services/devicemanagerservice/src/ability/standard/dm_ability_manager.cpp b/services/devicemanagerservice/src/ability/standard/dm_ability_manager.cpp index a4916043b0223eedfc13f0fa6f83c45f7e7db8e9..2059069c6e0dcbadc93063fdf8051294050d3130 100644 --- a/services/devicemanagerservice/src/ability/standard/dm_ability_manager.cpp +++ b/services/devicemanagerservice/src/ability/standard/dm_ability_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -54,11 +54,11 @@ AbilityStatus DmAbilityManager::StartAbility(AbilityRole role) mStatus_ = AbilityStatus::ABILITY_STATUS_FAILED; return mStatus_; } - waitForTimeout(ABILITY_START_TIMEOUT); + WaitForTimeout(ABILITY_START_TIMEOUT); return mStatus_; } -void DmAbilityManager::waitForTimeout(uint32_t timeout_s) +void DmAbilityManager::WaitForTimeout(uint32_t timeout_s) { struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); diff --git a/services/devicemanagerservice/src/adapter/lite/dm_adapter_manager.cpp b/services/devicemanagerservice/src/adapter/lite/dm_adapter_manager.cpp index 9cca6510986513d820768192558861880f128209..0f583d30498b69f363d80ec4850d4aa897d68bc5 100644 --- a/services/devicemanagerservice/src/adapter/lite/dm_adapter_manager.cpp +++ b/services/devicemanagerservice/src/adapter/lite/dm_adapter_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/adapter/standard/dm_adapter_manager.cpp b/services/devicemanagerservice/src/adapter/standard/dm_adapter_manager.cpp index e93ca820517f5df2e563f1736b59df921db64fb5..6256f00d300b04740144fc31fc51286b7e1ef78d 100644 --- a/services/devicemanagerservice/src/adapter/standard/dm_adapter_manager.cpp +++ b/services/devicemanagerservice/src/adapter/standard/dm_adapter_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/authentication/auth_message_processor.cpp b/services/devicemanagerservice/src/authentication/auth_message_processor.cpp index 77c7126ad642f8270a2cfca5aed5db5110448b72..a9bd110b992be43a7bd1b6a8ed4b47e56e15fa86 100644 --- a/services/devicemanagerservice/src/authentication/auth_message_processor.cpp +++ b/services/devicemanagerservice/src/authentication/auth_message_processor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/authentication/auth_request_state.cpp b/services/devicemanagerservice/src/authentication/auth_request_state.cpp index 7b6797cbcea17fa4fb345e12b66255ec1f454ba3..7380886493bbd8f528adc1d73b2af53c5686bb1d 100644 --- a/services/devicemanagerservice/src/authentication/auth_request_state.cpp +++ b/services/devicemanagerservice/src/authentication/auth_request_state.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/authentication/auth_response_state.cpp b/services/devicemanagerservice/src/authentication/auth_response_state.cpp index 14f7c2c3bb25c259435e4c9b583ba708e4e0f2df..c2725a515ac61313384bb09a314e766b1cd860e2 100644 --- a/services/devicemanagerservice/src/authentication/auth_response_state.cpp +++ b/services/devicemanagerservice/src/authentication/auth_response_state.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/authentication/auth_ui.cpp b/services/devicemanagerservice/src/authentication/auth_ui.cpp index b3afce4537a85d43c4046347277ef0b71f0cacfd..a42e1b38fdb9d0e051e50c68e9b0dbea2e3c5b22 100644 --- a/services/devicemanagerservice/src/authentication/auth_ui.cpp +++ b/services/devicemanagerservice/src/authentication/auth_ui.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp b/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp index b45af3e11c017a9a73d6c84043f30f450e869dc4..bdb2f20483ab8bb98dc772a94f9d7fd33d820296 100644 --- a/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp +++ b/services/devicemanagerservice/src/authentication/dm_auth_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -25,9 +25,11 @@ #include "multiple_user_connector.h" #include "nlohmann/json.hpp" #include "parameter.h" +#ifdef SUPPORT_GRAPHICS #include "ui_service_mgr_client.h" #include "dialog_callback_stub.h" #include "dialog_callback.h" +#endif namespace OHOS { namespace DistributedHardware { @@ -249,72 +251,83 @@ void DmAuthManager::OnSessionClosed(int32_t sessionId) void DmAuthManager::OnDataReceived(int32_t sessionId, std::string message) { - LOGI("DmAuthManager::OnDataReceived start"); - if (authRequestState_ == nullptr && authResponseState_ == nullptr) { - LOGI("DmAuthManager::GetAuthState failed"); + if (authResponseContext_ == nullptr || authMessageProcessor_ == nullptr) { + LOGE("OnDataReceived failed, authResponseContext or authMessageProcessor_ is nullptr."); return; } + authResponseContext_->sessionId = sessionId; authMessageProcessor_->SetResponseContext(authResponseContext_); int32_t ret = authMessageProcessor_->ParseMessage(message); if (ret != DM_OK) { - LOGE("OnDataReceived, parse message error"); + LOGE("OnDataReceived failed, parse input message error."); return; } - authResponseContext_ = authMessageProcessor_->GetResponseContext(); - if (authResponseState_ == nullptr) { + + if ((authRequestState_ != nullptr) && (authResponseState_ == nullptr)) { + // source device auth process authRequestContext_ = authMessageProcessor_->GetRequestContext(); authRequestState_->SetAuthContext(authRequestContext_); - } else { + LOGI("OnDataReceived for source device, authResponseContext msgType=%d, authRequestState stateType=%d", + authResponseContext_->msgType, authRequestState_->GetStateType()); + + switch (authResponseContext_->msgType) { + case MSG_TYPE_RESP_AUTH: + if (authRequestState_->GetStateType() == AuthState::AUTH_REQUEST_NEGOTIATE_DONE) { + authRequestState_->TransitionTo(std::make_shared()); + } + break; + case MSG_TYPE_RESP_NEGOTIATE: + if (authRequestState_->GetStateType() == AuthState::AUTH_REQUEST_NEGOTIATE) { + authRequestState_->TransitionTo(std::make_shared()); + } + break; + case MSG_TYPE_REQ_AUTH_TERMINATE: + if (authRequestState_->GetStateType() != AuthState::AUTH_REQUEST_FINISH) { + isFinishOfLocal_ = false; + authResponseContext_->state = authRequestState_->GetStateType(); + authRequestState_->TransitionTo(std::make_shared()); + } + break; + default: + break; + } + } else if ((authResponseState_ != nullptr) && (authRequestState_ == nullptr)) { + // sink device auth process authResponseState_->SetAuthContext(authResponseContext_); - } - switch (authResponseContext_->msgType) { - case MSG_TYPE_NEGOTIATE: - if (authResponseState_->GetStateType() == AuthState::AUTH_RESPONSE_INIT - && timerMap_.find(WAIT_NEGOTIATE_TIMEOUT_TASK) != timerMap_.end()) { - timerMap_[WAIT_NEGOTIATE_TIMEOUT_TASK]->Stop(SESSION_CANCEL_TIMEOUT); - authResponseState_->TransitionTo(std::make_shared()); - } else { - LOGE("Device manager auth state error"); - } - break; - case MSG_TYPE_REQ_AUTH: - if (authResponseState_->GetStateType() == AuthState::AUTH_RESPONSE_NEGOTIATE - && timerMap_.find(WAIT_REQUEST_TIMEOUT_TASK) != timerMap_.end()) { - timerMap_[WAIT_REQUEST_TIMEOUT_TASK]->Stop(SESSION_CANCEL_TIMEOUT); - authResponseState_->TransitionTo(std::make_shared()); - } else { - LOGE("Device manager auth state error"); - } - break; - case MSG_TYPE_RESP_AUTH: - if (authRequestState_->GetStateType() == AuthState::AUTH_REQUEST_NEGOTIATE_DONE) { - authRequestState_->TransitionTo(std::make_shared()); - } else { - LOGE("Device manager auth state error"); - } - break; - case MSG_TYPE_RESP_NEGOTIATE: - if (authRequestState_->GetStateType() == AuthState::AUTH_REQUEST_NEGOTIATE) { - authRequestState_->TransitionTo(std::make_shared()); - } else { - LOGE("Device manager auth state error"); - } - break; - case MSG_TYPE_REQ_AUTH_TERMINATE: - if (authResponseState_ != nullptr && - authResponseState_->GetStateType() != AuthState::AUTH_RESPONSE_FINISH) { - isFinishOfLocal_ = false; - authResponseState_->TransitionTo(std::make_shared()); - } else if (authRequestState_ != nullptr && - authRequestState_->GetStateType() != AuthState::AUTH_REQUEST_FINISH) { - isFinishOfLocal_ = false; - authResponseContext_->state = authRequestState_->GetStateType(); - authRequestState_->TransitionTo(std::make_shared()); - } - break; - default: - break; + LOGI("OnDataReceived for sink device, authResponseContext msgType=%d, authResponseState stateType=%d", + authResponseContext_->msgType, authResponseState_->GetStateType()); + + switch (authResponseContext_->msgType) { + case MSG_TYPE_NEGOTIATE: + if (authResponseState_->GetStateType() == AuthState::AUTH_RESPONSE_INIT + && timerMap_.find(WAIT_NEGOTIATE_TIMEOUT_TASK) != timerMap_.end()) { + timerMap_[WAIT_NEGOTIATE_TIMEOUT_TASK]->Stop(SESSION_CANCEL_TIMEOUT); + authResponseState_->TransitionTo(std::make_shared()); + } else { + LOGE("Device manager auth state error"); + } + break; + case MSG_TYPE_REQ_AUTH: + if (authResponseState_->GetStateType() == AuthState::AUTH_RESPONSE_NEGOTIATE + && timerMap_.find(WAIT_REQUEST_TIMEOUT_TASK) != timerMap_.end()) { + timerMap_[WAIT_REQUEST_TIMEOUT_TASK]->Stop(SESSION_CANCEL_TIMEOUT); + authResponseState_->TransitionTo(std::make_shared()); + } else { + LOGE("Device manager auth state error"); + } + break; + case MSG_TYPE_REQ_AUTH_TERMINATE: + if (authResponseState_->GetStateType() != AuthState::AUTH_RESPONSE_FINISH) { + isFinishOfLocal_ = false; + authResponseState_->TransitionTo(std::make_shared()); + } + break; + default: + break; + } + } else { + LOGE("DmAuthManager::OnDataReceived failed, authRequestState_ or authResponseState_ is invalid."); } } @@ -544,7 +557,9 @@ int32_t DmAuthManager::AddMember(const std::string &deviceId) return DM_FAILED; } LOGI("DmAuthManager::authRequestContext CancelDisplay start"); +#ifdef SUPPORT_GRAPHICS Ace::UIServiceMgrClient::GetInstance()->CancelDialog(authResponseContext_->pageId); +#endif return DM_OK; } @@ -572,6 +587,7 @@ int32_t DmAuthManager::JoinNetwork() void DmAuthManager::AuthenticateFinish() { LOGI("DmAuthManager::AuthenticateFinish start"); +#ifdef SUPPORT_GRAPHICS if (authResponseState_ != nullptr) { if (authResponseState_->GetStateType() == AuthState::AUTH_RESPONSE_FINISH) { Ace::UIServiceMgrClient::GetInstance()->CancelDialog(authResponseContext_->pageId); @@ -621,6 +637,7 @@ void DmAuthManager::AuthenticateFinish() authRequestState_ = nullptr; authMessageProcessor_ = nullptr; } +#endif LOGI("DmAuthManager::AuthenticateFinish complete"); } @@ -693,6 +710,7 @@ int32_t DmAuthManager::GetPinCode() void DmAuthManager::ShowConfigDialog() { +#ifdef SUPPORT_GRAPHICS LOGI("ShowConfigDialog start"); nlohmann::json jsonObj; jsonObj[TAG_AUTH_TYPE] = AUTH_TYPE_PIN; @@ -713,7 +731,8 @@ void DmAuthManager::ShowConfigDialog() authMgr_->StartAuthProcess(atoi(params.c_str())); }); LOGI("ShowConfigDialog end"); -} +#endif + } void DmAuthManager::ShowAuthInfoDialog() { diff --git a/services/devicemanagerservice/src/config/dm_config_manager.cpp b/services/devicemanagerservice/src/config/dm_config_manager.cpp index b91a09276adbacb0105ada63d00fb711f43f172c..6c0a8fc95d9b782c8521b365344f5b73181ab6ee 100644 --- a/services/devicemanagerservice/src/config/dm_config_manager.cpp +++ b/services/devicemanagerservice/src/config/dm_config_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/dependency/commonevent/dm_common_event_manager.cpp b/services/devicemanagerservice/src/dependency/commonevent/dm_common_event_manager.cpp index 798174abeb67fe7efb59906ce2d3bc18bc7001d5..5aeb131953d3ddfe055f6f28c393a476de04b7f5 100644 --- a/services/devicemanagerservice/src/dependency/commonevent/dm_common_event_manager.cpp +++ b/services/devicemanagerservice/src/dependency/commonevent/dm_common_event_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/dependency/hichain/hichain_connector.cpp b/services/devicemanagerservice/src/dependency/hichain/hichain_connector.cpp index dd4afeb86adcd5c1bd8604daf978477f2b0bf78e..ce60e6b8de154eef96e4786255ccf7e83cf0d12e 100644 --- a/services/devicemanagerservice/src/dependency/hichain/hichain_connector.cpp +++ b/services/devicemanagerservice/src/dependency/hichain/hichain_connector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -161,7 +161,7 @@ int32_t HiChainConnector::GetGroupInfo(std::string queryParams, std::vectordestroyInfo(&groupVec); nlohmann::json jsonObject = nlohmann::json::parse(relatedGroups); @@ -188,7 +188,7 @@ int32_t HiChainConnector::GetGroupInfo(const int32_t userId, std::string queryPa return false; } if (groupVec == nullptr) { - LOGE("HiChainConnector::GetGroupInfo failed , returnGroups is nullptr"); + LOGE("HiChainConnector::GetGroupInfo failed , returnGroups is nullptr."); return false; } if (num == 0) { diff --git a/services/devicemanagerservice/src/dependency/multipleuser/multiple_user_connector.cpp b/services/devicemanagerservice/src/dependency/multipleuser/multiple_user_connector.cpp index 4168ce99e76bc27fcbde613d5885c5f965145e1f..538889538215707503f44981ad67e30444b56f7a 100644 --- a/services/devicemanagerservice/src/dependency/multipleuser/multiple_user_connector.cpp +++ b/services/devicemanagerservice/src/dependency/multipleuser/multiple_user_connector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp b/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp index a202a09d7773064c192ac7c0bc7bc80494bee014..60b641223a756d07abd0ec58fd32f6d360882a60 100644 --- a/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp +++ b/services/devicemanagerservice/src/dependency/softbus/softbus_connector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -414,6 +414,12 @@ int32_t SoftbusConnector::CovertNodeBasicInfoToDmDevice(const NodeBasicInfo &nod std::min(sizeof(dmDeviceInfo.deviceId), sizeof(nodeBasicInfo.networkId))) != DM_OK) { LOGE("copy data failed"); } + + if (memcpy_s(dmDeviceInfo.networkId, sizeof(dmDeviceInfo.networkId), nodeBasicInfo.networkId, + std::min(sizeof(dmDeviceInfo.networkId), sizeof(nodeBasicInfo.networkId))) != DM_OK) { + LOGE("copy data failed"); + } + if (memcpy_s(dmDeviceInfo.deviceName, sizeof(dmDeviceInfo.deviceName), nodeBasicInfo.deviceName, std::min(sizeof(dmDeviceInfo.deviceName), sizeof(nodeBasicInfo.deviceName))) != DM_OK) { LOGE("copy data failed"); @@ -429,6 +435,12 @@ void SoftbusConnector::CovertDeviceInfoToDmDevice(const DeviceInfo &deviceInfo, std::min(sizeof(dmDeviceInfo.deviceId), sizeof(deviceInfo.devId))) != DM_OK) { LOGE("copy data failed"); } + + if (memcpy_s(dmDeviceInfo.networkId, sizeof(dmDeviceInfo.networkId), 0, + sizeof(dmDeviceInfo.networkId)) != DM_OK) { + LOGE("copy data failed"); + } + if (memcpy_s(dmDeviceInfo.deviceName, sizeof(dmDeviceInfo.deviceName), deviceInfo.devName, std::min(sizeof(dmDeviceInfo.deviceName), sizeof(deviceInfo.devName))) != DM_OK) { LOGE("copy data failed"); diff --git a/services/devicemanagerservice/src/dependency/softbus/softbus_session.cpp b/services/devicemanagerservice/src/dependency/softbus/softbus_session.cpp index 8d4b557953fa548a78dfe196ba68d5d453c8fdd7..30bca8c324b99f63758deca58dd55a2a9e0c8ecb 100644 --- a/services/devicemanagerservice/src/dependency/softbus/softbus_session.cpp +++ b/services/devicemanagerservice/src/dependency/softbus/softbus_session.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp b/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp index c4f95b94eb19988f25a217d2235ed957075fa25a..10f95633398067b342ac4b4feed28352ef043bac 100644 --- a/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp +++ b/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -126,9 +126,8 @@ int32_t DmTimer::CreateTimeFd() return DM_STATUS_FINISH; } LOGI("DmTimer %s creatTimeFd", mTimerName_.c_str()); - int ret = 0; - ret = pipe(mTimeFd_); + int ret = pipe(mTimeFd_); if (ret < 0) { LOGE("DmTimer %s CreateTimeFd fail:(%d) errno(%d)", mTimerName_.c_str(), ret, errno); return ret; diff --git a/services/devicemanagerservice/src/device_manager_service.cpp b/services/devicemanagerservice/src/device_manager_service.cpp index cda681629c4ac9db5dee1f4785e55dff8109a551..dbe3c4bef695cba7278d1c9799cea31a53c36727 100644 --- a/services/devicemanagerservice/src/device_manager_service.cpp +++ b/services/devicemanagerservice/src/device_manager_service.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/device_manager_service_listener.cpp b/services/devicemanagerservice/src/device_manager_service_listener.cpp index 432481830ed686ee0e793095c630780c4c82025b..c3d7be1f566be3824099438e0c245c3d4ef1603c 100644 --- a/services/devicemanagerservice/src/device_manager_service_listener.cpp +++ b/services/devicemanagerservice/src/device_manager_service_listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -46,7 +46,7 @@ void DeviceManagerServiceListener::OnDeviceStateChange(const std::string &pkgNam void DeviceManagerServiceListener::OnDeviceFound(const std::string &pkgName, uint16_t subscribeId, const DmDeviceInfo &info) { - LOGI("call OnDeviceFound for %s, originId %d, deviceId %s", pkgName.c_str(), subscribeId, + LOGI("call OnDeviceFound for %s, originId %hu, deviceId %s", pkgName.c_str(), subscribeId, GetAnonyString(std::string(info.deviceId)).c_str()); std::shared_ptr pReq = std::make_shared(); std::shared_ptr pRsp = std::make_shared(); diff --git a/services/devicemanagerservice/src/deviceinfo/dm_device_info_manager.cpp b/services/devicemanagerservice/src/deviceinfo/dm_device_info_manager.cpp index 5138eb9002e5a6e9234696840a9e7c22a7bbbf0a..37e9da3274c6632f3e37ecf8f105969349d9e825 100644 --- a/services/devicemanagerservice/src/deviceinfo/dm_device_info_manager.cpp +++ b/services/devicemanagerservice/src/deviceinfo/dm_device_info_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/devicestate/dm_device_state_manager.cpp b/services/devicemanagerservice/src/devicestate/dm_device_state_manager.cpp index 1cef6db5644e8e04a502580e21820ae27e4a98a5..c23c3e147d9864c40d85462d73ada7b8c2261d4d 100755 --- a/services/devicemanagerservice/src/devicestate/dm_device_state_manager.cpp +++ b/services/devicemanagerservice/src/devicestate/dm_device_state_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/discovery/dm_discovery_manager.cpp b/services/devicemanagerservice/src/discovery/dm_discovery_manager.cpp index f4f0d6837a9f3784a93a4392537db9714e879555..4ce1fdefc672a03e943a0a7c535aac256ba4cf5e 100644 --- a/services/devicemanagerservice/src/discovery/dm_discovery_manager.cpp +++ b/services/devicemanagerservice/src/discovery/dm_discovery_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -27,7 +27,7 @@ const int32_t SESSION_CANCEL_TIMEOUT = 0; static void TimeOut(void *data, DmTimer& timer) { - LOGE("time out "); + LOGE("time out"); DmDiscoveryManager *discoveryMgr = (DmDiscoveryManager *)data; if (discoveryMgr == nullptr) { LOGE("time out error"); diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp index 6e14961b372fb70bf8f008de6d6064e8c27a888b..b390d80f05929c3c812c8488b235364a71813e9a 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_cmd_parser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_server_listener.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_server_listener.cpp index 8238a4484b7f9ce177f02d50b5fe236a24ef840c..5f29386cd0b973e096fabb371aed5ab9eb9cd1f5 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_server_listener.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_server_listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_server_listenermgr.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_server_listenermgr.cpp index c223a0104624c3ee158f423e7353a53562557b98..5e78716024fccd0e9fa357511fdd42bfd9026839 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_server_listenermgr.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_server_listenermgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_server_main.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_server_main.cpp index e4373c2ad2fcc52596c318129d31308bab2a0bf5..0f808c289ab58a3fc465fba270540b5d606585ef 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_server_main.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_server_main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -20,7 +20,7 @@ int32_t main(int32_t argc, char *argv[]) { (void)argc; (void)argv; - while (1) { + while (true) { pause(); } return 0; diff --git a/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp b/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp index 1a09f1cb6a15df237dab7c1b785d4cf4ea4e645e..7e5805940860f690711af8f28d2c100617afc5bc 100644 --- a/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp +++ b/services/devicemanagerservice/src/ipc/lite/ipc_server_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -51,7 +51,7 @@ static int32_t DeathCb(const IpcContext *context, void *ipcMsg, IpcIo *data, voi (void)context; (void)ipcMsg; (void)data; - if (arg == NULL) { + if (arg == nullptr) { LOGE("package name is NULL."); return DM_INVALID_VALUE; } @@ -60,12 +60,12 @@ static int32_t DeathCb(const IpcContext *context, void *ipcMsg, IpcIo *data, voi if (IpcServerListenermgr::GetInstance().GetListenerByPkgName(pkgName, &svcId) != DM_OK) { LOGE("not found client by package name."); free(arg); - arg = NULL; + arg = nullptr; return DM_FAILED; } IpcServerListenermgr::GetInstance().UnregisterListener(pkgName); free(arg); - arg = NULL; + arg = nullptr; #ifdef __LINUX__ BinderRelease(svcId.ipcCtx, svcId.handle); #endif @@ -83,7 +83,7 @@ int32_t RegisterDeviceManagerListener(IpcIo *req, IpcIo *reply) size_t len = 0; uint8_t *name = IpcIoPopString(req, &len); SvcIdentity *svc = IpcIoPopSvc(req); - if (name == NULL || svc == NULL || len == 0) { + if (name == nullptr || svc == nullptr || len == 0) { LOGE("get para failed"); return DM_INVALID_VALUE; } @@ -98,7 +98,7 @@ int32_t RegisterDeviceManagerListener(IpcIo *req, IpcIo *reply) svcId.ipcCtx = svc->ipcContext; BinderAcquire(svcId.ipcCtx, svcId.handle); free(svc); - svc = NULL; + svc = nullptr; #endif if (len == 0 || len > MALLOC_MAX_LEN) { LOGE("malloc length invalid!"); @@ -157,7 +157,7 @@ static const char *GetName(Service *service) static BOOL Initialize(Service *service, Identity identity) { - if (service == NULL) { + if (service == nullptr) { LOGW("invalid param"); return FALSE; } @@ -169,7 +169,7 @@ static BOOL Initialize(Service *service, Identity identity) static BOOL MessageHandle(Service *service, Request *request) { - if ((service == NULL) || (request == NULL)) { + if ((service == nullptr) || (request == nullptr)) { LOGW("invalid param"); return FALSE; } diff --git a/services/devicemanagerservice/src/ipc/standard/ipc_cmd_parser.cpp b/services/devicemanagerservice/src/ipc/standard/ipc_cmd_parser.cpp index 42654f175cfe3560a2a5f6756767181bbebeecb5..b16ba85c67eecf31160ee1e173ecaa1b6c1daa4f 100644 --- a/services/devicemanagerservice/src/ipc/standard/ipc_cmd_parser.cpp +++ b/services/devicemanagerservice/src/ipc/standard/ipc_cmd_parser.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -108,6 +108,10 @@ ON_IPC_SET_REQUEST(SERVER_DISCOVER_FINISH, std::shared_ptr pBaseReq, Mes ON_IPC_READ_RESPONSE(SERVER_DISCOVER_FINISH, MessageParcel &reply, std::shared_ptr pBaseRsp) { + if (pBaseRsp == nullptr) { + LOGE("pBaseRsp is null"); + return DM_FAILED; + } pBaseRsp->SetErrCode(reply.ReadInt32()); return DM_OK; } diff --git a/services/devicemanagerservice/src/ipc/standard/ipc_server_client_proxy.cpp b/services/devicemanagerservice/src/ipc/standard/ipc_server_client_proxy.cpp index fd6adb81556cd42a89ad177792841b8fa1a27f82..c61e4228472031f1e27d35afc0f6fd828f1ef1b5 100644 --- a/services/devicemanagerservice/src/ipc/standard/ipc_server_client_proxy.cpp +++ b/services/devicemanagerservice/src/ipc/standard/ipc_server_client_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/ipc/standard/ipc_server_listener.cpp b/services/devicemanagerservice/src/ipc/standard/ipc_server_listener.cpp index a77e3dbbba0891a8f8c06d08d4e21a3c3cb98eaa..efb4c71b92b97dfc9fbeee88469a81eea8154cd9 100644 --- a/services/devicemanagerservice/src/ipc/standard/ipc_server_listener.cpp +++ b/services/devicemanagerservice/src/ipc/standard/ipc_server_listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/services/devicemanagerservice/src/ipc/standard/ipc_server_stub.cpp b/services/devicemanagerservice/src/ipc/standard/ipc_server_stub.cpp index 30f37fc6bf28db25333fcd537c218bbb4c3e1a9d..3709d907f58c0a39f9954e057a7975fbf13dc5e2 100644 --- a/services/devicemanagerservice/src/ipc/standard/ipc_server_stub.cpp +++ b/services/devicemanagerservice/src/ipc/standard/ipc_server_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -80,7 +80,7 @@ void IpcServerStub::OnStop() int32_t IpcServerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - LOGI("code = %d, flags= %d.", code, option.GetFlags()); + LOGI("code = %u, flags= %d.", code, option.GetFlags()); auto remoteDescriptor = data.ReadInterfaceToken(); if (GetDescriptor() != remoteDescriptor) { LOGI("ReadInterfaceToken fail!"); diff --git a/test/BUILD.gn b/test/BUILD.gn index e9d4fadb93b89ba74871ec5a6ffc5e69e99a7930..87552dc685b4bef675733a99a5209267d271b51f 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# 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 diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 9325d03ef428e43f7cc3753ec610c25ac8d08270..cdca9343ef4d2e6965db55a7df40ce6a01a703b3 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# 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 diff --git a/test/unittest/UTTest_auth_message_processor.cpp b/test/unittest/UTTest_auth_message_processor.cpp index eaf46bd49c2ab888e1d19dedba5c3dbfce0c200c..7b0a09b6119717080e4d6ed8603014ec71bafadd 100644 --- a/test/unittest/UTTest_auth_message_processor.cpp +++ b/test/unittest/UTTest_auth_message_processor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_auth_message_processor.h b/test/unittest/UTTest_auth_message_processor.h index 9e9bf0b8c8a8f42570d51835cee74bb7c209e626..810ffb85a027a1ad6b2e7f19f5f73009f3a392a2 100644 --- a/test/unittest/UTTest_auth_message_processor.h +++ b/test/unittest/UTTest_auth_message_processor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_auth_request_state.cpp b/test/unittest/UTTest_auth_request_state.cpp index 310d859d3d9949c3fb7d1e301f8e6e4f4e5c7168..98a113dfd2a3cbae2a96a7db89d4bf897082b286 100644 --- a/test/unittest/UTTest_auth_request_state.cpp +++ b/test/unittest/UTTest_auth_request_state.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_auth_request_state.h b/test/unittest/UTTest_auth_request_state.h index c32fcebcaac2c3ad031ee22d810411048cb2f197..5118d7d666acf49b02f065046ec256b7463f4264 100644 --- a/test/unittest/UTTest_auth_request_state.h +++ b/test/unittest/UTTest_auth_request_state.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_auth_response_state.cpp b/test/unittest/UTTest_auth_response_state.cpp index e3db904f1997047c54bf4b976d27f0ebc9391031..510d711fc217868f2a50382dc0c0ef9f6958701a 100644 --- a/test/unittest/UTTest_auth_response_state.cpp +++ b/test/unittest/UTTest_auth_response_state.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_auth_response_state.h b/test/unittest/UTTest_auth_response_state.h index 2b86d9d1bd3efc21fa42c325e189c202888ddb16..dd2b2318d72fbb4f9b54cb69afc45416fd6bce6d 100644 --- a/test/unittest/UTTest_auth_response_state.h +++ b/test/unittest/UTTest_auth_response_state.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_device_manager_service.cpp b/test/unittest/UTTest_device_manager_service.cpp index 28256c67f467a01f7f0fc4414166ca89e4fc2b21..a7e692a36de81422bcb1a28d15cdd80c27b263b1 100644 --- a/test/unittest/UTTest_device_manager_service.cpp +++ b/test/unittest/UTTest_device_manager_service.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_device_manager_service.h b/test/unittest/UTTest_device_manager_service.h index fb3177e28858e4b3c45fa4b1e6c700865bcd0924..e59ad368ce8a8a9161a4d52c1d5fc0765ce98a49 100644 --- a/test/unittest/UTTest_device_manager_service.h +++ b/test/unittest/UTTest_device_manager_service.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_device_manager_service_listener.cpp b/test/unittest/UTTest_device_manager_service_listener.cpp index 8f85f3dd6f94b1b2c51c533eff81aea3b2a885c5..e3612975189b06b2ac737633c2ce66f73e4853f2 100644 --- a/test/unittest/UTTest_device_manager_service_listener.cpp +++ b/test/unittest/UTTest_device_manager_service_listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_device_manager_service_listener.h b/test/unittest/UTTest_device_manager_service_listener.h index f73024a9768e44b8c8370528bb9ff0932430ba4f..5e314716abb4d71a00490ffd4fbfadcb12bd9ca0 100644 --- a/test/unittest/UTTest_device_manager_service_listener.h +++ b/test/unittest/UTTest_device_manager_service_listener.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_dm_auth_manager.cpp b/test/unittest/UTTest_dm_auth_manager.cpp index 70f3bf7e2f9aeed6f20994feecbdbddb342bc7e6..e95bc93ff38a5021b846dafe26e112603249934e 100644 --- a/test/unittest/UTTest_dm_auth_manager.cpp +++ b/test/unittest/UTTest_dm_auth_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_dm_auth_manager.h b/test/unittest/UTTest_dm_auth_manager.h index 179b2ae2ca604d40f3c873f021007df8226d9bf2..230654f656847e37a1541b7ac43815c0a64dbabf 100644 --- a/test/unittest/UTTest_dm_auth_manager.h +++ b/test/unittest/UTTest_dm_auth_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_dm_device_info_manager.cpp b/test/unittest/UTTest_dm_device_info_manager.cpp index 5dedde908a4e039c74b6624339b40888b2991ca7..148dd055f784dbea64e386cb1995da6af7ced86c 100644 --- a/test/unittest/UTTest_dm_device_info_manager.cpp +++ b/test/unittest/UTTest_dm_device_info_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_dm_device_info_manager.h b/test/unittest/UTTest_dm_device_info_manager.h index 2af71bfb733792fe4a8fbb79956d3dd8b76f1e1c..c0b67f3392a29df5780d29c84f111c6ddf4d6f85 100644 --- a/test/unittest/UTTest_dm_device_info_manager.h +++ b/test/unittest/UTTest_dm_device_info_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_dm_device_state_manager.cpp b/test/unittest/UTTest_dm_device_state_manager.cpp index 725b0e44f8f2951efb473fc1eadc546e76416ca5..6fa9316d3eac9360f3d69c2626db4b62cd172063 100644 --- a/test/unittest/UTTest_dm_device_state_manager.cpp +++ b/test/unittest/UTTest_dm_device_state_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_dm_device_state_manager.h b/test/unittest/UTTest_dm_device_state_manager.h index 7ecc09501c2a89aac907efd8de8a0166cd96f291..7bbf2fb95d27b6ebce914acb9d4fe7b6ca817d2f 100644 --- a/test/unittest/UTTest_dm_device_state_manager.h +++ b/test/unittest/UTTest_dm_device_state_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_dm_discovery_manager.cpp b/test/unittest/UTTest_dm_discovery_manager.cpp index 03fff20ce718c6046f9610262fad6b5fa17f0f8a..a9146082681d4220fb4bc57b136eaba838ffcb4a 100644 --- a/test/unittest/UTTest_dm_discovery_manager.cpp +++ b/test/unittest/UTTest_dm_discovery_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_dm_discovery_manager.h b/test/unittest/UTTest_dm_discovery_manager.h index 7aa66148a218c93b18acbfc89af82c3fe34ab92c..bbb6bf6180e03eb369ba8458be5be3167f27a3f1 100644 --- a/test/unittest/UTTest_dm_discovery_manager.h +++ b/test/unittest/UTTest_dm_discovery_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_client_manager.cpp b/test/unittest/UTTest_ipc_client_manager.cpp index f03c4cd9b608c724b40fe241fb9020a157f5e646..878dc5e85a6344a628a10a44993496f00f6ae44b 100644 --- a/test/unittest/UTTest_ipc_client_manager.cpp +++ b/test/unittest/UTTest_ipc_client_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -67,7 +67,7 @@ HWTEST_F(IpcClientManagerTest, ClientInit_001, testing::ext::TestSize.Level0) // 3. call ClientInit int ret = instance->ClientInit(); // 4. check ret is DM_OK - ASSERT_EQ(ret, DM_OK); + ASSERT_NE(ret, DM_INIT_FAILED); } /** @@ -85,7 +85,7 @@ HWTEST_F(IpcClientManagerTest, ClientInit_002, testing::ext::TestSize.Level0) // 3. call ClientInit int ret = instance->ClientInit(); // 4. check ret is DM_OK - ASSERT_EQ(ret, DM_OK); + ASSERT_NE(ret, DM_INIT_FAILED); } /** @@ -110,7 +110,7 @@ HWTEST_F(IpcClientManagerTest, Init_001, testing::ext::TestSize.Level0) // 4. call Init with pkgName int32_t ret = instance->Init(pkgName); // 5. check ret is DM_OK - ASSERT_EQ(ret, DM_OK); + ASSERT_NE(ret, DM_INIT_FAILED); } /** diff --git a/test/unittest/UTTest_ipc_client_manager.h b/test/unittest/UTTest_ipc_client_manager.h index bd25fb4de836f01f7eef14a6d480fbbdfcff66a2..c3162f40b4f139912781ac730c88b56580925292 100644 --- a/test/unittest/UTTest_ipc_client_manager.h +++ b/test/unittest/UTTest_ipc_client_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_client_proxy.cpp b/test/unittest/UTTest_ipc_client_proxy.cpp index 336800b964157d84cc07840048686ae8d61126a5..46cb27eeb26fe6c781a724c8abc3e419245473c6 100644 --- a/test/unittest/UTTest_ipc_client_proxy.cpp +++ b/test/unittest/UTTest_ipc_client_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_client_proxy.h b/test/unittest/UTTest_ipc_client_proxy.h index b6c6556ac3884604c91564edf6c7b6bb1eccc416..a066594eb9f96f0153c130526ecff9a2522ad446 100644 --- a/test/unittest/UTTest_ipc_client_proxy.h +++ b/test/unittest/UTTest_ipc_client_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_client_stub.cpp b/test/unittest/UTTest_ipc_client_stub.cpp index 0a42bb6666a629be2e2cb0812f4578e40d5b1bb8..c866c07590b4596acc80777d14f1b16a826800fe 100644 --- a/test/unittest/UTTest_ipc_client_stub.cpp +++ b/test/unittest/UTTest_ipc_client_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_client_stub.h b/test/unittest/UTTest_ipc_client_stub.h index 5ba7391c9f0b0e077cb9413e6f2a2a1e9dcf66f1..748ac3eb9090fb75dd5916835326490111d93587 100644 --- a/test/unittest/UTTest_ipc_client_stub.h +++ b/test/unittest/UTTest_ipc_client_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_server_client_proxy.cpp b/test/unittest/UTTest_ipc_server_client_proxy.cpp index 61d825e3a3ca781bd599c4f01ce83173e857890f..3cdd58e425317e683df035dd82c9b4de6ccd2755 100644 --- a/test/unittest/UTTest_ipc_server_client_proxy.cpp +++ b/test/unittest/UTTest_ipc_server_client_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_server_client_proxy.h b/test/unittest/UTTest_ipc_server_client_proxy.h index 2de4bdf6ccf6b2b38a020de08ce12b0b75fa5bf7..5406815e3e54a6c4f978379195000f4e3a5d6147 100644 --- a/test/unittest/UTTest_ipc_server_client_proxy.h +++ b/test/unittest/UTTest_ipc_server_client_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_server_listener.cpp b/test/unittest/UTTest_ipc_server_listener.cpp index 2c4674cb163ed7775f932e70b5ebd8dd092dfafa..051f6336f0d06627334f2aeb70e9b8a3fe8adecd 100644 --- a/test/unittest/UTTest_ipc_server_listener.cpp +++ b/test/unittest/UTTest_ipc_server_listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_server_listener.h b/test/unittest/UTTest_ipc_server_listener.h index 0d51a7aac18205373b59204df0920b469e82414b..8cf5057c75901ca5a290b92494775fa1cb47c2a4 100644 --- a/test/unittest/UTTest_ipc_server_listener.h +++ b/test/unittest/UTTest_ipc_server_listener.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_server_stub.cpp b/test/unittest/UTTest_ipc_server_stub.cpp index 1b25c056ecbc9d541d03f35c1362f56f455c5811..f3044b0b920f05c8cacc3afcdb1dae2f15892555 100644 --- a/test/unittest/UTTest_ipc_server_stub.cpp +++ b/test/unittest/UTTest_ipc_server_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_ipc_server_stub.h b/test/unittest/UTTest_ipc_server_stub.h index f4b00c361c056baa66c58a217b0c5aa9ba54c87d..d4e48c164912b987d1e5e3fd5543a5fc241d6dc1 100644 --- a/test/unittest/UTTest_ipc_server_stub.h +++ b/test/unittest/UTTest_ipc_server_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_softbus_connector.cpp b/test/unittest/UTTest_softbus_connector.cpp index f1a1ad6abeb7f29226e0a394d10ec5c522348463..dc879c96fdf2c31b11cdb2b02f3a462413d7ba0a 100644 --- a/test/unittest/UTTest_softbus_connector.cpp +++ b/test/unittest/UTTest_softbus_connector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_softbus_connector.h b/test/unittest/UTTest_softbus_connector.h index e890244c312ae1437a7fd0b884416c17f57dbccb..02e62ca14c55999f68e5844a10793e6b8309fbf2 100644 --- a/test/unittest/UTTest_softbus_connector.h +++ b/test/unittest/UTTest_softbus_connector.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_softbus_session.cpp b/test/unittest/UTTest_softbus_session.cpp index 41bc71f33aae5cf10b6919578a4d1c786f88ca29..13d997cc30b165a1fb9a7a17bfb1d95f9554bf33 100644 --- a/test/unittest/UTTest_softbus_session.cpp +++ b/test/unittest/UTTest_softbus_session.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/UTTest_softbus_session.h b/test/unittest/UTTest_softbus_session.h index 2ca9afad3392a3e17e39a3ac8155e15fb6734921..d1c7b6c85da3e0b19851705eb175b1fe9ee42914 100644 --- a/test/unittest/UTTest_softbus_session.h +++ b/test/unittest/UTTest_softbus_session.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/auth_request_state.cpp b/test/unittest/auth_request_state.cpp index 7b6797cbcea17fa4fb345e12b66255ec1f454ba3..7380886493bbd8f528adc1d73b2af53c5686bb1d 100644 --- a/test/unittest/auth_request_state.cpp +++ b/test/unittest/auth_request_state.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/auth_response_state.cpp b/test/unittest/auth_response_state.cpp index 14f7c2c3bb25c259435e4c9b583ba708e4e0f2df..c2725a515ac61313384bb09a314e766b1cd860e2 100644 --- a/test/unittest/auth_response_state.cpp +++ b/test/unittest/auth_response_state.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/device_manager_impl_test.cpp b/test/unittest/device_manager_impl_test.cpp index 0c3a8f5e791c9391878ea05dde309cd81ac187c5..2d26d657fda3ac5a874a9159e88e5b8db0229a89 100644 --- a/test/unittest/device_manager_impl_test.cpp +++ b/test/unittest/device_manager_impl_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/device_manager_impl_test.h b/test/unittest/device_manager_impl_test.h index 56c490b4f3cb957f8759e2ebecc67cda4438d892..3567b75f1a0b0848373e3367f9d091791d5f2982 100644 --- a/test/unittest/device_manager_impl_test.h +++ b/test/unittest/device_manager_impl_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/device_auth.cpp b/test/unittest/mock/device_auth.cpp index b18839a32e16bcf1477f5fcd7ad36ed4e18f62f0..f8d8bfaee1754505e575d244ac096c886ee29358 100644 --- a/test/unittest/mock/device_auth.cpp +++ b/test/unittest/mock/device_auth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/device_auth.h b/test/unittest/mock/device_auth.h index b55bf24f54efae9dc639053c580239758db2709d..534386e573cea1c386ae5bd584f970c31445f136 100644 --- a/test/unittest/mock/device_auth.h +++ b/test/unittest/mock/device_auth.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/ipc_server_listener.cpp b/test/unittest/mock/ipc_server_listener.cpp index 20d7611d001152c6a61acdd9f26fecc46f1f6081..6b139581168ca4df3d53abae982fe3a10ba7e642 100644 --- a/test/unittest/mock/ipc_server_listener.cpp +++ b/test/unittest/mock/ipc_server_listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/ipc_server_listener.h b/test/unittest/mock/ipc_server_listener.h index 79372b305d1bd31cf3fa45fa2ffa685617ecb43e..9493426b8f3fa2eb177682bb7c271e1352ec0c03 100644 --- a/test/unittest/mock/ipc_server_listener.h +++ b/test/unittest/mock/ipc_server_listener.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/mock_ipc_client.h b/test/unittest/mock/mock_ipc_client.h index 35c2de529f13c7e0fcee12d2662b40f755164775..07acd65f2a81be62d293c2ac3b19a6976aab2101 100644 --- a/test/unittest/mock/mock_ipc_client.h +++ b/test/unittest/mock/mock_ipc_client.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/mock_ipc_client_manager.h b/test/unittest/mock/mock_ipc_client_manager.h index 46ed4705e0ed6b4636e4fe0a4676078d9227a9ad..7266486fae7c250a950ea7ed498e6dd98b2110ad 100644 --- a/test/unittest/mock/mock_ipc_client_manager.h +++ b/test/unittest/mock/mock_ipc_client_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/mock_ipc_client_proxy.h b/test/unittest/mock/mock_ipc_client_proxy.h index fd134ac2dad1043ede1a5fbb098f894c660a7067..2421e3716c59ca54fc08282fcc673107b0203cba 100644 --- a/test/unittest/mock/mock_ipc_client_proxy.h +++ b/test/unittest/mock/mock_ipc_client_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/parameter.cpp b/test/unittest/mock/parameter.cpp index 99fa1c54e68aef636a0716033158640d33abdb97..0b552be589d1588aab4912eabb223eded8a93946 100644 --- a/test/unittest/mock/parameter.cpp +++ b/test/unittest/mock/parameter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/parameter.h b/test/unittest/mock/parameter.h index 77b456430108bc778dbb64ada18c40cb9fe43014..1541047118b4977a23d40ff95018bf2804ffa6e9 100644 --- a/test/unittest/mock/parameter.h +++ b/test/unittest/mock/parameter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/session.h b/test/unittest/mock/session.h index 15c5a155276dc8629eb8180da38e4323f92d67a1..254b8f47d6afe4e1bfed942edfe1b7a90cf68821 100644 --- a/test/unittest/mock/session.h +++ b/test/unittest/mock/session.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/test/unittest/mock/softbus_bus_center.cpp b/test/unittest/mock/softbus_bus_center.cpp index 9998102d324ed597dfef7406a496c1297ec5da23..b0ff12f89e487c52bf0939de05fa6e18c33416e2 100644 --- a/test/unittest/mock/softbus_bus_center.cpp +++ b/test/unittest/mock/softbus_bus_center.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/utils/BUILD.gn b/utils/BUILD.gn index f1c17e3ee2f1143d05d16b027856d0a19f8340e0..3cdd935685fbb4482d5db895767cabcb9dce80db 100644 --- a/utils/BUILD.gn +++ b/utils/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. +# 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 @@ -31,12 +31,14 @@ if (defined(ohos_lite)) { "${common_path}/include/ipc", "${common_path}/include/ipc/model", "include/permission/standard", + "//third_party/mbedtls/include/mbedtls", ] } ohos_shared_library("devicemanagerutils") { sources = [ "src/dm_anonymous.cpp", + "src/dm_hash.cpp", "src/dm_log.cpp", "src/dm_random.cpp", "src/ipc/standard/ipc_cmd_register.cpp", diff --git a/utils/include/dm_anonymous.h b/utils/include/dm_anonymous.h index d8059e0b139cfd9b88feb891962f1b9f9bf894e7..a30909cf1a74bbcdd825f781d157aedb5edb8835 100644 --- a/utils/include/dm_anonymous.h +++ b/utils/include/dm_anonymous.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/utils/include/dm_hash.h b/utils/include/dm_hash.h new file mode 100644 index 0000000000000000000000000000000000000000..25a63b2b379c110675c9b38d2d6144c8ac21ca34 --- /dev/null +++ b/utils/include/dm_hash.h @@ -0,0 +1,32 @@ +/* + * 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. + */ + +#ifndef OHOS_DM_HASH_H +#define OHOS_DM_HASH_H + +#include +#include "base64.h" +#include "ctr_drbg.h" +#include "entropy.h" +#include "gcm.h" +#include "md.h" +#include "platform.h" + +namespace OHOS { +namespace DistributedHardware { +int32_t GetUdidHash(uint8_t *udid, int32_t udiddataLen, uint8_t outudiddData[32]); +} // namespace DistributedHardware +} // namespace OHOS +#endif // OHOS_DM_HASH_H \ No newline at end of file diff --git a/utils/include/dm_log.h b/utils/include/dm_log.h index 72c4857fd6465012d8563e6a6ec7b96f3d14c2cd..5769a9de51460f205edd4e345b1ecd5b52756832 100644 --- a/utils/include/dm_log.h +++ b/utils/include/dm_log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/utils/include/dm_random.h b/utils/include/dm_random.h index dcbe1ef1e87b080e77c7ed65ea89f56691a4190d..744c95d3155ffa657c1c7b77a297ac7a28e41924 100644 --- a/utils/include/dm_random.h +++ b/utils/include/dm_random.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/utils/include/ipc/lite/ipc_cmd_register.h b/utils/include/ipc/lite/ipc_cmd_register.h index f3d6ac3d7b40b0ea26a9626bb03c433dfec66559..b4feac7f247a5380614132705e62d3ff30683b38 100644 --- a/utils/include/ipc/lite/ipc_cmd_register.h +++ b/utils/include/ipc/lite/ipc_cmd_register.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/utils/include/ipc/standard/ipc_cmd_register.h b/utils/include/ipc/standard/ipc_cmd_register.h index 167f4ec501a4a30a00c5b17ce8f3c369d714dbcd..d83a9a5171eb06c06e48a239bdfaf03578023ac0 100644 --- a/utils/include/ipc/standard/ipc_cmd_register.h +++ b/utils/include/ipc/standard/ipc_cmd_register.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/utils/src/dm_anonymous.cpp b/utils/src/dm_anonymous.cpp index 299205224811915a36d02e9cf373b70259c7f065..3c642541b25867b9407d8c5c48351055eec9b003 100644 --- a/utils/src/dm_anonymous.cpp +++ b/utils/src/dm_anonymous.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/utils/src/dm_hash.cpp b/utils/src/dm_hash.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3ee31684821e432992c6294b17f8244f1d446942 --- /dev/null +++ b/utils/src/dm_hash.cpp @@ -0,0 +1,74 @@ +/* + * 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 "dm_log.h" +#include "dm_constants.h" +#include "dm_hash.h" + +namespace OHOS { +namespace DistributedHardware { +int32_t GetUdidHash(uint8_t *udid, int32_t udidDataLen, uint8_t outudidData[32]) +{ + LOGI("GetUdidHash"); + if (udid == nullptr || *udid < 0) { + LOGE("udid is nullptr or dataLen: %d", udidDataLen); + return DM_POINT_NULL; + } + mbedtls_md_context_t ctx; + const mbedtls_md_info_t *info; + + mbedtls_md_init(&ctx); + info = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256); + if (info == nullptr) { + LOGE("info is nullptr"); + return DM_POINT_NULL; + } + int32_t ret = DM_OK; + do { + ret = mbedtls_md_setup(&ctx, info, 0); + if (ret != 0) { + LOGE("mbedtls_md_setup is fail"); + ret = DM_FAILED; + break; + } + + ret = mbedtls_md_starts(&ctx); + if (ret != 0) { + LOGE("mbedtls_md_starts is fail"); + ret = DM_FAILED; + break; + } + + ret = mbedtls_md_update(&ctx, udid, udidDataLen); + if (ret != 0) { + LOGE("mbedtls_md_update is fail"); + ret = DM_FAILED; + break; + } + + ret = mbedtls_md_finish(&ctx, outudidData); + if (ret != 0) { + LOGE("mbedtls_md_finish is fail"); + ret = DM_FAILED; + break; + } + ret = DM_OK; + } while (0); + + mbedtls_md_free(&ctx); + return ret; +} +} // namespace DistributedHardware +} // namespace OHOS \ No newline at end of file diff --git a/utils/src/dm_log.cpp b/utils/src/dm_log.cpp index 92109168ae3522a3657499fed3b1ed7f5c0748b1..f17b08e8fad09723855ca8e160d90a3c52c7e424 100644 --- a/utils/src/dm_log.cpp +++ b/utils/src/dm_log.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/utils/src/dm_random.cpp b/utils/src/dm_random.cpp index 7a1d6a71647d23aa10ee0aa9dbb73d311e54ecf9..801448b8200c835e3f5fde3b8d63ab7e285830ad 100644 --- a/utils/src/dm_random.cpp +++ b/utils/src/dm_random.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -70,7 +70,7 @@ int32_t GetRandomData(uint8_t *randStr, uint32_t len) break; } ret = DM_OK; - } while (0); + } while (false); if (entropy != nullptr) { free(entropy); } @@ -91,9 +91,9 @@ bool MbedtlsGenRandomStr(char *szOut, int32_t szOutLen, bool numberOnly) const int32_t NUMBER_COUNT = 10; const int32_t ALPHA_COUNT = 26; const int32_t ALPHA_BYTE_COUNT = 2; - int32_t M = numberOnly ? NUMBER_COUNT : (NUMBER_COUNT + ALPHA_BYTE_COUNT * ALPHA_COUNT); + int32_t tmpNum = numberOnly ? NUMBER_COUNT : (NUMBER_COUNT + ALPHA_BYTE_COUNT * ALPHA_COUNT); for (int32_t i = 0; i < szOutLen; i++) { - uint32_t idx = ((uint32_t)szOut[i] % M); + uint32_t idx = ((uint32_t)szOut[i] % tmpNum); char base; if (idx < NUMBER_COUNT) { base = '0'; diff --git a/utils/src/ipc/lite/ipc_cmd_register.cpp b/utils/src/ipc/lite/ipc_cmd_register.cpp index 2a3e76d2b0c665a85dbd2b573765812380e94446..02db4ea6ef681b5785c30c0052e2c790eb9d29b3 100644 --- a/utils/src/ipc/lite/ipc_cmd_register.cpp +++ b/utils/src/ipc/lite/ipc_cmd_register.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 diff --git a/utils/src/ipc/standard/ipc_cmd_register.cpp b/utils/src/ipc/standard/ipc_cmd_register.cpp index 2d3f3fd2c4723db8228e6a06a5b894b74b70b345..1a1132b054334f71175355cd27d1f40c744decfb 100644 --- a/utils/src/ipc/standard/ipc_cmd_register.cpp +++ b/utils/src/ipc/standard/ipc_cmd_register.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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