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

Side by Side Diff: net/android/network_library.cc

Issue 254823005: Move android Telephony APIs to from content/ to net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NET_EXPORT the moved APIs. Created 6 years, 7 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 | « net/android/network_library.h ('k') | no next file » | 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 #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 GetTelephonyNetworkCountryIso() {
126 return base::android::ConvertJavaStringToUTF8(
127 Java_AndroidNetworkLibrary_getNetworkCountryIso(
128 base::android::AttachCurrentThread(),
129 base::android::GetApplicationContext()));
130 }
131
132 std::string GetTelephonyNetworkOperator() {
133 return base::android::ConvertJavaStringToUTF8(
134 Java_AndroidNetworkLibrary_getNetworkOperator(
135 base::android::AttachCurrentThread(),
136 base::android::GetApplicationContext()));
137 }
138
125 bool RegisterNetworkLibrary(JNIEnv* env) { 139 bool RegisterNetworkLibrary(JNIEnv* env) {
126 return RegisterNativesImpl(env); 140 return RegisterNativesImpl(env);
127 } 141 }
128 142
129 } // namespace android 143 } // namespace android
130 } // namespace net 144 } // namespace net
OLDNEW
« no previous file with comments | « net/android/network_library.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698