Revert "[Fast Pair] Add Observer to FastPairDelegate"
This reverts commit 92905ae030
.
Reason for revert: Flag is expired and will not be landing
Original change's description:
> [Fast Pair] Add Observer to FastPairDelegate
>
> The observer includes methods to listen when the FastPairDevices list changes. The OnFastPairableDevicesChanged is not implemented yet but it will be used to notify the BT Config about a change and set the new FastPairDevices list.
>
> TESTED: Ran related unit tests.
>
> Bug: b/290067213
> Change-Id: Icfd078ab3eb0c7a4942467e9aae7d3f9cbc6f627
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4678589
> Reviewed-by: Theo Johnson-kanu <tjohnsonkanu@google.com>
> Reviewed-by: Daniel Classon <dclasson@google.com>
> Reviewed-by: Alex Kingsborough <akingsb@google.com>
> Reviewed-by: Gordon Seto <gordonseto@google.com>
> Commit-Queue: Paola Lacouture <paolalac@google.com>
> Cr-Commit-Position: refs/heads/main@{#1178005}
Bug: 378568944
Change-Id: Ic60b86e1520f64e13633cfa4a8a27f51f5f0bccb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6310079
Commit-Queue: Daniel Classon <dclasson@google.com>
Reviewed-by: Alex Kingsborough <akingsb@google.com>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1427267}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
88bb629b44
commit
bb8b35d94f
chromeos/ash/services/bluetooth_config
@ -47,7 +47,6 @@ static_library("bluetooth_config") {
|
||||
"discovery_session_manager_impl.h",
|
||||
"discovery_session_status_notifier.cc",
|
||||
"discovery_session_status_notifier.h",
|
||||
"fast_pair_delegate.cc",
|
||||
"fast_pair_delegate.h",
|
||||
"initializer.h",
|
||||
"initializer_impl.cc",
|
||||
|
@ -1,32 +0,0 @@
|
||||
// Copyright 2023 The Chromium Authors
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chromeos/ash/services/bluetooth_config/fast_pair_delegate.h"
|
||||
#include "ash/constants/ash_features.h"
|
||||
|
||||
namespace ash::bluetooth_config {
|
||||
|
||||
FastPairDelegate::FastPairDelegate() = default;
|
||||
|
||||
FastPairDelegate::~FastPairDelegate() = default;
|
||||
|
||||
void FastPairDelegate::AddObserver(Observer* observer) {
|
||||
observers_.AddObserver(observer);
|
||||
}
|
||||
|
||||
void FastPairDelegate::RemoveObserver(Observer* observer) {
|
||||
observers_.RemoveObserver(observer);
|
||||
}
|
||||
|
||||
void FastPairDelegate::NotifyFastPairableDevicesChanged(
|
||||
const std::vector<mojom::PairedBluetoothDevicePropertiesPtr>&
|
||||
fast_pairable_devices) {
|
||||
CHECK(base::FeatureList::IsEnabled(
|
||||
features::kFastPairDevicesBluetoothSettings));
|
||||
for (auto& obs : observers_) {
|
||||
obs.OnFastPairableDevicesChanged(fast_pairable_devices);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ash::bluetooth_config
|
@ -7,10 +7,6 @@
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/observer_list.h"
|
||||
#include "base/observer_list_types.h"
|
||||
#include "chromeos/ash/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom.h"
|
||||
|
||||
namespace ash::bluetooth_config {
|
||||
|
||||
class AdapterStateController;
|
||||
@ -22,17 +18,7 @@ class DeviceNameManager;
|
||||
// call each other.
|
||||
class FastPairDelegate {
|
||||
public:
|
||||
class Observer : public base::CheckedObserver {
|
||||
public:
|
||||
~Observer() override = default;
|
||||
|
||||
// Invoked when the list of fast pairable devices has changed. This callback
|
||||
// is used when a device has been added/removed from the list, or when one
|
||||
// or more properties of a device in the list has changed.
|
||||
virtual void OnFastPairableDevicesChanged(
|
||||
const std::vector<mojom::PairedBluetoothDevicePropertiesPtr>&
|
||||
fast_pairable_devices) = 0;
|
||||
};
|
||||
virtual ~FastPairDelegate() = default;
|
||||
|
||||
virtual std::optional<DeviceImageInfo> GetDeviceImageInfo(
|
||||
const std::string& mac_address) = 0;
|
||||
@ -42,21 +28,6 @@ class FastPairDelegate {
|
||||
virtual void SetAdapterStateController(
|
||||
AdapterStateController* adapter_state_controller) = 0;
|
||||
virtual void SetDeviceNameManager(DeviceNameManager* device_name_manager) = 0;
|
||||
|
||||
void AddObserver(Observer* observer);
|
||||
void RemoveObserver(Observer* observer);
|
||||
|
||||
protected:
|
||||
virtual ~FastPairDelegate();
|
||||
FastPairDelegate();
|
||||
|
||||
// For inherited classes to call, notifying observers tracked by base class.
|
||||
void NotifyFastPairableDevicesChanged(
|
||||
const std::vector<mojom::PairedBluetoothDevicePropertiesPtr>&
|
||||
fast_pairable_devices);
|
||||
|
||||
private:
|
||||
base::ObserverList<Observer> observers_;
|
||||
};
|
||||
|
||||
} // namespace ash::bluetooth_config
|
||||
|
Reference in New Issue
Block a user