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

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

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
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 #include "content/common/android/device_telephony_info.h" 5 #include "content/common/android/device_telephony_info.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "jni/DeviceTelephonyInfo_jni.h" 10 #include "jni/DeviceTelephonyInfo_jni.h"
(...skipping 13 matching lines...) Expand all
24 DeviceTelephonyInfo::~DeviceTelephonyInfo() { 24 DeviceTelephonyInfo::~DeviceTelephonyInfo() {
25 } 25 }
26 26
27 std::string DeviceTelephonyInfo::GetNetworkCountryIso() { 27 std::string DeviceTelephonyInfo::GetNetworkCountryIso() {
28 JNIEnv* env = AttachCurrentThread(); 28 JNIEnv* env = AttachCurrentThread();
29 ScopedJavaLocalRef<jstring> result = 29 ScopedJavaLocalRef<jstring> result =
30 Java_DeviceTelephonyInfo_getNetworkCountryIso(env, j_device_info_.obj()); 30 Java_DeviceTelephonyInfo_getNetworkCountryIso(env, j_device_info_.obj());
31 return ConvertJavaStringToUTF8(result); 31 return ConvertJavaStringToUTF8(result);
32 } 32 }
33 33
34 std::string DeviceTelephonyInfo::GetNetworkOperator() {
35 JNIEnv* env = AttachCurrentThread();
36 ScopedJavaLocalRef<jstring> result =
37 Java_DeviceTelephonyInfo_getNetworkOperator(env, j_device_info_.obj());
38 return ConvertJavaStringToUTF8(result);
39 }
40
34 // static 41 // static
35 bool DeviceTelephonyInfo::RegisterDeviceTelephonyInfo(JNIEnv* env) { 42 bool DeviceTelephonyInfo::RegisterDeviceTelephonyInfo(JNIEnv* env) {
36 return RegisterNativesImpl(env); 43 return RegisterNativesImpl(env);
37 } 44 }
38 45
39 } // namespace content 46 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698