// Copyright 2026 Google LLC // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef SHARING_LINUX_PLATFORM_LINUX_SHARING_PLATFORM_H_ #define SHARING_LINUX_PLATFORM_LINUX_SHARING_PLATFORM_H_ #include #include #include "internal/platform/implementation/linux/bluetooth_adapter.h" #include "location/nearby/sharing/lib/account/account_manager.h" #include "sharing/internal/api/sharing_platform.h" namespace nearby::sharing::linux { class LinuxSharingPlatform final : public api::SharingPlatform { public: LinuxSharingPlatform(); explicit LinuxSharingPlatform(std::string device_name_override); ~LinuxSharingPlatform() override; LinuxSharingPlatform(const LinuxSharingPlatform&) = delete; LinuxSharingPlatform& operator=(const LinuxSharingPlatform&) = delete; void InitProductIdGetter( absl::string_view (*product_id_getter)()) override; std::unique_ptr CreateNetworkMonitor( std::function lan_connected_callback, std::function internet_connected_callback) override; api::BluetoothAdapter& GetBluetoothAdapter() override; nearby::api::FastInitBleBeacon& GetFastInitBleBeacon() override; nearby::api::FastInitiationManager& GetFastInitiationManager() override; std::unique_ptr CreateSystemInfo() override; std::unique_ptr CreateAppInfo() override; api::PreferenceManager& GetPreferenceManager() override; AccountManager& GetAccountManager() override; nearby::api::DeviceInfo& GetDeviceInfo() override; std::unique_ptr CreatePublicCertificateDatabase(const FilePath& database_path) override; bool UpdateFileOriginMetadata(std::vector& file_paths) override; private: void Initialize(std::string device_name_override); std::shared_ptr<::nearby::linux::BluetoothAdapter> fast_init_adapter_; std::unique_ptr preference_manager_; std::unique_ptr account_manager_; std::unique_ptr bluetooth_adapter_; std::unique_ptr fast_init_ble_beacon_; std::unique_ptr fast_initiation_manager_; std::unique_ptr device_info_; absl::string_view (*product_id_getter_)() = nullptr; }; } // namespace nearby::sharing::linux #endif // SHARING_LINUX_PLATFORM_LINUX_SHARING_PLATFORM_H_