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

Unified Diff: net/android/cellular_signal_strength.h

Issue 1879743002: Expose cellular signal strength on Android to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Paul's comments Created 4 years, 6 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: net/android/cellular_signal_strength.h
diff --git a/net/android/cellular_signal_strength.h b/net/android/cellular_signal_strength.h
new file mode 100644
index 0000000000000000000000000000000000000000..7a981b4e1a67dbdb49fa83a10a5ccc2ffba05b4f
--- /dev/null
+++ b/net/android/cellular_signal_strength.h
@@ -0,0 +1,38 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_ANDROID_CELLULAR_SIGNAL_STRENGTH_H_
+#define NET_ANDROID_CELLULAR_SIGNAL_STRENGTH_H_
+
+#include <jni.h>
+#include <stdint.h>
+
+#include "base/compiler_specific.h"
+#include "net/base/net_export.h"
+
+namespace net {
+
+namespace android {
+
+namespace cellular_signal_strength {
+
+// Returns true if the RSSI (in dbM) of the currently registered cellular
+// connection is available, and sets |*rssi| to that value.
+NET_EXPORT bool GetRssiDbm(int32_t* rssi) WARN_UNUSED_RESULT;
bengr 2016/06/10 20:57:37 Does this return false when in airplane mode or wh
tbansal1 2016/06/16 00:58:03 It returns false in both cases.
+
+// Returns true if the signal level (between 0 and 4, both inclusive) of the
+// currently registered cellular connection is available, and sets
+// |*signal_level| to that value with lower value indicating lower signal
+// strength.
+NET_EXPORT bool GetSignalLevel(int32_t* signal_level) WARN_UNUSED_RESULT;
+
+bool Register(JNIEnv* env);
+
+} // namespace cellular_signal_strength
+
+} // namespace android
+
+} // namespace net
+
+#endif // NET_ANDROID_CELLULAR_SIGNAL_STRENGTH_H_

Powered by Google App Engine
This is Rietveld 408576698