[Multidevice] Add flag for use of connectivity status during setup

When the existing flag CryptAuthV2DeviceActivityStatus is enabled, we
receive two piece of information from the server about each device:
  - the Bond last active time and
  - a connectivity status (online vs. offline).
Previously, when the CryptAuthV2DeviceActivityStatus flag was enabled,
the multi-device dropdown list was sorted with all online devices first
(sorted by last activity time) then all offline devices (also sorted by
last activity time).

However, there are two issues with using the connectivity status to
sort:
(1) The connectivity statuses--as well as the last activity times--are
    only retrieved at sign-in or when new devices are synced down via a
    DeviceSync. A mildly stale last activity time is acceptable, but a
    stale offline status could be very misleading, especially because an
    "(offline)" label is displayed in the dropdown list.
(2) During testing, even when forcing a connectivity status retrieval,
    we noticed that the connectivity status might not be accurate.

In this CL, we put use of the connectivity status behind a flag:
CryptAuthV2DeviceActivityStatusUseConnectivity. When enabled, online
devices are sorted before offline devices, and offline devices are
labeled with "(offline)" in the dropdown list.  When disabled, the
connectivity status is ignored during sorting, and no connectivity
labels are applied in the UI. For example, say the Samsung Galaxy has a
more recent Bond last active time than the Pixel, and the Pixel is
online whereas the Galaxy is offline. The UI will appear as follows
with CryptAuthV2DeviceActivityStatus enabled:

  CryptAuthV2DeviceActivityStatusUseConnectivity disabled (default):
      https://screenshot.googleplex.com/4cRYc5UXiAHMSyE.png
  CryptAuthV2DeviceActivityStatusUseConnectivity enabled:
      https://screenshot.googleplex.com/AeqyvBcA29meeyN.png

This allows us to enable the CryptAuthV2DeviceActivityStatus flag to
use the Bond last activity time to sort the dropdown list, while
disabling the CryptAuthV2DeviceActivityStatusUseConnectivity flag. This
immediately improves the dropdown experience without worrying about
stale connectivity statuses.

Manually tested with two eligible host phones, adjusting their last
activity times and online/offline states, and going through
multi-device setup.

Bug: 923594
Change-Id: I19d08232d7d0f35b3b430793f22a4aac07d9b5c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2577632
Reviewed-by: Kyle Horimoto <[email protected]>
Commit-Queue: Josh Nohle <[email protected]>
Cr-Commit-Position: refs/heads/master@{#834849}
9 files changed
tree: dde680025224cca278575356bb7bd4241f6f5dd0
  1. android_webview/
  2. apps/
  3. ash/
  4. base/
  5. build/
  6. build_overrides/
  7. buildtools/
  8. cc/
  9. chrome/
  10. chromecast/
  11. chromeos/
  12. cloud_print/
  13. codelabs/
  14. components/
  15. content/
  16. courgette/
  17. crypto/
  18. dbus/
  19. device/
  20. docs/
  21. extensions/
  22. fuchsia/
  23. gin/
  24. google_apis/
  25. google_update/
  26. gpu/
  27. headless/
  28. infra/
  29. ios/
  30. ipc/
  31. jingle/
  32. media/
  33. mojo/
  34. native_client_sdk/
  35. net/
  36. pdf/
  37. ppapi/
  38. printing/
  39. remoting/
  40. rlz/
  41. sandbox/
  42. services/
  43. skia/
  44. sql/
  45. storage/
  46. styleguide/
  47. testing/
  48. third_party/
  49. tools/
  50. ui/
  51. url/
  52. weblayer/
  53. .clang-format
  54. .clang-tidy
  55. .eslintrc.js
  56. .git-blame-ignore-revs
  57. .gitattributes
  58. .gitignore
  59. .gn
  60. .vpython
  61. .vpython3
  62. .yapfignore
  63. AUTHORS
  64. BUILD.gn
  65. CODE_OF_CONDUCT.md
  66. codereview.settings
  67. DEPS
  68. DIR_METADATA
  69. ENG_REVIEW_OWNERS
  70. LICENSE
  71. LICENSE.chromium_os
  72. OWNERS
  73. PRESUBMIT.py
  74. PRESUBMIT_test.py
  75. PRESUBMIT_test_mocks.py
  76. README.md
  77. WATCHLISTS
README.md

Logo Chromium

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

The project's web site is https://www.chromium.org.

Documentation in the source is rooted in docs/README.md.

Learn how to Get Around the Chromium Source Code Directory Structure .

For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.