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

Side by Side Diff: content/common/android/device_telephony_info.h

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 unified diff | Download patch
« no previous file with comments | « no previous file | content/common/android/device_telephony_info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_ANDROID_DEVICE_TELEPHONY_INFO_H_ 5 #ifndef CONTENT_COMMON_ANDROID_DEVICE_TELEPHONY_INFO_H_
6 #define CONTENT_COMMON_ANDROID_DEVICE_TELEPHONY_INFO_H_ 6 #define CONTENT_COMMON_ANDROID_DEVICE_TELEPHONY_INFO_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/android/scoped_java_ref.h" 11 #include "base/android/scoped_java_ref.h"
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 // Facilitates access to device information typically only 16 // Facilitates access to device information typically only
17 // available using the Android SDK, including Telephony properties. 17 // available using the Android SDK, including Telephony properties.
18 class DeviceTelephonyInfo { 18 class DeviceTelephonyInfo {
19 public: 19 public:
20 DeviceTelephonyInfo(); 20 DeviceTelephonyInfo();
21 ~DeviceTelephonyInfo(); 21 ~DeviceTelephonyInfo();
22 22
23 // Returns the ISO country code equivalent of the current MCC. 23 // Returns the ISO country code equivalent of the current MCC.
24 std::string GetNetworkCountryIso(); 24 std::string GetNetworkCountryIso();
25 25
26 // Returns MCC+MNC (mobile country code + mobile network code) as
27 // the numeric name of the current registered operator.
28 std::string GetNetworkOperator();
29
26 // Registers methods with JNI and returns true if succeeded. 30 // Registers methods with JNI and returns true if succeeded.
27 static bool RegisterDeviceTelephonyInfo(JNIEnv* env); 31 static bool RegisterDeviceTelephonyInfo(JNIEnv* env);
28 32
29 private: 33 private:
30 base::android::ScopedJavaGlobalRef<jobject> j_device_info_; 34 base::android::ScopedJavaGlobalRef<jobject> j_device_info_;
31 35
32 DISALLOW_COPY_AND_ASSIGN(DeviceTelephonyInfo); 36 DISALLOW_COPY_AND_ASSIGN(DeviceTelephonyInfo);
33 }; 37 };
34 38
35 } // namespace content 39 } // namespace content
36 40
37 #endif // CONTENT_COMMON_ANDROID_DEVICE_TELEPHONY_INFO_H_ 41 #endif // CONTENT_COMMON_ANDROID_DEVICE_TELEPHONY_INFO_H_
OLDNEW
« no previous file with comments | « no previous file | content/common/android/device_telephony_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698