Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Unified Diff: components/proximity_auth/metrics.cc

Issue 1941923002: bluetooth: Return int8_t and use -128 for unknown tx power. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Use enum and change to EXPECT_EQ Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/proximity_auth/metrics.cc
diff --git a/components/proximity_auth/metrics.cc b/components/proximity_auth/metrics.cc
index b8ceb1f676129dbdc69bb2ee1cea461ca5ada174..915957bd8cc050b4c8e845da74271e4a97fb80fc 100644
--- a/components/proximity_auth/metrics.cc
+++ b/components/proximity_auth/metrics.cc
@@ -14,6 +14,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
#include "base/sys_byteorder.h"
+#include "device/bluetooth/bluetooth_device.h"
namespace proximity_auth {
namespace metrics {
@@ -46,10 +47,9 @@ int32_t HashDeviceModelName(const std::string& name) {
} // namespace
const char kUnknownDeviceModel[] = "Unknown";
-const int kUnknownProximityValue = 127;
void RecordAuthProximityRollingRssi(int rolling_rssi) {
- if (rolling_rssi != kUnknownProximityValue)
+ if (rolling_rssi != device::BluetoothDevice::kUnknownRSSI)
rolling_rssi = std::min(50, std::max(-100, rolling_rssi));
UMA_HISTOGRAM_SPARSE_SLOWLY("EasyUnlock.AuthProximity.RollingRssi",
@@ -57,7 +57,7 @@ void RecordAuthProximityRollingRssi(int rolling_rssi) {
}
void RecordAuthProximityTransmitPowerDelta(int transmit_power_delta) {
- if (transmit_power_delta != kUnknownProximityValue)
+ if (transmit_power_delta != device::BluetoothDevice::kUnknownTxPower)
transmit_power_delta = std::min(50, std::max(-100, transmit_power_delta));
UMA_HISTOGRAM_SPARSE_SLOWLY("EasyUnlock.AuthProximity.TransmitPowerDelta",

Powered by Google App Engine
This is Rietveld 408576698