update_engine: Remove references to bluetooth and wimax
Shill does not support bluetooth (kTypeBluetooth is left over from the
flimflam API) and has stopped supporting Wimax.
BUG=chromium:954635
TEST=`FEATURES="test" emerge-$BOARD update_engine update_engine-client`
Change-Id: I3e7d4f0b0a7625067585b6f9fdeec196b87f7026
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1752329
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Tested-by: Alex Khouderchah <akhouderchah@chromium.org>
Commit-Queue: Alex Khouderchah <akhouderchah@chromium.org>
diff --git a/update_manager/boxed_value_unittest.cc b/update_manager/boxed_value_unittest.cc
index f98b6b6..5b87a7b 100644
--- a/update_manager/boxed_value_unittest.cc
+++ b/update_manager/boxed_value_unittest.cc
@@ -168,11 +168,6 @@
BoxedValue(new ConnectionType(ConnectionType::kEthernet)).ToString());
EXPECT_EQ("wifi",
BoxedValue(new ConnectionType(ConnectionType::kWifi)).ToString());
- EXPECT_EQ("wimax",
- BoxedValue(new ConnectionType(ConnectionType::kWimax)).ToString());
- EXPECT_EQ(
- "bluetooth",
- BoxedValue(new ConnectionType(ConnectionType::kBluetooth)).ToString());
EXPECT_EQ(
"cellular",
BoxedValue(new ConnectionType(ConnectionType::kCellular)).ToString());
@@ -219,9 +214,9 @@
TEST(UmBoxedValueTest, SetConnectionTypeToString) {
set<ConnectionType>* set1 = new set<ConnectionType>;
- set1->insert(ConnectionType::kWimax);
+ set1->insert(ConnectionType::kCellular);
set1->insert(ConnectionType::kEthernet);
- EXPECT_EQ("ethernet,wimax", BoxedValue(set1).ToString());
+ EXPECT_EQ("ethernet,cellular", BoxedValue(set1).ToString());
set<ConnectionType>* set2 = new set<ConnectionType>;
set2->insert(ConnectionType::kWifi);
diff --git a/update_manager/chromeos_policy.cc b/update_manager/chromeos_policy.cc
index 08c355e..12d443d 100644
--- a/update_manager/chromeos_policy.cc
+++ b/update_manager/chromeos_policy.cc
@@ -457,7 +457,7 @@
// TODO(garnold) The current logic generally treats the list of allowed
// connections coming from the device policy as a whitelist, meaning that it
// can only be used for enabling connections, but not disable them. Further,
-// certain connection types (like Bluetooth) cannot be enabled even by policy.
+// certain connection types cannot be enabled even by policy.
// In effect, the only thing that device policy can change is to enable
// updates over a cellular network (disabled by default). We may want to
// revisit this semantics, allowing greater flexibility in defining specific
@@ -488,10 +488,6 @@
*result = true;
bool device_policy_can_override = false;
switch (conn_type) {
- case ConnectionType::kBluetooth:
- *result = false;
- break;
-
case ConnectionType::kCellular:
*result = false;
device_policy_can_override = true;
diff --git a/update_manager/chromeos_policy_unittest.cc b/update_manager/chromeos_policy_unittest.cc
index 25c91fa..414ac0d 100644
--- a/update_manager/chromeos_policy_unittest.cc
+++ b/update_manager/chromeos_policy_unittest.cc
@@ -1440,47 +1440,6 @@
EXPECT_TRUE(result);
}
-TEST_F(UmChromeOSPolicyTest, UpdateDownloadAllowedWimaxDefault) {
- // Wimax is always allowed.
-
- fake_state_.shill_provider()->var_conn_type()->reset(
- new ConnectionType(ConnectionType::kWifi));
-
- bool result;
- ExpectPolicyStatus(
- EvalStatus::kSucceeded, &Policy::UpdateDownloadAllowed, &result);
- EXPECT_TRUE(result);
-}
-
-TEST_F(UmChromeOSPolicyTest,
- UpdateCurrentConnectionNotAllowedBluetoothDefault) {
- // Bluetooth is never allowed.
-
- fake_state_.shill_provider()->var_conn_type()->reset(
- new ConnectionType(ConnectionType::kBluetooth));
-
- bool result;
- ExpectPolicyStatus(
- EvalStatus::kAskMeAgainLater, &Policy::UpdateDownloadAllowed, &result);
-}
-
-TEST_F(UmChromeOSPolicyTest,
- UpdateCurrentConnectionNotAllowedBluetoothPolicyCannotOverride) {
- // Bluetooth cannot be allowed even by policy.
-
- fake_state_.shill_provider()->var_conn_type()->reset(
- new ConnectionType(ConnectionType::kBluetooth));
- set<ConnectionType> allowed_connections;
- allowed_connections.insert(ConnectionType::kBluetooth);
- fake_state_.device_policy_provider()
- ->var_allowed_connection_types_for_update()
- ->reset(new set<ConnectionType>(allowed_connections));
-
- bool result;
- ExpectPolicyStatus(
- EvalStatus::kAskMeAgainLater, &Policy::UpdateDownloadAllowed, &result);
-}
-
TEST_F(UmChromeOSPolicyTest, UpdateCurrentConnectionNotAllowedCellularDefault) {
// Cellular is not allowed by default.
diff --git a/update_manager/real_device_policy_provider_unittest.cc b/update_manager/real_device_policy_provider_unittest.cc
index 8f2c377..84debd1 100644
--- a/update_manager/real_device_policy_provider_unittest.cc
+++ b/update_manager/real_device_policy_provider_unittest.cc
@@ -344,14 +344,14 @@
#else
.Times(1)
#endif // USE_DBUS
- .WillRepeatedly(DoAll(
- SetArgPointee<0>(set<string>{"bluetooth", "wifi", "not-a-type"}),
- Return(true)));
+ .WillRepeatedly(
+ DoAll(SetArgPointee<0>(set<string>{"ethernet", "wifi", "not-a-type"}),
+ Return(true)));
EXPECT_TRUE(provider_->Init());
loop_.RunOnce(false);
UmTestUtils::ExpectVariableHasValue(
- set<ConnectionType>{ConnectionType::kWifi, ConnectionType::kBluetooth},
+ set<ConnectionType>{ConnectionType::kWifi, ConnectionType::kEthernet},
provider_->var_allowed_connection_types_for_update());
}
diff --git a/update_manager/real_shill_provider_unittest.cc b/update_manager/real_shill_provider_unittest.cc
index dcc729a..505f2f8 100644
--- a/update_manager/real_shill_provider_unittest.cc
+++ b/update_manager/real_shill_provider_unittest.cc
@@ -51,8 +51,6 @@
// Fake service paths.
const char* const kFakeEthernetServicePath = "/fake/ethernet/service";
const char* const kFakeWifiServicePath = "/fake/wifi/service";
-const char* const kFakeWimaxServicePath = "/fake/wimax/service";
-const char* const kFakeBluetoothServicePath = "/fake/bluetooth/service";
const char* const kFakeCellularServicePath = "/fake/cellular/service";
const char* const kFakeVpnServicePath = "/fake/vpn/service";
const char* const kFakeUnknownServicePath = "/fake/unknown/service";
@@ -317,21 +315,6 @@
kFakeWifiServicePath, shill::kTypeWifi, ConnectionType::kWifi);
}
-// Test that Wimax connection is identified correctly.
-TEST_F(UmRealShillProviderTest, ReadConnTypeWimax) {
- InitWithDefaultService("/");
- SetupConnectionAndTestType(
- kFakeWimaxServicePath, shill::kTypeWimax, ConnectionType::kWimax);
-}
-
-// Test that Bluetooth connection is identified correctly.
-TEST_F(UmRealShillProviderTest, ReadConnTypeBluetooth) {
- InitWithDefaultService("/");
- SetupConnectionAndTestType(kFakeBluetoothServicePath,
- shill::kTypeBluetooth,
- ConnectionType::kBluetooth);
-}
-
// Test that Cellular connection is identified correctly.
TEST_F(UmRealShillProviderTest, ReadConnTypeCellular) {
InitWithDefaultService("/");