From 1f5654089f47aa0f5419fa034a6db930f081dfaf Mon Sep 17 00:00:00 2001 From: Anay Wadhera Date: Thu, 27 Jun 2024 12:16:57 -0700 Subject: [PATCH] remove obsolete analytics functions PiperOrigin-RevId: 647404733 --- sharing/analytics/analytics_recorder.cc | 29 ----------------- sharing/analytics/analytics_recorder.h | 6 ---- sharing/nearby_sharing_settings.cc | 14 --------- sharing/nearby_sharing_settings.h | 6 ---- sharing/nearby_sharing_settings_test.cc | 42 ------------------------- 5 files changed, 97 deletions(-) diff --git a/sharing/analytics/analytics_recorder.cc b/sharing/analytics/analytics_recorder.cc index d37ffc0d..4c6e771b 100644 --- a/sharing/analytics/analytics_recorder.cc +++ b/sharing/analytics/analytics_recorder.cc @@ -990,35 +990,6 @@ void AnalyticsRecorder::NewVerifyAPKStatus( LogEvent(*sharing_log); } -void AnalyticsRecorder::NewSendDesktopNotification(DesktopNotification event) { - std::unique_ptr sharing_log = CreateSharingLog( - EventCategory::SETTINGS_EVENT, EventType::SEND_DESKTOP_NOTIFICATION); - - auto send_desktop_notification = - analytics::proto::SharingLog::SendDesktopNotification::default_instance() - .New(); - send_desktop_notification->set_event(event); - - sharing_log->set_allocated_send_desktop_notification( - send_desktop_notification); - LogEvent(*sharing_log); -} - -void AnalyticsRecorder::NewSendDesktopTransferEvent( - DesktopTransferEventType event) { - std::unique_ptr sharing_log = CreateSharingLog( - EventCategory::SETTINGS_EVENT, EventType::SEND_DESKTOP_TRANSFER_EVENT); - - auto send_desktop_transfer_event = - analytics::proto::SharingLog::SendDesktopTransferEvent::default_instance() - .New(); - send_desktop_transfer_event->set_event(event); - - sharing_log->set_allocated_send_desktop_transfer_event( - send_desktop_transfer_event); - LogEvent(*sharing_log); -} - // Start private methods. std::unique_ptr AnalyticsRecorder::CreateSharingLog( diff --git a/sharing/analytics/analytics_recorder.h b/sharing/analytics/analytics_recorder.h index 9f33131f..5515d74b 100644 --- a/sharing/analytics/analytics_recorder.h +++ b/sharing/analytics/analytics_recorder.h @@ -194,12 +194,6 @@ class AnalyticsRecorder { location::nearby::proto::sharing::VerifyAPKStatus status, location::nearby::proto::sharing::ApkSource source); - void NewSendDesktopNotification( - location::nearby::proto::sharing::DesktopNotification event); - - void NewSendDesktopTransferEvent( - location::nearby::proto::sharing::DesktopTransferEventType event); - // Generates a random number for session ID or flow ID. int64_t GenerateNextId(); diff --git a/sharing/nearby_sharing_settings.cc b/sharing/nearby_sharing_settings.cc index e0a063f0..c38e0e73 100644 --- a/sharing/nearby_sharing_settings.cc +++ b/sharing/nearby_sharing_settings.cc @@ -574,20 +574,6 @@ void NearbyShareSettings::SetIsAllContactsEnabled( } } -void NearbyShareSettings::SendDesktopNotification( - DesktopNotification event) const { - if (analytics_recorder_ != nullptr) { - analytics_recorder_->NewSendDesktopNotification(event); - } -} - -void NearbyShareSettings::SendDesktopTransferEvent( - DesktopTransferEventType event) const { - if (analytics_recorder_ != nullptr) { - analytics_recorder_->NewSendDesktopTransferEvent(event); - } -} - bool NearbyShareSettings::is_fast_initiation_hardware_supported() { MutexLock lock(&mutex_); return is_fast_initiation_hardware_supported_; diff --git a/sharing/nearby_sharing_settings.h b/sharing/nearby_sharing_settings.h index 4a9ba78b..8d8868b9 100644 --- a/sharing/nearby_sharing_settings.h +++ b/sharing/nearby_sharing_settings.h @@ -234,12 +234,6 @@ class NearbyShareSettings bool did_full_name_change, bool did_icon_url_change) override; - void SendDesktopNotification( - ::location::nearby::proto::sharing::DesktopNotification event) const; - - void SendDesktopTransferEvent( - ::location::nearby::proto::sharing::DesktopTransferEventType event) const; - std::string Dump() const; private: diff --git a/sharing/nearby_sharing_settings_test.cc b/sharing/nearby_sharing_settings_test.cc index 43c256c1..080e961d 100644 --- a/sharing/nearby_sharing_settings_test.cc +++ b/sharing/nearby_sharing_settings_test.cc @@ -517,48 +517,6 @@ TEST_F(NearbyShareSettingsTest, GetAndSetAllowedContacts) { EXPECT_EQ(allowed_contacts.size(), 0u); } -TEST_F(NearbyShareSettingsTest, SendDesktopNotification) { - settings()->SendDesktopNotification( - DesktopNotification::DESKTOP_NOTIFICATION_UNKNOWN); - settings()->SendDesktopNotification( - DesktopNotification::DESKTOP_NOTIFICATION_CONNECTING); - settings()->SendDesktopNotification( - DesktopNotification::DESKTOP_NOTIFICATION_PROGRESS); - settings()->SendDesktopNotification( - DesktopNotification::DESKTOP_NOTIFICATION_ACCEPT); - settings()->SendDesktopNotification( - DesktopNotification::DESKTOP_NOTIFICATION_RECEIVED); - settings()->SendDesktopNotification( - DesktopNotification::DESKTOP_NOTIFICATION_ERROR); -} - -TEST_F(NearbyShareSettingsTest, ReceiveDesktopTransferEvent) { - settings()->SendDesktopTransferEvent( - DesktopTransferEventType::DESKTOP_TRANSFER_EVENT_TYPE_UNKNOWN); - settings()->SendDesktopTransferEvent( - DesktopTransferEventType::DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ACCEPT); - settings()->SendDesktopTransferEvent( - DesktopTransferEventType::DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_PROGRESS); - settings()->SendDesktopTransferEvent( - DesktopTransferEventType::DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_RECEIVED); - settings()->SendDesktopTransferEvent( - DesktopTransferEventType::DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ERROR); -} - -TEST_F(NearbyShareSettingsTest, SendDesktopTransferEvent) { - settings()->SendDesktopTransferEvent( - DesktopTransferEventType::DESKTOP_TRANSFER_EVENT_TYPE_UNKNOWN); - settings()->SendDesktopTransferEvent( - DesktopTransferEventType::DESKTOP_TRANSFER_EVENT_SEND_TYPE_START); - settings()->SendDesktopTransferEvent( - DesktopTransferEventType:: - DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE); - settings()->SendDesktopTransferEvent( - DesktopTransferEventType::DESKTOP_TRANSFER_EVENT_SEND_TYPE_PROGRESS); - settings()->SendDesktopTransferEvent( - DesktopTransferEventType::DESKTOP_TRANSFER_EVENT_SEND_TYPE_SENT); -} - } // namespace } // namespace sharing } // namespace nearby