smartlock_state.cc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2021 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. #include "ash/public/cpp/smartlock_state.h"
  5. namespace ash {
  6. std::ostream& operator<<(std::ostream& stream, const SmartLockState& state) {
  7. switch (state) {
  8. case SmartLockState::kInactive:
  9. stream << "[inactive]";
  10. break;
  11. case SmartLockState::kDisabled:
  12. stream << "[disabled]";
  13. break;
  14. case SmartLockState::kBluetoothDisabled:
  15. stream << "[bluetooth disabled]";
  16. break;
  17. case SmartLockState::kConnectingToPhone:
  18. stream << "[connecting to phone]";
  19. break;
  20. case SmartLockState::kPhoneNotFound:
  21. stream << "[phone not found]";
  22. break;
  23. case SmartLockState::kPhoneNotAuthenticated:
  24. stream << "[phone not authenticated]";
  25. break;
  26. case SmartLockState::kPhoneFoundLockedAndProximate:
  27. stream << "[phone locked and proximate]";
  28. break;
  29. case SmartLockState::kPhoneNotLockable:
  30. stream << "[phone not lockable]";
  31. break;
  32. case SmartLockState::kPhoneFoundUnlockedAndDistant:
  33. stream << "[phone unlocked and distant]";
  34. break;
  35. case SmartLockState::kPhoneFoundLockedAndDistant:
  36. stream << "[phone locked and distant]";
  37. break;
  38. case SmartLockState::kPhoneAuthenticated:
  39. stream << "[phone authenticated]";
  40. break;
  41. case SmartLockState::kPasswordReentryRequired:
  42. stream << "[password reentry required]";
  43. break;
  44. case SmartLockState::kPrimaryUserAbsent:
  45. stream << "[primary user absent]";
  46. break;
  47. }
  48. return stream;
  49. }
  50. } // namespace ash