From 79d78cb28b114f8846acfbbd460959f5c8c6a906 Mon Sep 17 00:00:00 2001 From: pang-wenbin2 Date: Thu, 24 Feb 2022 03:56:06 -0800 Subject: [PATCH 1/7] add file --- ext/profile/include/device_profile_adapter.h | 3 ++- ext/profile/src/device_profile_adapter.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/profile/include/device_profile_adapter.h b/ext/profile/include/device_profile_adapter.h index 3703a619a..0155daae8 100644 --- a/ext/profile/include/device_profile_adapter.h +++ b/ext/profile/include/device_profile_adapter.h @@ -24,7 +24,8 @@ namespace OHOS { namespace DistributedHardware { -class DeviceProfileAdapter : public IProfileAdapter, public IProfileConnectorCallback { +class DeviceProfileAdapter : public IProfileAdapter, public IProfileConnectorCallback, //{ + public std::enable_shared_from_this { public: DeviceProfileAdapter(); ~DeviceProfileAdapter(); diff --git a/ext/profile/src/device_profile_adapter.cpp b/ext/profile/src/device_profile_adapter.cpp index 5d6165a01..697cf5a32 100644 --- a/ext/profile/src/device_profile_adapter.cpp +++ b/ext/profile/src/device_profile_adapter.cpp @@ -36,7 +36,8 @@ int32_t DeviceProfileAdapter::RegisterProfileListener(const std::string &pkgName { LOGI("DeviceProfileAdapter::RegisterProfileListener"); deviceProfileAdapterCallback_ = callback; - profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)); + //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)); + profileConnector_->RegisterProfileCallback(pkgName, deviceId, shared_from_this()); return DM_OK; } -- Gitee From a41795360f9ec828450fa8ee5775b03d66cd1c19 Mon Sep 17 00:00:00 2001 From: pang-wenbin2 Date: Thu, 24 Feb 2022 04:52:13 -0800 Subject: [PATCH 2/7] test file --- ext/profile/src/device_profile_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/profile/src/device_profile_adapter.cpp b/ext/profile/src/device_profile_adapter.cpp index 697cf5a32..f4df2c8ab 100644 --- a/ext/profile/src/device_profile_adapter.cpp +++ b/ext/profile/src/device_profile_adapter.cpp @@ -36,7 +36,7 @@ int32_t DeviceProfileAdapter::RegisterProfileListener(const std::string &pkgName { LOGI("DeviceProfileAdapter::RegisterProfileListener"); deviceProfileAdapterCallback_ = callback; - //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)); + //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)) profileConnector_->RegisterProfileCallback(pkgName, deviceId, shared_from_this()); return DM_OK; } -- Gitee From 2f98b0d0dc73592c9b88e9add251f20fae39a47e Mon Sep 17 00:00:00 2001 From: pang-wenbin2 Date: Thu, 24 Feb 2022 05:51:03 -0800 Subject: [PATCH 3/7] reset file --- ext/profile/src/device_profile_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/profile/src/device_profile_adapter.cpp b/ext/profile/src/device_profile_adapter.cpp index f4df2c8ab..697cf5a32 100644 --- a/ext/profile/src/device_profile_adapter.cpp +++ b/ext/profile/src/device_profile_adapter.cpp @@ -36,7 +36,7 @@ int32_t DeviceProfileAdapter::RegisterProfileListener(const std::string &pkgName { LOGI("DeviceProfileAdapter::RegisterProfileListener"); deviceProfileAdapterCallback_ = callback; - //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)) + //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)); profileConnector_->RegisterProfileCallback(pkgName, deviceId, shared_from_this()); return DM_OK; } -- Gitee From 2bd712d69a107a2d3bbcc31541179a8cafedd5c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyour?= Date: Thu, 24 Feb 2022 06:09:44 -0800 Subject: [PATCH 4/7] testfile point --- ext/profile/src/device_profile_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/profile/src/device_profile_adapter.cpp b/ext/profile/src/device_profile_adapter.cpp index 697cf5a32..f4df2c8ab 100644 --- a/ext/profile/src/device_profile_adapter.cpp +++ b/ext/profile/src/device_profile_adapter.cpp @@ -36,7 +36,7 @@ int32_t DeviceProfileAdapter::RegisterProfileListener(const std::string &pkgName { LOGI("DeviceProfileAdapter::RegisterProfileListener"); deviceProfileAdapterCallback_ = callback; - //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)); + //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)) profileConnector_->RegisterProfileCallback(pkgName, deviceId, shared_from_this()); return DM_OK; } -- Gitee From 4500b7474fae2f66620c7db7bc9292098cb6df31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyour?= Date: Thu, 24 Feb 2022 06:09:44 -0800 Subject: [PATCH 5/7] testfile point Signed-off-by: pang-wenbin2 --- ext/profile/src/device_profile_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/profile/src/device_profile_adapter.cpp b/ext/profile/src/device_profile_adapter.cpp index 697cf5a32..f4df2c8ab 100644 --- a/ext/profile/src/device_profile_adapter.cpp +++ b/ext/profile/src/device_profile_adapter.cpp @@ -36,7 +36,7 @@ int32_t DeviceProfileAdapter::RegisterProfileListener(const std::string &pkgName { LOGI("DeviceProfileAdapter::RegisterProfileListener"); deviceProfileAdapterCallback_ = callback; - //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)); + //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)) profileConnector_->RegisterProfileCallback(pkgName, deviceId, shared_from_this()); return DM_OK; } -- Gitee From e78a04511e4f8dff265a82797d02ab178ff95270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyour?= Date: Thu, 24 Feb 2022 06:17:28 -0800 Subject: [PATCH 6/7] testfile point2 --- ext/profile/src/device_profile_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/profile/src/device_profile_adapter.cpp b/ext/profile/src/device_profile_adapter.cpp index f4df2c8ab..697cf5a32 100644 --- a/ext/profile/src/device_profile_adapter.cpp +++ b/ext/profile/src/device_profile_adapter.cpp @@ -36,7 +36,7 @@ int32_t DeviceProfileAdapter::RegisterProfileListener(const std::string &pkgName { LOGI("DeviceProfileAdapter::RegisterProfileListener"); deviceProfileAdapterCallback_ = callback; - //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)) + //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)); profileConnector_->RegisterProfileCallback(pkgName, deviceId, shared_from_this()); return DM_OK; } -- Gitee From 1bd6151fa068d463d03d0a1a717ec5d8d4ff4f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyour?= Date: Thu, 24 Feb 2022 06:25:26 -0800 Subject: [PATCH 7/7] test add point Signed-off-by: pang-wenbin2 --- ext/profile/src/device_profile_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/profile/src/device_profile_adapter.cpp b/ext/profile/src/device_profile_adapter.cpp index f4df2c8ab..697cf5a32 100644 --- a/ext/profile/src/device_profile_adapter.cpp +++ b/ext/profile/src/device_profile_adapter.cpp @@ -36,7 +36,7 @@ int32_t DeviceProfileAdapter::RegisterProfileListener(const std::string &pkgName { LOGI("DeviceProfileAdapter::RegisterProfileListener"); deviceProfileAdapterCallback_ = callback; - //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)) + //profileConnector_->RegisterProfileCallback(pkgName, deviceId, std::shared_ptr(this)); profileConnector_->RegisterProfileCallback(pkgName, deviceId, shared_from_this()); return DM_OK; } -- Gitee