Index: net/base/net_util.cc |
diff --git a/net/base/net_util.cc b/net/base/net_util.cc |
index 106486df248e47db22675b669da71739ba546ba0..0333f1b862e3a02161f88f71f863a8cbab4c9e34 100644 |
--- a/net/base/net_util.cc |
+++ b/net/base/net_util.cc |
@@ -71,6 +71,9 @@ |
#include "third_party/icu/source/i18n/unicode/ulocdata.h" |
#if defined(OS_ANDROID) |
+#include "base/android/jni_android.h" |
+#include "base/android/jni_string.h" |
+#include "jni/Telephony_jni.h" |
#include "net/android/network_library.h" |
#endif |
#if defined(OS_WIN) |
@@ -1839,4 +1842,21 @@ unsigned MaskPrefixLength(const IPAddressNumber& mask) { |
return CommonPrefixLength(mask, all_ones); |
} |
+std::string GetNetworkOperatorID() { |
+#if defined(OS_ANDROID) |
+ return base::android::ConvertJavaStringToUTF8( |
mef
2014/04/16 20:57:57
I meant move this Android-specific implementation
bolian
2014/04/16 23:40:52
Done. Yes, I think that is better.
|
+ Java_Telephony_getNetworkOperator( |
+ base::android::AttachCurrentThread(), |
+ base::android::GetApplicationContext())); |
+#else |
+ return ""; |
+#endif |
+} |
+ |
+#if defined(OS_ANDROID) |
+bool NetworkInfo_GetNetworkOperatorID(JNIEnv* env) { |
mef
2014/04/16 20:57:57
This could go to android-specific module.
bolian
2014/04/16 23:40:52
Done.
|
+ return RegisterNativesImpl(env); |
+} |
+#endif |
+ |
} // namespace net |