blob: 920dcd563a277b8e55341249e69115e54ee031b8 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/macros.h"
#include "components/cryptauth/remote_device_ref.h"
namespace chromeos {
namespace tether {
// Prioritizes the order of devices when performing a host scan. To optimize for
// the most common tethering operations, this class uses the following rules:
// * The device which has most recently sent a successful
// ConnectTetheringResponse is always at the front of the queue.
// * Devices which have most recently sent a successful
// TetherAvailabilityResponse are next in the order, as long as they do not
// violate the first rule.
// * All other devices are left in the order they are passed.
class HostScanDevicePrioritizer {
HostScanDevicePrioritizer() {}
virtual ~HostScanDevicePrioritizer() {}
// Prioritizes |remote_devices| using the rules described above.
virtual void SortByHostScanOrder(
cryptauth::RemoteDeviceRefList* remote_devices) const = 0;
} // namespace tether
} // namespace chromeos