| Index: components/proximity_auth/proximity_monitor_impl.h
|
| diff --git a/components/proximity_auth/proximity_monitor_impl.h b/components/proximity_auth/proximity_monitor_impl.h
|
| index 1aebd2ed06ef542ae8861cf48c9df031cb50330b..61d7e3b7c145a923bc8ff26ea6cf31d5c3580985 100644
|
| --- a/components/proximity_auth/proximity_monitor_impl.h
|
| +++ b/components/proximity_auth/proximity_monitor_impl.h
|
| @@ -16,6 +16,8 @@
|
| #include "components/proximity_auth/proximity_monitor.h"
|
| #include "device/bluetooth/bluetooth_device.h"
|
|
|
| +class PrefService;
|
| +
|
| namespace base {
|
| class TickClock;
|
| }
|
| @@ -33,7 +35,8 @@ class ProximityMonitorImpl : public ProximityMonitor {
|
| public:
|
| // The |connection| is not owned, and must outlive |this| instance.
|
| ProximityMonitorImpl(cryptauth::Connection* connection,
|
| - std::unique_ptr<base::TickClock> clock);
|
| + std::unique_ptr<base::TickClock> clock,
|
| + PrefService* pref_service);
|
| ~ProximityMonitorImpl() override;
|
|
|
| // ProximityMonitor:
|
| @@ -82,6 +85,10 @@ class ProximityMonitorImpl : public ProximityMonitor {
|
| // samples. Notifies |observers_| on a change.
|
| void CheckForProximityStateChange();
|
|
|
| + // Gets the user-selected proximity threshold and converts it to a
|
| + // RSSI value.
|
| + void GetRssiThresholdFromPrefs();
|
| +
|
| // The current connection being monitored. Not owned and must outlive this
|
| // instance.
|
| cryptauth::Connection* connection_;
|
| @@ -100,6 +107,9 @@ class ProximityMonitorImpl : public ProximityMonitor {
|
| // for proximity to the remote device.
|
| bool is_active_;
|
|
|
| + // When the RSSI is below this value the phone the unlock is not allowed.
|
| + int rssi_threshold_;
|
| +
|
| // The exponentailly weighted rolling average of the RSSI, used to smooth the
|
| // RSSI readings. Null if the monitor is inactive, has not recently observed
|
| // an RSSI reading, or the most recent connection info included an invalid
|
| @@ -109,6 +119,10 @@ class ProximityMonitorImpl : public ProximityMonitor {
|
| // Used to access non-decreasing time measurements.
|
| std::unique_ptr<base::TickClock> clock_;
|
|
|
| + // Contains perferences that outlive the lifetime of this object and across
|
| + // process restarts. Not owned and must outlive this instance.
|
| + PrefService* pref_service_;
|
| +
|
| // Used to vend weak pointers for polling. Using a separate factory for these
|
| // weak pointers allows the weak pointers to be invalidated when polling
|
| // stops, which effectively cancels the scheduled tasks.
|
|
|