metrics.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2015 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_PROXIMITY_AUTH_METRICS_H_
  5. #define ASH_COMPONENTS_PROXIMITY_AUTH_METRICS_H_
  6. #include <string>
  7. namespace proximity_auth {
  8. namespace metrics {
  9. extern const char kUnknownDeviceModel[];
  10. extern const int kUnknownProximityValue;
  11. // Possible states of the remote device's security settings. This enum is used
  12. // to back a histogram, and hence should be treated as append-only.
  13. enum class RemoteSecuritySettingsState {
  14. UNKNOWN,
  15. SCREEN_LOCK_DISABLED_TRUST_AGENT_UNSUPPORTED,
  16. SCREEN_LOCK_DISABLED_TRUST_AGENT_DISABLED,
  17. SCREEN_LOCK_DISABLED_TRUST_AGENT_ENABLED,
  18. SCREEN_LOCK_ENABLED_TRUST_AGENT_UNSUPPORTED,
  19. SCREEN_LOCK_ENABLED_TRUST_AGENT_DISABLED,
  20. SCREEN_LOCK_ENABLED_TRUST_AGENT_ENABLED,
  21. COUNT
  22. };
  23. // Records the current |rolling_rssi| reading, upon a successful auth attempt.
  24. // |rolling_rssi| should be set to |kUnknownProximityValue| if no RSSI readings
  25. // are available.
  26. void RecordAuthProximityRollingRssi(int rolling_rssi);
  27. // Records the phone model used for a successful auth attempt. The model is
  28. // recorded as a 32-bit hash due to the limits of UMA. |device_model| should be
  29. // set to |kUnknownDeviceModel| if the device model could not be read.
  30. void RecordAuthProximityRemoteDeviceModelHash(const std::string& device_model);
  31. // Records the screen lock and trust agent settings state of the remote device,
  32. // as received in a status update from the remote device.
  33. void RecordRemoteSecuritySettingsState(RemoteSecuritySettingsState state);
  34. } // namespace metrics
  35. } // namespace proximity_auth
  36. #endif // ASH_COMPONENTS_PROXIMITY_AUTH_METRICS_H_