Revert "shill: Include pre-enabled technologies in EnabledTechnologies property."
This reverts commit 08a8e0583f02479b02a72175caf07600269e5f2c
Change-Id: Icc97434b2121fae5137bb9e3a5d9db4bc87b167a
Reviewed-on: https://gerrit.chromium.org/gerrit/41340
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/device_info.cc b/device_info.cc
index 5089e0d..975d44d 100644
--- a/device_info.cc
+++ b/device_info.cc
@@ -461,11 +461,6 @@
routing_table_->FlushRoutes(interface_index);
FlushAddresses(interface_index);
- infos_[interface_index].technology = technology;
- if (IsDevicePreEnabledForTechnology(technology)) {
- manager_->UpdateEnabledTechnologies();
- }
-
return device;
}
@@ -551,23 +546,6 @@
return it == indices_.end() ? -1 : it->second;
}
-bool DeviceInfo::IsDevicePreEnabledForTechnology(
- Technology::Identifier technology) const {
- return (technology == Technology::kCellular ||
- technology == Technology::kWiMax);
-}
-
-set<string> DeviceInfo::GetPreEnabledTechnologies() const {
- set<string> technologies;
- for (map<int, Info>::const_iterator it = infos_.begin(); it != infos_.end();
- ++it) {
- Technology::Identifier technology = it->second.technology;
- if (IsDevicePreEnabledForTechnology(technology))
- technologies.insert(Technology::NameFromIdentifier(technology));
- }
- return technologies;
-}
-
bool DeviceInfo::GetMACAddress(int interface_index, ByteString *address) const {
const Info *info = GetInfo(interface_index);
if (!info) {
@@ -731,16 +709,12 @@
map<int, Info>::iterator iter = infos_.find(interface_index);
if (iter != infos_.end()) {
SLOG(Device, 2) << "Removing info for device index: " << interface_index;
- Technology::Identifier technology = iter->second.technology;
if (iter->second.device.get()) {
manager_->DeregisterDevice(iter->second.device);
}
indices_.erase(iter->second.name);
infos_.erase(iter);
delayed_devices_.erase(interface_index);
- if (IsDevicePreEnabledForTechnology(technology)) {
- manager_->UpdateEnabledTechnologies();
- }
} else {
SLOG(Device, 2) << __func__ << ": Unknown device index: "
<< interface_index;
diff --git a/device_info.h b/device_info.h
index bf7bc76..9cc9141 100644
--- a/device_info.h
+++ b/device_info.h
@@ -97,9 +97,6 @@
// Returns the interface index for |interface_name| or -1 if unknown.
virtual int GetIndex(const std::string &interface_name) const;
- bool IsDevicePreEnabledForTechnology(Technology::Identifier technology) const;
- std::set<std::string> GetPreEnabledTechnologies() const;
-
private:
friend class DeviceInfoDelayedCreationTest;
friend class DeviceInfoTechnologyTest;
@@ -111,13 +108,7 @@
FRIEND_TEST(DeviceInfoTest, StartStop);
struct Info {
- Info()
- : flags(0),
- rx_bytes(0),
- tx_bytes(0),
- has_addresses_only(false),
- technology(Technology::kUnknown)
- {}
+ Info() : flags(0), rx_bytes(0), tx_bytes(0), has_addresses_only(false) {}
DeviceRefPtr device;
std::string name;
@@ -130,8 +121,6 @@
// This flag indicates that link information has not been retrieved yet;
// only the ip_addresses field is valid.
bool has_addresses_only;
-
- Technology::Identifier technology;
};
// Root of the kernel sysfs directory holding network device info.
diff --git a/device_info_unittest.cc b/device_info_unittest.cc
index 63af00d..5cff2df 100644
--- a/device_info_unittest.cc
+++ b/device_info_unittest.cc
@@ -329,7 +329,6 @@
// A cellular device should be offered to ModemInfo.
StrictMock<MockModemInfo> modem_info;
EXPECT_CALL(manager_, modem_info()).WillOnce(Return(&modem_info));
- EXPECT_CALL(manager_, UpdateEnabledTechnologies()).Times(1);
EXPECT_CALL(modem_info, OnDeviceInfoAvailable(kTestDeviceName)).Times(1);
EXPECT_CALL(routing_table_, FlushRoutes(kTestDeviceIndex)).Times(1);
EXPECT_CALL(rtnl_handler_, RemoveInterfaceAddress(kTestDeviceIndex,
@@ -344,7 +343,6 @@
// A WiMax device should be offered to WiMaxProvider.
StrictMock<MockWiMaxProvider> wimax_provider;
EXPECT_CALL(manager_, wimax_provider()).WillOnce(Return(&wimax_provider));
- EXPECT_CALL(manager_, UpdateEnabledTechnologies()).Times(1);
EXPECT_CALL(wimax_provider, OnDeviceInfoAvailable(kTestDeviceName)).Times(1);
EXPECT_CALL(routing_table_, FlushRoutes(kTestDeviceIndex)).Times(1);
EXPECT_CALL(rtnl_handler_, RemoveInterfaceAddress(kTestDeviceIndex,
diff --git a/doc/manager-api.txt b/doc/manager-api.txt
index 66a26b2..a6da636 100644
--- a/doc/manager-api.txt
+++ b/doc/manager-api.txt
@@ -330,12 +330,8 @@
array{string} EnabledTechnologies [readonly]
- The list of enabled and pre-enabled technologies.
- Enabled technologies are the technologies of devices that
- are currently enabled. Pre-enabled technologies are the
- technologies of devices that have been detected but may
- not have finished initialization and created a Device object.
- The strings are the same as the ones from the service types.
+ The list of enabled technologies. The strings
+ are the same as the ones from the service types.
string HostName [readwrite]
diff --git a/manager.cc b/manager.cc
index 524ffb7..537166c 100644
--- a/manager.cc
+++ b/manager.cc
@@ -1210,15 +1210,6 @@
unique_technologies.insert(
Technology::NameFromIdentifier((*it)->technology()));
}
-
- // TODO(benchan): Probably use a different property to track pre-enabled
- // technologies instead of overloading the EnabledTechnologies property.
- set<string> pre_enabled_technologies =
- device_info_.GetPreEnabledTechnologies();
- for (set<string>::const_iterator it = pre_enabled_technologies.begin();
- it != pre_enabled_technologies.end(); ++it) {
- unique_technologies.insert(*it);
- }
return vector<string>(unique_technologies.begin(), unique_technologies.end());
}