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

Side by Side Diff: net/android/network_library.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 "net/android/network_library.h" 5 #include "net/android/network_library.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 ScopedJavaLocalRef<jstring> ret = 115 ScopedJavaLocalRef<jstring> ret =
116 Java_AndroidNetworkLibrary_getMimeTypeFromExtension( 116 Java_AndroidNetworkLibrary_getMimeTypeFromExtension(
117 env, extension_string.obj()); 117 env, extension_string.obj());
118 118
119 if (!ret.obj()) 119 if (!ret.obj())
120 return false; 120 return false;
121 *result = ConvertJavaStringToUTF8(ret); 121 *result = ConvertJavaStringToUTF8(ret);
122 return true; 122 return true;
123 } 123 }
124 124
125 std::string GetNetworkOperatorID() {
126 return base::android::ConvertJavaStringToUTF8(
127 Java_AndroidNetworkLibrary_getNetworkOperator(
128 base::android::AttachCurrentThread(),
129 base::android::GetApplicationContext()));
130 }
131
125 bool RegisterNetworkLibrary(JNIEnv* env) { 132 bool RegisterNetworkLibrary(JNIEnv* env) {
126 return RegisterNativesImpl(env); 133 return RegisterNativesImpl(env);
127 } 134 }
128 135
129 } // namespace android 136 } // namespace android
130 } // namespace net 137 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698