OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_PROXIMITY_AUTH_METRICS_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_METRICS_H |
6 #define COMPONENTS_PROXIMITY_AUTH_METRICS_H | 6 #define COMPONENTS_PROXIMITY_AUTH_METRICS_H |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 | 9 |
10 namespace proximity_auth { | 10 namespace proximity_auth { |
11 namespace metrics { | 11 namespace metrics { |
12 | 12 |
13 extern const char kUnknownDeviceModel[]; | 13 extern const char kUnknownDeviceModel[]; |
14 extern const int kUnknownProximityValue; | 14 extern const int kUnknownProximityValue; |
15 | 15 |
| 16 // Possible states of the remote device's security settings. This enum is used |
| 17 // to back a histogram, and hence should be treated as append-only. |
| 18 enum class RemoteSecuritySettingsState { |
| 19 UNKNOWN, |
| 20 SCREEN_LOCK_DISABLED_TRUST_AGENT_UNSUPPORTED, |
| 21 SCREEN_LOCK_DISABLED_TRUST_AGENT_DISABLED, |
| 22 SCREEN_LOCK_DISABLED_TRUST_AGENT_ENABLED, |
| 23 SCREEN_LOCK_ENABLED_TRUST_AGENT_UNSUPPORTED, |
| 24 SCREEN_LOCK_ENABLED_TRUST_AGENT_DISABLED, |
| 25 SCREEN_LOCK_ENABLED_TRUST_AGENT_ENABLED, |
| 26 COUNT |
| 27 }; |
| 28 |
16 // Records the current |rolling_rssi| reading, upon a successful auth attempt. | 29 // Records the current |rolling_rssi| reading, upon a successful auth attempt. |
17 // |rolling_rssi| should be set to |kUnknownProximityValue| if no RSSI readings | 30 // |rolling_rssi| should be set to |kUnknownProximityValue| if no RSSI readings |
18 // are available. | 31 // are available. |
19 void RecordAuthProximityRollingRssi(int rolling_rssi); | 32 void RecordAuthProximityRollingRssi(int rolling_rssi); |
20 | 33 |
21 // Records the difference between the transmit power and maximum transmit power, | 34 // Records the difference between the transmit power and maximum transmit power, |
22 // upon a successful auth attempt. |transmit_power_delta| should be set to | 35 // upon a successful auth attempt. |transmit_power_delta| should be set to |
23 // |kUnknownProximityValue| if no Tx power readings are available. | 36 // |kUnknownProximityValue| if no Tx power readings are available. |
24 void RecordAuthProximityTransmitPowerDelta(int transmit_power_delta); | 37 void RecordAuthProximityTransmitPowerDelta(int transmit_power_delta); |
25 | 38 |
26 // Records the time elapsed since the last zero RSSI value was read, upon a | 39 // Records the time elapsed since the last zero RSSI value was read, upon a |
27 // successful auth attempt. | 40 // successful auth attempt. |
28 void RecordAuthProximityTimeSinceLastZeroRssi( | 41 void RecordAuthProximityTimeSinceLastZeroRssi( |
29 base::TimeDelta time_since_last_zero_rssi); | 42 base::TimeDelta time_since_last_zero_rssi); |
30 | 43 |
31 // Records the phone model used for a successful auth attempt. The model is | 44 // Records the phone model used for a successful auth attempt. The model is |
32 // recorded as a 32-bit hash due to the limits of UMA. |device_model| should be | 45 // recorded as a 32-bit hash due to the limits of UMA. |device_model| should be |
33 // set to |kUnknownDeviceModel| if the device model could not be read. | 46 // set to |kUnknownDeviceModel| if the device model could not be read. |
34 void RecordAuthProximityRemoteDeviceModelHash(const std::string& device_model); | 47 void RecordAuthProximityRemoteDeviceModelHash(const std::string& device_model); |
35 | 48 |
| 49 // Records the screen lock and trust agent settings state of the remote device, |
| 50 // as received in a status update from the remote device. |
| 51 void RecordRemoteSecuritySettingsState(RemoteSecuritySettingsState state); |
| 52 |
36 } // namespace metrics | 53 } // namespace metrics |
37 } // namespace proximity_auth | 54 } // namespace proximity_auth |
38 | 55 |
39 #endif // COMPONENTS_PROXIMITY_AUTH_METRICS_H | 56 #endif // COMPONENTS_PROXIMITY_AUTH_METRICS_H |
OLD | NEW |