Do not claim/release blacklisted devices
This prevents the device claimer from unintentionally removing
blacklisted devices (specified through command line) from the
blacklist.
Any attempt to claim/release blacklisted devices will results in
an error.
Bug: 25448373
TEST=Verify p2p0 interface is not managed by shill after device setup
on Brillo devices
TEST=Run newly added unit tests
Change-Id: I14323de2f125d92dc6207d2a4768b7dd4735b850
diff --git a/manager.h b/manager.h
index 7baf598..44c162e 100644
--- a/manager.h
+++ b/manager.h
@@ -124,7 +124,8 @@
void RegisterAsync(const base::Callback<void(bool)>& completion_callback);
- virtual void AddDeviceToBlackList(const std::string& device_name);
+ virtual void SetBlacklistedDevices(
+ const std::vector<std::string>& blacklisted_devices);
virtual void Start();
virtual void Stop();
@@ -566,6 +567,7 @@
FRIEND_TEST(DeviceTest, AcquireIPConfigWithSelectedService);
FRIEND_TEST(DeviceTest, StartProhibited);
FRIEND_TEST(ManagerTest, AvailableTechnologies);
+ FRIEND_TEST(ManagerTest, ClaimBlacklistedDevice);
FRIEND_TEST(ManagerTest, ClaimDeviceWhenClaimerNotVerified);
FRIEND_TEST(ManagerTest, ClaimDeviceWithoutClaimer);
FRIEND_TEST(ManagerTest, ConnectedTechnologies);
@@ -596,6 +598,7 @@
FRIEND_TEST(ManagerTest, PopProfileWithUnload);
FRIEND_TEST(ManagerTest, RegisterKnownService);
FRIEND_TEST(ManagerTest, RegisterUnknownService);
+ FRIEND_TEST(ManagerTest, ReleaseBlacklistedDevice);
FRIEND_TEST(ManagerTest, ReleaseDevice);
FRIEND_TEST(ManagerTest, RunTerminationActions);
FRIEND_TEST(ManagerTest, ServiceRegistration);
@@ -901,6 +904,9 @@
// Whether any of the services is in connected state or not.
bool is_connected_state_;
+ // List of blacklisted devices specified from command line.
+ std::vector<std::string> blacklisted_devices_;
+
// List of DHCPv6 enabled devices.
std::vector<std::string> dhcpv6_enabled_devices_;