Update mojo sdk to rev c02a28868825edfa57ab77947b8cb15e741c5598
[chromium-blink-merge.git] / components / proximity_auth / metrics.h
bloba1ac3cd07449e8aa767b76f9d779020ee1f7cca9
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.
5 #ifndef COMPONENTS_PROXIMITY_AUTH_METRICS_H
6 #define COMPONENTS_PROXIMITY_AUTH_METRICS_H
8 #include "base/time/time.h"
10 namespace proximity_auth {
11 namespace metrics {
13 extern const char kUnknownDeviceModel[];
14 extern const int kUnknownProximityValue;
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
29 // Records the current |rolling_rssi| reading, upon a successful auth attempt.
30 // |rolling_rssi| should be set to |kUnknownProximityValue| if no RSSI readings
31 // are available.
32 void RecordAuthProximityRollingRssi(int rolling_rssi);
34 // Records the difference between the transmit power and maximum transmit power,
35 // upon a successful auth attempt. |transmit_power_delta| should be set to
36 // |kUnknownProximityValue| if no Tx power readings are available.
37 void RecordAuthProximityTransmitPowerDelta(int transmit_power_delta);
39 // Records the time elapsed since the last zero RSSI value was read, upon a
40 // successful auth attempt.
41 void RecordAuthProximityTimeSinceLastZeroRssi(
42 base::TimeDelta time_since_last_zero_rssi);
44 // Records the phone model used for a successful auth attempt. The model is
45 // recorded as a 32-bit hash due to the limits of UMA. |device_model| should be
46 // set to |kUnknownDeviceModel| if the device model could not be read.
47 void RecordAuthProximityRemoteDeviceModelHash(const std::string& device_model);
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);
53 } // namespace metrics
54 } // namespace proximity_auth
56 #endif // COMPONENTS_PROXIMITY_AUTH_METRICS_H