mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 07:36:10 -04:00
Move SharingRpcClientFactory into SharingPlatform.
PiperOrigin-RevId: 600914923
This commit is contained in:
committed by
Copybara-Service
parent
e2aa37ab04
commit
10c4f5ede4
@@ -143,7 +143,6 @@ cc_library(
|
||||
"//proto:sharing_enums_cc_proto",
|
||||
"//sharing/analytics",
|
||||
"//sharing/certificates",
|
||||
"//sharing/client",
|
||||
"//sharing/common",
|
||||
"//sharing/common:compatible_u8_string",
|
||||
"//sharing/contacts",
|
||||
|
||||
@@ -39,6 +39,7 @@ cc_library(
|
||||
"//sharing:__subpackages__",
|
||||
],
|
||||
deps = [
|
||||
"//internal/analytics:event_logger",
|
||||
"//internal/platform:types",
|
||||
"//internal/platform/implementation:types",
|
||||
"//sharing/proto:share_cc_proto",
|
||||
@@ -65,6 +66,7 @@ cc_library(
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":platform",
|
||||
"//internal/analytics:event_logger",
|
||||
"//internal/platform:types",
|
||||
"//internal/platform/implementation:types",
|
||||
"@com_google_absl//absl/functional:any_invocable",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "internal/analytics/event_logger.h"
|
||||
#include "internal/platform/device_info.h"
|
||||
#include "internal/platform/implementation/account_manager.h"
|
||||
#include "internal/platform/task_runner.h"
|
||||
@@ -32,6 +33,7 @@
|
||||
#include "sharing/internal/api/preference_manager.h"
|
||||
#include "sharing/internal/api/public_certificate_database.h"
|
||||
#include "sharing/internal/api/sharing_platform.h"
|
||||
#include "sharing/internal/api/sharing_rpc_client.h"
|
||||
#include "sharing/internal/api/shell.h"
|
||||
#include "sharing/internal/api/system_info.h"
|
||||
#include "sharing/internal/api/wifi_adapter.h"
|
||||
@@ -93,6 +95,9 @@ class MockSharingPlatform : public SharingPlatform {
|
||||
MOCK_METHOD(std::unique_ptr<PublicCertificateDatabase>,
|
||||
CreatePublicCertificateDatabase,
|
||||
(absl::string_view database_path), (override));
|
||||
MOCK_METHOD(std::unique_ptr<SharingRpcClientFactory>,
|
||||
CreateSharingRpcClientFactory,
|
||||
(nearby::analytics::EventLogger * event_logger), (override));
|
||||
};
|
||||
|
||||
} // namespace nearby::sharing::api
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "internal/analytics/event_logger.h"
|
||||
#include "internal/platform/device_info.h"
|
||||
#include "internal/platform/implementation/account_manager.h"
|
||||
#include "internal/platform/task_runner.h"
|
||||
@@ -30,6 +31,7 @@
|
||||
#include "sharing/internal/api/network_monitor.h"
|
||||
#include "sharing/internal/api/preference_manager.h"
|
||||
#include "sharing/internal/api/public_certificate_database.h"
|
||||
#include "sharing/internal/api/sharing_rpc_client.h"
|
||||
#include "sharing/internal/api/shell.h"
|
||||
#include "sharing/internal/api/system_info.h"
|
||||
#include "sharing/internal/api/wifi_adapter.h"
|
||||
@@ -90,6 +92,10 @@ class SharingPlatform {
|
||||
virtual nearby::DeviceInfo& GetDeviceInfo() = 0;
|
||||
virtual std::unique_ptr<PublicCertificateDatabase>
|
||||
CreatePublicCertificateDatabase(absl::string_view database_path) = 0;
|
||||
|
||||
virtual std::unique_ptr<SharingRpcClientFactory>
|
||||
CreateSharingRpcClientFactory(
|
||||
nearby::analytics::EventLogger* event_logger) = 0;
|
||||
};
|
||||
} // namespace nearby::sharing::api
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
#include "sharing/certificates/nearby_share_certificate_manager_impl.h"
|
||||
#include "sharing/certificates/nearby_share_decrypted_public_certificate.h"
|
||||
#include "sharing/certificates/nearby_share_encrypted_metadata_key.h"
|
||||
#include "sharing/client/nearby_share_client_impl.h"
|
||||
#include "sharing/common/compatible_u8_string.h"
|
||||
#include "sharing/common/nearby_share_enums.h"
|
||||
#include "sharing/common/nearby_share_prefs.h"
|
||||
@@ -196,8 +195,7 @@ NearbySharingServiceImpl::NearbySharingServiceImpl(
|
||||
decoder_(decoder),
|
||||
nearby_connections_manager_(std::move(nearby_connections_manager)),
|
||||
nearby_share_client_factory_(
|
||||
std::make_unique<NearbyShareClientFactoryImpl>(
|
||||
device_info_.GetOsType(), account_manager_, event_logger)),
|
||||
sharing_platform.CreateSharingRpcClientFactory(event_logger)),
|
||||
profile_info_provider_(
|
||||
std::make_unique<NearbyShareProfileInfoProviderImpl>(
|
||||
device_info_, account_manager_)),
|
||||
|
||||
Reference in New Issue
Block a user