Commit 4423cfde authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS Instant Tethering] Handle LAST_PROVISIONING_FAILED enum

A new change on the Android side now causes the phone to respond with
LAST_PROVISIONING_FAILED if the last attempt to run provisioning failed.
This CL addresses the case for when the device was offline last time it
checked, or there was some sort of network error when checking.

Bug: 872473
Change-Id: Ia28f9077990a5a991b3968a6da100222940c11be
Reviewed-on: https://chromium-review.googlesource.com/c/1357656
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612909}
parent d645c7b4
...@@ -50,7 +50,10 @@ bool IsTetheringAvailableWithValidDeviceStatus( ...@@ -50,7 +50,10 @@ bool IsTetheringAvailableWithValidDeviceStatus(
TetherAvailabilityResponse_ResponseCode_SETUP_NEEDED || TetherAvailabilityResponse_ResponseCode_SETUP_NEEDED ||
response_code == response_code ==
TetherAvailabilityResponse_ResponseCode:: TetherAvailabilityResponse_ResponseCode::
TetherAvailabilityResponse_ResponseCode_TETHER_AVAILABLE) { TetherAvailabilityResponse_ResponseCode_TETHER_AVAILABLE ||
response_code ==
TetherAvailabilityResponse_ResponseCode::
TetherAvailabilityResponse_ResponseCode_LAST_PROVISIONING_FAILED) {
return true; return true;
} }
......
...@@ -384,6 +384,9 @@ TEST_F( ...@@ -384,6 +384,9 @@ TEST_F(
} }
TEST_F(HostScannerOperationTest, DISABLED_TestMultipleDevices) { TEST_F(HostScannerOperationTest, DISABLED_TestMultipleDevices) {
// TODO(khorimoto): Test the case for when the response is
// TetherAvailabilityResponse_ResponseCode_LAST_PROVISIONING_FAILED, which
// is currently equivalent to a SuccessfulTetherAvailabilityResponse.
EXPECT_CALL(*mock_tether_host_response_recorder_, EXPECT_CALL(*mock_tether_host_response_recorder_,
RecordSuccessfulTetherAvailabilityResponse(test_devices_[0])); RecordSuccessfulTetherAvailabilityResponse(test_devices_[0]));
EXPECT_CALL(*mock_tether_host_response_recorder_, EXPECT_CALL(*mock_tether_host_response_recorder_,
......
...@@ -73,6 +73,7 @@ message TetherAvailabilityResponse { ...@@ -73,6 +73,7 @@ message TetherAvailabilityResponse {
NO_SIM_CARD = 4; NO_SIM_CARD = 4;
NOTIFICATIONS_DISABLED_LEGACY = 5; NOTIFICATIONS_DISABLED_LEGACY = 5;
NOTIFICATIONS_DISABLED_WITH_NOTIFICATION_CHANNEL = 6; NOTIFICATIONS_DISABLED_WITH_NOTIFICATION_CHANNEL = 6;
LAST_PROVISIONING_FAILED = 7;
} }
optional ResponseCode response_code = 1; optional ResponseCode response_code = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment