feature_status.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_COMPONENTS_PHONEHUB_FEATURE_STATUS_H_
  5. #define ASH_COMPONENTS_PHONEHUB_FEATURE_STATUS_H_
  6. #include <ostream>
  7. namespace ash {
  8. namespace phonehub {
  9. // Enum representing potential status values for the Phone Hub feature. Note
  10. // that there is no value representing "prohibited" - when the feature is
  11. // prohibited by enterprise policy, we don't instantiate Phone Hub-related logic
  12. // at all.
  13. // Note: This enum is tied directly to a UMA enum defined in
  14. // //tools/metrics/histograms/enums.xml, and should always reflect it (do not
  15. // change one without changing the other). Entries should never be modified
  16. // or deleted. Only additions possible.
  17. enum class FeatureStatus {
  18. // The user's devices are not eligible for the feature. This means that either
  19. // the Chrome OS device or the user's phone (or both) have not enrolled with
  20. // the requisite feature enum values.
  21. kNotEligibleForFeature = 0,
  22. // The user has a phone eligible for the feature, but they have not yet
  23. // started the opt-in flow.
  24. kEligiblePhoneButNotSetUp = 1,
  25. // The user has selected a phone in the opt-in flow, but setup is not yet
  26. // complete. Note that setting up the feature requires interaction with a
  27. // server and with the phone itself.
  28. kPhoneSelectedAndPendingSetup = 2,
  29. // The feature is disabled, but the user could enable it via settings.
  30. kDisabled = 3,
  31. // The feature is enabled, but it is currently unavailable because Bluetooth
  32. // is disabled (the feature cannot run without Bluetooth).
  33. kUnavailableBluetoothOff = 4,
  34. // The feature is enabled, but currently there is no active connection to
  35. // the phone.
  36. kEnabledButDisconnected = 5,
  37. // The feature is enabled, and there is an active attempt to connect to the
  38. // phone.
  39. kEnabledAndConnecting = 6,
  40. // The feature is enabled, and there is an active connection with the phone.
  41. kEnabledAndConnected = 7,
  42. // The feature is unavailable because the device is in a suspended state. This
  43. // includes the having either the lockscreen active or in a power suspend
  44. // state, e.g. lid closed.
  45. kLockOrSuspended = 8,
  46. // Max value needed for metrics.
  47. kMaxValue = kLockOrSuspended,
  48. };
  49. std::ostream& operator<<(std::ostream& stream, FeatureStatus status);
  50. } // namespace phonehub
  51. } // namespace ash
  52. // TODO(https://crbug.com/1164001): remove after the migration is finished.
  53. namespace chromeos {
  54. namespace phonehub {
  55. using ::ash::phonehub::FeatureStatus;
  56. }
  57. } // namespace chromeos
  58. #endif // ASH_COMPONENTS_PHONEHUB_FEATURE_STATUS_H_