Commit b3ca12a2 authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Chromium LUCI CQ

[CrOS PhoneHub] Do not show UI when host is pending

Before this CL, we would show the "connecting" UI when we were waiting
for a pending host to be set. This was misleading, since we were not
actually connecting at all. Even worse, we'd show this UI when the user
had accidentally picked the wrong device in the drop-down menu, perhaps
due to crbug/923594.

This CL updates Phone Hub so that it does not show any UI when we're in
this state. Once the phone is actually set up, then we show the
"connecting" UI.

Bug: 1157971, 1106937
Change-Id: I3cc896335b436849e05a8bc2d6b0adbbdc8edfb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587563Reviewed-by: default avatarJimmy Gong <jimmyxgong@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836382}
parent 99ab238b
......@@ -147,6 +147,8 @@ PhoneHubUiController::GetUiStateFromPhoneHubManager() {
bool should_show_onboarding_ui = tracker->ShouldShowOnboardingUi();
switch (feature_status) {
case FeatureStatus::kPhoneSelectedAndPendingSetup:
FALLTHROUGH;
case FeatureStatus::kNotEligibleForFeature:
return UiState::kHidden;
case FeatureStatus::kEligiblePhoneButNotSetUp:
......@@ -155,8 +157,6 @@ PhoneHubUiController::GetUiStateFromPhoneHubManager() {
case FeatureStatus::kDisabled:
return should_show_onboarding_ui ? UiState::kOnboardingWithoutPhone
: UiState::kHidden;
case FeatureStatus::kPhoneSelectedAndPendingSetup:
return UiState::kPhoneConnecting;
case FeatureStatus::kUnavailableBluetoothOff:
return UiState::kBluetoothDisabled;
case FeatureStatus::kEnabledButDisconnected:
......
......@@ -121,14 +121,10 @@ TEST_F(PhoneHubUiControllerTest, ShowOnboardingUi_WithPhone) {
EXPECT_EQ(PhoneHubViewID::kOnboardingView, content_view->GetID());
}
TEST_F(PhoneHubUiControllerTest, PhoneConnectingForOnboarding) {
TEST_F(PhoneHubUiControllerTest, PhoneSelectedAndPendingSetup) {
GetFeatureStatusProvider()->SetStatus(
FeatureStatus::kPhoneSelectedAndPendingSetup);
EXPECT_EQ(PhoneHubUiController::UiState::kPhoneConnecting,
controller_->ui_state());
auto content_view = controller_->CreateContentView(/*delegate=*/nullptr);
EXPECT_EQ(PhoneHubViewID::kPhoneConnectingView, content_view->GetID());
EXPECT_EQ(PhoneHubUiController::UiState::kHidden, controller_->ui_state());
}
TEST_F(PhoneHubUiControllerTest, BluetoothOff) {
......
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