From 2527ed30b099382003974eaabbe6a62c792babfc Mon Sep 17 00:00:00 2001 From: pwx1285814 Date: Fri, 5 Jul 2024 14:26:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=B8=AD=E6=B7=BB=E5=8A=A0na?= =?UTF-8?q?mespace=E6=B3=A8=E9=87=8A,=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96sptr=E7=9A=84UT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: pwx1285814 --- .../src/callback/dscreen_sink_load_callback.cpp | 6 +++--- .../include/callback/dscreen_source_callback.h | 6 +++--- .../include/callback/dscreen_source_callback_stub.h | 4 ++-- .../include/callback/dscreen_source_load_callback.h | 6 +++--- .../include/callback/idscreen_source_callback.h | 6 +++--- .../screen_source/include/dscreen_source_handler.h | 6 +++--- .../screen_source/include/dscreen_source_proxy.h | 6 +++--- .../native_cpp/screen_source/include/idscreen_source.h | 6 +++--- .../src/callback/dscreen_source_callback.cpp | 6 +++--- .../src/callback/dscreen_source_callback_stub.cpp | 4 ++-- .../src/callback/dscreen_source_load_callback.cpp | 6 +++--- .../screen_source/src/dscreen_source_handler.cpp | 6 +++--- .../screen_source/src/dscreen_source_proxy.cpp | 6 +++--- .../dscreenservice/src/dscreen_sink_stub_test.cpp | 10 +++++----- .../dscreenmgr/1.0/src/screen_manager_adapter_test.cpp | 8 ++++---- .../encoder/include/idscreen_dbg_itf.h | 6 +++--- 16 files changed, 49 insertions(+), 49 deletions(-) diff --git a/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp b/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp index 1c8fd77a..d97cd61b 100644 --- a/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp +++ b/interfaces/innerkits/native_cpp/screen_sink/src/callback/dscreen_sink_load_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -50,5 +50,5 @@ void DScreenSinkLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) ReportSaFail(DSCREEN_INIT_FAIL, ERR_DH_SCREEN_SA_SINKPROXY_NOT_INIT, systemAbilityId, "dscreen sink OnLoadSystemAbilityFail."); } -} -} \ No newline at end of file +} // namespace DistributedHardware +} // namespace OHOS diff --git a/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback.h b/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback.h index 633c1084..11bf819a 100644 --- a/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback.h +++ b/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -48,6 +48,6 @@ private: std::map> registerCallbackMap_; std::map> unregisterCallbackMap_; }; -} -} +} // namespace DistributedHardware +} // namespace OHOS #endif \ No newline at end of file diff --git a/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback_stub.h b/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback_stub.h index 8f140590..4b12d02d 100644 --- a/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback_stub.h +++ b/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_callback_stub.h @@ -42,6 +42,6 @@ private: bool CheckParams(const std::string &devId, const std::string &dhId, const std::string &reqId, const std::string &resultData) const; }; -} -} +} // namespace DistributedHardware +} // namespace OHOS #endif \ No newline at end of file diff --git a/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_load_callback.h b/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_load_callback.h index 50b433d5..c4a67cd7 100644 --- a/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_load_callback.h +++ b/interfaces/innerkits/native_cpp/screen_source/include/callback/dscreen_source_load_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -34,6 +34,6 @@ public: private: std::string params_; }; -} -} +} // namespace DistributedHardware +} // namespace OHOS #endif \ No newline at end of file diff --git a/interfaces/innerkits/native_cpp/screen_source/include/callback/idscreen_source_callback.h b/interfaces/innerkits/native_cpp/screen_source/include/callback/idscreen_source_callback.h index bebc4b0c..35ff8d7e 100644 --- a/interfaces/innerkits/native_cpp/screen_source/include/callback/idscreen_source_callback.h +++ b/interfaces/innerkits/native_cpp/screen_source/include/callback/idscreen_source_callback.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -34,6 +34,6 @@ public: virtual int32_t OnNotifyUnregResult(const std::string &devId, const std::string &dhId, const std::string &reqId, int32_t status, const std::string &data) = 0; }; -} -} +} // namespace DistributedHardware +} // namespace OHOS #endif \ No newline at end of file diff --git a/interfaces/innerkits/native_cpp/screen_source/include/dscreen_source_handler.h b/interfaces/innerkits/native_cpp/screen_source/include/dscreen_source_handler.h index a5591d02..d83f1f4b 100644 --- a/interfaces/innerkits/native_cpp/screen_source/include/dscreen_source_handler.h +++ b/interfaces/innerkits/native_cpp/screen_source/include/dscreen_source_handler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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,6 +70,6 @@ __attribute__((visibility("default"))) IDistributedHardwareSource *GetSourceHard #ifdef __cplusplus } #endif -} -} +} // namespace DistributedHardware +} // namespace OHOS #endif \ No newline at end of file diff --git a/interfaces/innerkits/native_cpp/screen_source/include/dscreen_source_proxy.h b/interfaces/innerkits/native_cpp/screen_source/include/dscreen_source_proxy.h index da188082..3fabdae8 100644 --- a/interfaces/innerkits/native_cpp/screen_source/include/dscreen_source_proxy.h +++ b/interfaces/innerkits/native_cpp/screen_source/include/dscreen_source_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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,6 +53,6 @@ private: bool CheckConfigParams(const std::string &devId, const std::string &dhId, const std::string &key, const std::string &value) const; }; -} -} +} // namespace DistributedHardware +} // namespace OHOS #endif diff --git a/interfaces/innerkits/native_cpp/screen_source/include/idscreen_source.h b/interfaces/innerkits/native_cpp/screen_source/include/idscreen_source.h index 79889069..f877101d 100644 --- a/interfaces/innerkits/native_cpp/screen_source/include/idscreen_source.h +++ b/interfaces/innerkits/native_cpp/screen_source/include/idscreen_source.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -38,6 +38,6 @@ public: virtual void DScreenNotify(const std::string &devId, int32_t eventCode, const std::string &eventContent) = 0; }; -} -} +} // namespace DistributedHardware +} // namespace OHOS #endif \ No newline at end of file diff --git a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_callback.cpp b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_callback.cpp index b2ad88a0..a7707c19 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_callback.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -90,5 +90,5 @@ void DScreenSourceCallback::PopUnregisterCallback(const std::string &reqId) std::lock_guard lock(unregisterMutex_); unregisterCallbackMap_.erase(reqId); } -} -} \ No newline at end of file +} // namespace DistributedHardware +} // namespace OHOS diff --git a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_callback_stub.cpp b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_callback_stub.cpp index 3b581a94..332d06cb 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_callback_stub.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_callback_stub.cpp @@ -100,5 +100,5 @@ bool DScreenSourceCallbackStub::CheckParams(const std::string &devId, const std: } return true; } -} -} \ No newline at end of file +} // namespace DistributedHardware +} // namespace OHOS diff --git a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp index 190fdc8b..e5a52b87 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/callback/dscreen_source_load_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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,5 +46,5 @@ void DScreenSourceLoadCallback::OnLoadSystemAbilityFail(int32_t systemAbilityId) ReportSaFail(DSCREEN_INIT_FAIL, ERR_DH_SCREEN_SA_SOURCEPROXY_NOT_INIT, systemAbilityId, "dscreen source OnLoadSystemAbilityFail."); } -} -} +} // namespace DistributedHardware +} // namespace OHOS diff --git a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp index e1a58f1f..8468baed 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -257,5 +257,5 @@ IDistributedHardwareSource *GetSourceHardwareHandler() DHLOGI("GetSourceHardwareHandler"); return &DScreenSourceHandler::GetInstance(); } -} -} \ No newline at end of file +} // namespace DistributedHardware +} // namespace OHOS diff --git a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_proxy.cpp b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_proxy.cpp index d8c8b415..0e35bcec 100644 --- a/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_proxy.cpp +++ b/interfaces/innerkits/native_cpp/screen_source/src/dscreen_source_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -249,5 +249,5 @@ bool DScreenSourceProxy::CheckConfigParams(const std::string &devId, const std:: } return true; } -} -} +} // namespace DistributedHardware +} // namespace OHOS diff --git a/services/screenservice/test/unittest/sinkservice/dscreenservice/src/dscreen_sink_stub_test.cpp b/services/screenservice/test/unittest/sinkservice/dscreenservice/src/dscreen_sink_stub_test.cpp index 744184dd..708220bb 100644 --- a/services/screenservice/test/unittest/sinkservice/dscreenservice/src/dscreen_sink_stub_test.cpp +++ b/services/screenservice/test/unittest/sinkservice/dscreenservice/src/dscreen_sink_stub_test.cpp @@ -193,7 +193,7 @@ HWTEST_F(DScreenSinkStubTest, DScreenNotify_001, TestSize.Level1) */ HWTEST_F(DScreenSinkStubTest, DScreenNotifyInner_001, TestSize.Level1) { - sptr sinkStub = new TestDScreenSinkStub(); + sptr sinkStub(new TestDScreenSinkStub()); MessageParcel data; MessageParcel reply; MessageOption option; @@ -215,7 +215,7 @@ HWTEST_F(DScreenSinkStubTest, DScreenNotifyInner_001, TestSize.Level1) */ HWTEST_F(DScreenSinkStubTest, DScreenNotifyInner_002, TestSize.Level1) { - sptr sinkStub = new TestDScreenSinkStub(); + sptr sinkStub(new TestDScreenSinkStub()); MessageParcel data; MessageParcel reply; MessageOption option; @@ -237,7 +237,7 @@ HWTEST_F(DScreenSinkStubTest, DScreenNotifyInner_002, TestSize.Level1) */ HWTEST_F(DScreenSinkStubTest, DScreenNotifyInner_003, TestSize.Level1) { - sptr sinkStub = new TestDScreenSinkStub(); + sptr sinkStub(new TestDScreenSinkStub()); MessageParcel data; MessageParcel reply; MessageOption option; @@ -259,7 +259,7 @@ HWTEST_F(DScreenSinkStubTest, DScreenNotifyInner_003, TestSize.Level1) */ HWTEST_F(DScreenSinkStubTest, DScreenNotifyInner_004, TestSize.Level1) { - sptr sinkStub = new TestDScreenSinkStub(); + sptr sinkStub(new TestDScreenSinkStub()); MessageParcel data; MessageParcel reply; MessageOption option; @@ -281,7 +281,7 @@ HWTEST_F(DScreenSinkStubTest, DScreenNotifyInner_004, TestSize.Level1) */ HWTEST_F(DScreenSinkStubTest, DScreenNotifyInner_005, TestSize.Level1) { - sptr sinkStub = new TestDScreenSinkStub(); + sptr sinkStub(new TestDScreenSinkStub()); MessageParcel data; MessageParcel reply; MessageOption option; diff --git a/services/screenservice/test/unittest/sourceservice/dscreenmgr/1.0/src/screen_manager_adapter_test.cpp b/services/screenservice/test/unittest/sourceservice/dscreenmgr/1.0/src/screen_manager_adapter_test.cpp index 77d75ecd..127997d7 100644 --- a/services/screenservice/test/unittest/sourceservice/dscreenmgr/1.0/src/screen_manager_adapter_test.cpp +++ b/services/screenservice/test/unittest/sourceservice/dscreenmgr/1.0/src/screen_manager_adapter_test.cpp @@ -136,7 +136,7 @@ HWTEST_F(DScreenManagerAdapterTest, RegisterScreenGroupListener_001, TestSize.Le */ HWTEST_F(DScreenManagerAdapterTest, RegisterScreenGroupListener_002, TestSize.Level1) { - sptr listener = new MockScreenGroupListener(); + sptr listener(new MockScreenGroupListener()); ScreenMgrAdapter::GetInstance().listenerRegistered_ = true; int32_t ret = ScreenMgrAdapter::GetInstance().RegisterScreenGroupListener(listener); EXPECT_EQ(DH_SUCCESS, ret); @@ -150,7 +150,7 @@ HWTEST_F(DScreenManagerAdapterTest, RegisterScreenGroupListener_002, TestSize.Le */ HWTEST_F(DScreenManagerAdapterTest, RegisterScreenGroupListener_003, TestSize.Level1) { - sptr listener = new MockScreenGroupListener(); + sptr listener(new MockScreenGroupListener()); ScreenMgrAdapter::GetInstance().listenerRegistered_ = false; int32_t ret = ScreenMgrAdapter::GetInstance().RegisterScreenGroupListener(listener); EXPECT_EQ(DH_SUCCESS, ret); @@ -179,7 +179,7 @@ HWTEST_F(DScreenManagerAdapterTest, UnregisterScreenGroupListener_001, TestSize. */ HWTEST_F(DScreenManagerAdapterTest, UnregisterScreenGroupListener_002, TestSize.Level1) { - sptr listener = new MockScreenGroupListener(); + sptr listener(new MockScreenGroupListener()); ScreenMgrAdapter::GetInstance().listenerRegistered_ = false; int32_t ret = ScreenMgrAdapter::GetInstance().UnregisterScreenGroupListener(listener); EXPECT_EQ(DH_SUCCESS, ret); @@ -193,7 +193,7 @@ HWTEST_F(DScreenManagerAdapterTest, UnregisterScreenGroupListener_002, TestSize. */ HWTEST_F(DScreenManagerAdapterTest, UnregisterScreenGroupListener_003, TestSize.Level1) { - sptr listener = new MockScreenGroupListener(); + sptr listener(new MockScreenGroupListener()); ScreenMgrAdapter::GetInstance().listenerRegistered_ = true; int32_t ret = ScreenMgrAdapter::GetInstance().UnregisterScreenGroupListener(listener); EXPECT_EQ(ERR_DH_SCREEN_SA_UNREGISTER_SCREENLISTENER_FAIL, ret); diff --git a/services/screentransport/screensourceprocessor/encoder/include/idscreen_dbg_itf.h b/services/screentransport/screensourceprocessor/encoder/include/idscreen_dbg_itf.h index a60aa870..6583fe00 100644 --- a/services/screentransport/screensourceprocessor/encoder/include/idscreen_dbg_itf.h +++ b/services/screentransport/screensourceprocessor/encoder/include/idscreen_dbg_itf.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 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 @@ -34,6 +34,6 @@ public: }; extern "C" __attribute__((visibility("default"))) IDScreenDBGItf *GetDBGItf(); extern "C" __attribute__((visibility("default"))) IImageSetDirty *GetImageSetDirty(); -} -} +} // namespace DistributedHardware +} // namespace OHOS #endif \ No newline at end of file -- Gitee