Skip to content

Commit

Permalink
Split kIneligible and kDependentFeature
Browse files Browse the repository at this point in the history
So it is clearer when Eche is ineligible due to Phone Hub's state vs its
own state.

Bug: b/185623287
Test: cq
Change-Id: I71af6866a64df3f9b4a61ddb0aa1963ebff5e737
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2837205
Reviewed-by: Daniel Nishi <dhnishi@chromium.org>
Commit-Queue: Christine Franks <christyfranks@google.com>
Cr-Commit-Position: refs/heads/master@{#880484}
  • Loading branch information
christinef authored and Chromium LUCI CQ committed May 7, 2021
1 parent 47824c4 commit 05585e2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions chromeos/components/eche_app_ui/eche_connector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ void EcheConnector::SendMessage(const std::string& message) {
const FeatureStatus feature_status =
eche_feature_status_provider_->GetStatus();
switch (feature_status) {
case FeatureStatus::kDependentFeature:
PA_LOG(WARNING) << "Attempting to send message with ineligible dep";
break;
case FeatureStatus::kIneligible:
PA_LOG(WARNING) << "Attempting to send message for ineligible feature";
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ FeatureStatus EcheFeatureStatusProvider::ComputeStatus() {
case phonehub::FeatureStatus::kEnabledAndConnecting:
FALLTHROUGH;
case phonehub::FeatureStatus::kEnabledButDisconnected:
return FeatureStatus::kIneligible;
return FeatureStatus::kDependentFeature;
case phonehub::FeatureStatus::kEnabledAndConnected:
break;
}
Expand Down
3 changes: 3 additions & 0 deletions chromeos/components/eche_app_ui/feature_status.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ std::ostream& operator<<(std::ostream& stream, FeatureStatus status) {
case FeatureStatus::kConnected:
stream << "[Enabled; connected]";
break;
case FeatureStatus::kDependentFeature:
stream << "[Dependent feature not in a compatible state]";
break;
}

return stream;
Expand Down
3 changes: 3 additions & 0 deletions chromeos/components/eche_app_ui/feature_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ enum class FeatureStatus {

// The feature is enabled, and there is an active connection with the phone.
kConnected = 4,

// A dependent feature is in an incompatible state.
kDependentFeature = 5,
};

std::ostream& operator<<(std::ostream& stream, FeatureStatus status);
Expand Down

0 comments on commit 05585e2

Please sign in to comment.