blob: cee68387fe31f971e6c8824cc393b404462ca55b [file] [log] [blame]
Thieu Le43ce4d42013-10-04 16:08:55 -07001// Copyright (c) 2013 The Chromium OS 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
5#ifndef SHILL_SUBSCRIPTION_STATE_OUT_OF_CREDITS_DETECTOR_H_
6#define SHILL_SUBSCRIPTION_STATE_OUT_OF_CREDITS_DETECTOR_H_
7
8#include "shill/out_of_credits_detector.h"
9
10namespace shill {
11
12// Detects out-of-credits condition by using the subscription state.
13class SubscriptionStateOutOfCreditsDetector : public OutOfCreditsDetector {
14 public:
15 SubscriptionStateOutOfCreditsDetector(EventDispatcher *dispatcher,
16 Manager *manager,
17 Metrics *metrics,
18 CellularService *service);
19 virtual ~SubscriptionStateOutOfCreditsDetector();
20
21 virtual void ResetDetector() override {}
22 virtual bool IsDetecting() const override { return false; }
23 virtual void NotifyServiceStateChanged(
24 Service::ConnectState old_state,
25 Service::ConnectState new_state) override {}
26 virtual void NotifySubscriptionStateChanged(
27 uint32 subscription_state) override;
28
29 private:
30 friend class SubscriptionStateOutOfCreditsDetectorTest;
31
32 DISALLOW_COPY_AND_ASSIGN(SubscriptionStateOutOfCreditsDetector);
33};
34
35} // namespace shill
36
37#endif // SHILL_SUBSCRIPTION_STATE_OUT_OF_CREDITS_DETECTOR_H_