1 // Copyright 2020 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_ANDROID_RADIO_UTILS_H_
6 #define BASE_ANDROID_RADIO_UTILS_H_
8 #include "base/android/jni_android.h"
9 #include "third_party/abseil-cpp/absl/types/optional.h"
14 // These values are persisted to logs. Entries should not be renumbered and
15 // numeric values should never be reused. Keep in sync with RadioSignalLevel
16 // in //tools/metrics/histograms/enums.xml.
17 enum class RadioSignalLevel {
26 enum class RadioDataActivity {
34 enum class RadioConnectionType {
40 class BASE_EXPORT RadioUtils {
42 class OverrideForTesting {
45 ~OverrideForTesting();
47 void SetConnectionTypeForTesting(RadioConnectionType connection_type) {
48 connection_type_ = connection_type;
51 RadioConnectionType GetConnectionType() { return connection_type_; }
54 RadioConnectionType connection_type_;
56 static bool IsSupported();
57 static RadioConnectionType GetConnectionType();
58 static absl::optional<RadioSignalLevel> GetCellSignalLevel();
59 static absl::optional<RadioDataActivity> GetCellDataActivity();
62 } // namespace android
65 #endif // BASE_ANDROID_RADIO_UTILS_H_