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

Unified Diff: net/android/cellular_signal_strength.h

Issue 2763853002: Use Android callback API to obtain cellular signal strength (Closed)
Patch Set: ryansturm comments Created 3 years, 9 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
« no previous file with comments | « no previous file | net/android/cellular_signal_strength.cc » ('j') | net/android/cellular_signal_strength.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/cellular_signal_strength.h
diff --git a/net/android/cellular_signal_strength.h b/net/android/cellular_signal_strength.h
index 4165a73da782acd0e38ba19bbd5dec5daba87f5d..7b743244b507f29221d74b616cf7f88628243ba2 100644
--- a/net/android/cellular_signal_strength.h
+++ b/net/android/cellular_signal_strength.h
@@ -8,29 +8,34 @@
#include <jni.h>
#include <stdint.h>
-#include "base/compiler_specific.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "base/optional.h"
+#include "base/threading/thread_checker.h"
#include "net/base/net_export.h"
namespace net {
namespace android {
-namespace cellular_signal_strength {
+class NET_EXPORT_PRIVATE CellularSignalStrength {
pauljensen 2017/04/13 11:36:30 needs comments
tbansal1 2017/06/07 21:39:20 Done.
+ public:
+ CellularSignalStrength();
-// Returns true if the signal strength (in dbM) of the currently registered
-// cellular connection is available, and sets |*signal_strength_dbm| to that
-// value.
-NET_EXPORT bool GetSignalStrengthDbm(int32_t* signal_strength_dbm)
- WARN_UNUSED_RESULT;
+ ~CellularSignalStrength();
-// Returns true if the signal strength level (between 0 and 4, both inclusive)
-// of the currently registered cellular connection is available, and sets
-// |*signal_strength_level| to that value with lower value indicating lower
-// signal strength.
-NET_EXPORT bool GetSignalStrengthLevel(int32_t* signal_strength_level)
- WARN_UNUSED_RESULT;
+ // Returns the signal strength level (between 0 and 4, both inclusive) of the
+ // currently registered cellular connection. If the value is unavailable, an
+ // empty value is returned.
+ base::Optional<int32_t> GetSignalStrengthLevel() const;
-} // namespace cellular_signal_strength
+ private:
+ base::android::ScopedJavaGlobalRef<jobject> j_cellular_signal_strength_;
+
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(CellularSignalStrength);
+};
} // namespace android
« no previous file with comments | « no previous file | net/android/cellular_signal_strength.cc » ('j') | net/android/cellular_signal_strength.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698