Remove unused WifiAdapter.

PiperOrigin-RevId: 800083180
This commit is contained in:
Francis Tsui
2025-08-27 10:17:09 -07:00
committed by Copybara-Service
parent cb683e484f
commit a5478bd1c9
17 changed files with 0 additions and 353 deletions
-2
View File
@@ -28,7 +28,6 @@ cc_library(
"sharing_platform.h",
"sharing_rpc_client.h",
"system_info.h",
"wifi_adapter.h",
],
visibility = [
"//location/nearby/analytics/cpp/logging:__pkg__",
@@ -69,7 +68,6 @@ cc_library(
"mock_public_certificate_db.h",
"mock_sharing_platform.h",
"mock_system_info.h",
"mock_wifi_adapter.h",
],
visibility = ["//visibility:public"],
deps = [
@@ -37,7 +37,6 @@
#include "sharing/internal/api/sharing_platform.h"
#include "sharing/internal/api/sharing_rpc_client.h"
#include "sharing/internal/api/system_info.h"
#include "sharing/internal/api/wifi_adapter.h"
namespace nearby::sharing::api {
@@ -61,9 +60,6 @@ class MockSharingPlatform : public SharingPlatform {
MOCK_METHOD(nearby::sharing::api::BluetoothAdapter&, GetBluetoothAdapter, (),
(override));
MOCK_METHOD(nearby::sharing::api::WifiAdapter&, GetWifiAdapter, (),
(override));
MOCK_METHOD(nearby::api::FastInitBleBeacon&, GetFastInitBleBeacon, (),
(override));
-42
View File
@@ -1,42 +0,0 @@
// Copyright 2024 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 THIRD_PARTY_NEARBY_SHARING_INTERNAL_API_MOCK_WIFI_ADAPTER_H_
#define THIRD_PARTY_NEARBY_SHARING_INTERNAL_API_MOCK_WIFI_ADAPTER_H_
#include <functional>
#include "gmock/gmock.h"
#include "sharing/internal/api/wifi_adapter.h"
namespace nearby::sharing::api {
class MockWifiAdapter : public nearby::sharing::api::WifiAdapter {
public:
MockWifiAdapter() = default;
MockWifiAdapter(const MockWifiAdapter&) = delete;
MockWifiAdapter& operator=(const MockWifiAdapter&) = delete;
~MockWifiAdapter() override = default;
MOCK_METHOD(bool, IsPresent, (), (const, override));
MOCK_METHOD(bool, IsPowered, (), (const, override));
MOCK_METHOD(void, SetPowered,
(bool powered, std::function<void()> success_callback,
std::function<void()> error_callback),
(override));
};
} // namespace nearby::sharing::api
#endif // THIRD_PARTY_NEARBY_SHARING_INTERNAL_API_MOCK_WIFI_ADAPTER_H_
-3
View File
@@ -35,7 +35,6 @@
#include "sharing/internal/api/public_certificate_database.h"
#include "sharing/internal/api/sharing_rpc_client.h"
#include "sharing/internal/api/system_info.h"
#include "sharing/internal/api/wifi_adapter.h"
namespace nearby::sharing::api {
@@ -55,8 +54,6 @@ class SharingPlatform {
virtual BluetoothAdapter& GetBluetoothAdapter() = 0;
virtual WifiAdapter& GetWifiAdapter() = 0;
virtual nearby::api::FastInitBleBeacon& GetFastInitBleBeacon() = 0;
virtual nearby::api::FastInitiationManager& GetFastInitiationManager() = 0;
-59
View File
@@ -1,59 +0,0 @@
// Copyright 2023 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 THIRD_PARTY_NEARBY_SHARING_INTERNAL_API_WIFI_ADAPTER_H_
#define THIRD_PARTY_NEARBY_SHARING_INTERNAL_API_WIFI_ADAPTER_H_
#include <array>
#include <functional>
#include <optional>
#include <string>
#include "absl/status/status.h"
namespace nearby {
namespace sharing {
namespace api {
class WifiAdapter {
public:
enum class PermissionStatus {
kUndetermined = 0,
kSystemDenied,
kUserDenied,
kAllowed
};
virtual ~WifiAdapter() = default;
// Indicates whether the adapter is actually present/not disabled by the
// device firmware or hardware switch on the system.
virtual bool IsPresent() const = 0;
// Indicates whether the adapter radio is powered.
virtual bool IsPowered() const = 0;
// Requests a change to the adapter radio power. Setting `powered` to true
// will turn on the radio and false will turn it off. On success,
// `success_callback` will be called. On failure, `error_callback` will be
// called.
virtual void SetPowered(bool powered, std::function<void()> success_callback,
std::function<void()> error_callback) = 0;
};
} // namespace api
} // namespace sharing
} // namespace nearby
#endif // THIRD_PARTY_NEARBY_SHARING_INTERNAL_API_WIFI_ADAPTER_H_