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

Unified Diff: net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java

Issue 238793007: Added GetNetworkOperatorID util func in net/base/net_util and a non-trivial implementation for Andr… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 8 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/network_library.h » ('j') | net/android/network_library.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
diff --git a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
index e4caee50583f6b0ccb24452529666261b456f1c9..34c47151659016ae608374c86cf1b67e87609e49 100644
--- a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
+++ b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
@@ -8,6 +8,7 @@ import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.security.KeyChain;
+import android.telephony.TelephonyManager;
import android.util.Log;
import org.chromium.base.CalledByNative;
@@ -238,4 +239,14 @@ class AndroidNetworkLibrary {
CertificateException, KeyStoreException {
X509Util.clearTestRootCertificates();
}
+
+ /**
+ * Returns the numeric name (MCC+MNC) of current registered operator.
bengr 2014/04/21 20:50:58 "of the"
bolian 2014/04/21 22:37:17 Done.
+ */
+ @CalledByNative
+ private static String getNetworkOperator(Context context) {
+ TelephonyManager telephonyManager =
+ (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
mef 2014/04/21 17:13:42 telephonyManager may be null: http://stackoverflo
bolian 2014/04/21 22:37:17 Done.
+ return telephonyManager.getNetworkOperator();
+ }
}
« no previous file with comments | « no previous file | net/android/network_library.h » ('j') | net/android/network_library.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698