From f772e4e4956495a90c6d8d487c75baa34245099d Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Wed, 25 Jun 2025 14:51:53 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E9=80=9A=E7=9F=A5=E6=8F=90=E5=89=8D=E4=BC=A0?= =?UTF-8?q?=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- services/distributed/src/soft_bus/distributed_cmd_service.cpp | 2 -- services/distributed/src/soft_bus/distributed_service.cpp | 3 --- 2 files changed, 5 deletions(-) diff --git a/services/distributed/src/soft_bus/distributed_cmd_service.cpp b/services/distributed/src/soft_bus/distributed_cmd_service.cpp index 6573549c3..1ea9f0372 100644 --- a/services/distributed/src/soft_bus/distributed_cmd_service.cpp +++ b/services/distributed/src/soft_bus/distributed_cmd_service.cpp @@ -219,8 +219,6 @@ void DistributedService::HandleMatchSync(const std::shared_ptr& boxMessa SyncAllLiveViewNotification(peerDevice, true); } else if (matchType == MatchType::MATCH_ACK) { InitDeviceState(peerDevice); - RequestBundlesIcon(peerDevice); - ReportBundleIconList(peerDevice); SubscribeNotifictaion(peerDevice); SyncAllLiveViewNotification(peerDevice, false); } diff --git a/services/distributed/src/soft_bus/distributed_service.cpp b/services/distributed/src/soft_bus/distributed_service.cpp index 98a4859c6..1721421c9 100644 --- a/services/distributed/src/soft_bus/distributed_service.cpp +++ b/services/distributed/src/soft_bus/distributed_service.cpp @@ -159,9 +159,6 @@ void DistributedService::OnHandleMsg(std::shared_ptr& box) case NotificationEventType::REMOVE_ALL_NOTIFICATIONS: RemoveNotifications(box); break; - case NotificationEventType::BUNDLE_ICON_SYNC: - HandleBundleIconSync(box); - break; case NotificationEventType::SYNC_NOTIFICATION: HandleNotificationSync(box); break; -- Gitee From 1c67d163f7d724988a2c3b4fc31eb60b0c6660e0 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Sat, 12 Jul 2025 11:30:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90=E5=90=8C=E6=AD=A5=E3=80=91=20?= =?UTF-8?q?=E4=B8=BB=E5=8A=A8=E5=90=8C=E6=AD=A5=E5=AE=9E=E5=86=B5=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=9C=AA=E6=A0=A1=E9=AA=8C=E5=AE=9E=E5=86=B5=E5=8D=8F?= =?UTF-8?q?=E5=90=8C=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- .../src/soft_bus/distributed_cmd_service.cpp | 18 +++++++++++++++++- .../src/soft_bus/distributed_service.cpp | 5 +++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/services/distributed/src/soft_bus/distributed_cmd_service.cpp b/services/distributed/src/soft_bus/distributed_cmd_service.cpp index 1ea9f0372..2d7ef6762 100644 --- a/services/distributed/src/soft_bus/distributed_cmd_service.cpp +++ b/services/distributed/src/soft_bus/distributed_cmd_service.cpp @@ -49,6 +49,8 @@ std::string TransDeviceTypeIdToName(uint16_t deviceType) namespace { constexpr uint32_t DEFAULT_LOCK_SCREEN_FLAG = 2; +constexpr static const char* WEARABLE_DEVICE_TYPE = "wearable"; +constexpr static const char* LITEWEARABLE_DEVICE_TYPE = "liteWearable"; } void DistributedService::InitDeviceState(const DistributedDeviceInfo device) @@ -140,8 +142,22 @@ void DistributedService::SyncAllLiveViewNotification(const DistributedDeviceInfo return; } + // wearable switch set by litewearable + std::string deviceType = TransDeviceTypeIdToName(iter->second.deviceType_); + if (deviceType == WEARABLE_DEVICE_TYPE) { + deviceType = LITEWEARABLE_DEVICE_TYPE; + } + + bool enable = false; + auto result = NotificationHelper::IsDistributedEnabledBySlot(NotificationConstant::SlotType::LIVE_VIEW, + deviceType, enable); + if (result != ERR_OK || !enable) { + ANS_LOGW("Dans get switch %{public}s failed %{public}d.", deviceType.c_str(), result); + return; + } + std::vector> notifications; - auto result = NotificationHelper::GetAllNotificationsBySlotType(notifications, + result = NotificationHelper::GetAllNotificationsBySlotType(notifications, NotificationConstant::SlotType::LIVE_VIEW); if (result != ERR_OK) { ANS_LOGI("Dans get all active %{public}d.", result); diff --git a/services/distributed/src/soft_bus/distributed_service.cpp b/services/distributed/src/soft_bus/distributed_service.cpp index 1721421c9..0109d56e8 100644 --- a/services/distributed/src/soft_bus/distributed_service.cpp +++ b/services/distributed/src/soft_bus/distributed_service.cpp @@ -198,10 +198,11 @@ int64_t DistributedService::GetCurrentTime() void DistributedService::SendEventReport( int32_t messageType, int32_t errCode, const std::string& errorReason) { - if (sendReportCallback_ != nullptr || + if (sendReportCallback_ == nullptr || localDevice_.deviceType_ != DistributedHardware::DmDeviceType::DEVICE_TYPE_PHONE) { - sendReportCallback_(messageType, errCode, errorReason); + return; } + sendReportCallback_(messageType, errCode, errorReason); } void DistributedService::InitHACallBack( -- Gitee From ad0846ff21b9375bff2487f4d8f7ed4bac3f9339 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Mon, 28 Jul 2025 10:47:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=B8=BAbyte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- .../src/soft_bus/distributed_subscribe_service.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/services/distributed/src/soft_bus/distributed_subscribe_service.cpp b/services/distributed/src/soft_bus/distributed_subscribe_service.cpp index 1a7b4b168..c4fad07ea 100644 --- a/services/distributed/src/soft_bus/distributed_subscribe_service.cpp +++ b/services/distributed/src/soft_bus/distributed_subscribe_service.cpp @@ -301,8 +301,12 @@ void DistributedService::OnBatchCanceled(const std::vectorsubmit(task); } @@ -329,8 +333,12 @@ void DistributedService::OnCanceled(const std::shared_ptr& notific ANS_LOGW("dans OnCanceled serialize failed"); return; } + TransDataType dataType = TransDataType::DATA_TYPE_MESSAGE; + if (peerDevice.deviceType_ != DistributedHardware::DmDeviceType::DEVICE_TYPE_PHONE) { + dataType = TransDataType::DATA_TYPE_BYTES; + } DistributedClient::GetInstance().SendMessage(removeBox.GetByteBuffer(), removeBox.GetByteLength(), - TransDataType::DATA_TYPE_MESSAGE, peerDevice.deviceId_, peerDevice.deviceType_); + dataType, peerDevice.deviceId_, peerDevice.deviceType_); }); serviceQueue_->submit(task); } -- Gitee