Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #define LOG_TAG "MtpServerJNI" |
| 18 | #include "utils/Log.h" |
| 19 | |
| 20 | #include <stdio.h> |
| 21 | #include <assert.h> |
| 22 | #include <limits.h> |
| 23 | #include <unistd.h> |
| 24 | #include <fcntl.h> |
| 25 | #include <utils/threads.h> |
| 26 | |
| 27 | #include "jni.h" |
Steven Moreland | 2279b25 | 2017-07-19 09:50:45 -0700 | [diff] [blame] | 28 | #include <nativehelper/JNIHelp.h> |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 29 | #include "android_runtime/AndroidRuntime.h" |
Mike Lockwood | dad6927 | 2010-07-02 15:15:07 -0400 | [diff] [blame] | 30 | #include "private/android_filesystem_config.h" |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 31 | |
| 32 | #include "MtpServer.h" |
Mike Lockwood | 467ca0d | 2011-02-18 09:07:14 -0500 | [diff] [blame] | 33 | #include "MtpStorage.h" |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 34 | |
Mike Lockwood | 81ea83d | 2010-06-30 17:49:41 -0400 | [diff] [blame] | 35 | using namespace android; |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 36 | |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 37 | // MtpServer fields |
| 38 | static jfieldID field_MtpServer_nativeContext; |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 39 | |
| 40 | // MtpStorage fields |
| 41 | static jfieldID field_MtpStorage_storageId; |
| 42 | static jfieldID field_MtpStorage_path; |
| 43 | static jfieldID field_MtpStorage_description; |
Mike Lockwood | 5169054 | 2011-05-09 20:16:05 -0700 | [diff] [blame] | 44 | static jfieldID field_MtpStorage_removable; |
Mike Lockwood | 7a59dd2 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 45 | static jfieldID field_MtpStorage_maxFileSize; |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 46 | |
| 47 | static Mutex sMutex; |
| 48 | |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 49 | // ---------------------------------------------------------------------------- |
| 50 | |
Mike Lockwood | 0cd0136 | 2010-12-30 11:54:33 -0500 | [diff] [blame] | 51 | // in android_mtp_MtpDatabase.cpp |
Jerry Zhang | f9c5c25 | 2017-08-16 18:07:51 -0700 | [diff] [blame^] | 52 | extern IMtpDatabase* getMtpDatabase(JNIEnv *env, jobject database); |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 53 | |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 54 | static inline MtpServer* getMtpServer(JNIEnv *env, jobject thiz) { |
Ashok Bhat | e2e5932 | 2013-12-17 19:04:19 +0000 | [diff] [blame] | 55 | return (MtpServer*)env->GetLongField(thiz, field_MtpServer_nativeContext); |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 56 | } |
| 57 | |
Jerry Zhang | bb598ee | 2016-10-24 14:35:08 -0700 | [diff] [blame] | 58 | static void android_mtp_configure(JNIEnv *, jobject, jboolean usePtp) { |
| 59 | MtpServer::configure(usePtp); |
| 60 | } |
| 61 | |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 62 | static void |
Alex Klyubin | abdc2b4 | 2016-12-21 11:19:52 -0800 | [diff] [blame] | 63 | android_mtp_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase, jboolean usePtp, |
| 64 | jstring deviceInfoManufacturer, |
| 65 | jstring deviceInfoModel, |
| 66 | jstring deviceInfoDeviceVersion, |
| 67 | jstring deviceInfoSerialNumber) |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 68 | { |
Alex Klyubin | abdc2b4 | 2016-12-21 11:19:52 -0800 | [diff] [blame] | 69 | const char *deviceInfoManufacturerStr = env->GetStringUTFChars(deviceInfoManufacturer, NULL); |
| 70 | const char *deviceInfoModelStr = env->GetStringUTFChars(deviceInfoModel, NULL); |
| 71 | const char *deviceInfoDeviceVersionStr = env->GetStringUTFChars(deviceInfoDeviceVersion, NULL); |
| 72 | const char *deviceInfoSerialNumberStr = env->GetStringUTFChars(deviceInfoSerialNumber, NULL); |
Jerry Zhang | bb598ee | 2016-10-24 14:35:08 -0700 | [diff] [blame] | 73 | MtpServer* server = new MtpServer(getMtpDatabase(env, javaDatabase), |
Jerry Zhang | def7b193 | 2017-10-17 13:47:51 -0700 | [diff] [blame] | 74 | usePtp, |
Alex Klyubin | abdc2b4 | 2016-12-21 11:19:52 -0800 | [diff] [blame] | 75 | MtpString((deviceInfoManufacturerStr != NULL) ? deviceInfoManufacturerStr : ""), |
| 76 | MtpString((deviceInfoModelStr != NULL) ? deviceInfoModelStr : ""), |
| 77 | MtpString((deviceInfoDeviceVersionStr != NULL) ? deviceInfoDeviceVersionStr : ""), |
| 78 | MtpString((deviceInfoSerialNumberStr != NULL) ? deviceInfoSerialNumberStr : "")); |
| 79 | if (deviceInfoManufacturerStr != NULL) { |
| 80 | env->ReleaseStringUTFChars(deviceInfoManufacturer, deviceInfoManufacturerStr); |
| 81 | } |
| 82 | if (deviceInfoModelStr != NULL) { |
| 83 | env->ReleaseStringUTFChars(deviceInfoModel, deviceInfoModelStr); |
| 84 | } |
| 85 | if (deviceInfoDeviceVersionStr != NULL) { |
| 86 | env->ReleaseStringUTFChars(deviceInfoDeviceVersion, deviceInfoDeviceVersionStr); |
| 87 | } |
| 88 | if (deviceInfoSerialNumberStr != NULL) { |
| 89 | env->ReleaseStringUTFChars(deviceInfoSerialNumber, deviceInfoSerialNumberStr); |
| 90 | } |
Jerry Zhang | bb598ee | 2016-10-24 14:35:08 -0700 | [diff] [blame] | 91 | env->SetLongField(thiz, field_MtpServer_nativeContext, (jlong)server); |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | static void |
| 95 | android_mtp_MtpServer_run(JNIEnv *env, jobject thiz) |
| 96 | { |
| 97 | MtpServer* server = getMtpServer(env, thiz); |
| 98 | if (server) |
| 99 | server->run(); |
| 100 | else |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 101 | ALOGE("server is null in run"); |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | static void |
| 105 | android_mtp_MtpServer_cleanup(JNIEnv *env, jobject thiz) |
| 106 | { |
| 107 | Mutex::Autolock autoLock(sMutex); |
| 108 | |
| 109 | MtpServer* server = getMtpServer(env, thiz); |
| 110 | if (server) { |
| 111 | delete server; |
Ashok Bhat | e2e5932 | 2013-12-17 19:04:19 +0000 | [diff] [blame] | 112 | env->SetLongField(thiz, field_MtpServer_nativeContext, 0); |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 113 | } else { |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 114 | ALOGE("server is null in cleanup"); |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 115 | } |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 116 | } |
| 117 | |
Mike Lockwood | be125a5 | 2010-07-12 18:54:16 -0400 | [diff] [blame] | 118 | static void |
Mike Lockwood | 0cd0136 | 2010-12-30 11:54:33 -0500 | [diff] [blame] | 119 | android_mtp_MtpServer_send_object_added(JNIEnv *env, jobject thiz, jint handle) |
Mike Lockwood | be125a5 | 2010-07-12 18:54:16 -0400 | [diff] [blame] | 120 | { |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 121 | Mutex::Autolock autoLock(sMutex); |
| 122 | |
| 123 | MtpServer* server = getMtpServer(env, thiz); |
| 124 | if (server) |
| 125 | server->sendObjectAdded(handle); |
| 126 | else |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 127 | ALOGE("server is null in send_object_added"); |
Mike Lockwood | be125a5 | 2010-07-12 18:54:16 -0400 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | static void |
Mike Lockwood | 0cd0136 | 2010-12-30 11:54:33 -0500 | [diff] [blame] | 131 | android_mtp_MtpServer_send_object_removed(JNIEnv *env, jobject thiz, jint handle) |
Mike Lockwood | be125a5 | 2010-07-12 18:54:16 -0400 | [diff] [blame] | 132 | { |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 133 | Mutex::Autolock autoLock(sMutex); |
| 134 | |
| 135 | MtpServer* server = getMtpServer(env, thiz); |
| 136 | if (server) |
| 137 | server->sendObjectRemoved(handle); |
| 138 | else |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 139 | ALOGE("server is null in send_object_removed"); |
Mike Lockwood | be125a5 | 2010-07-12 18:54:16 -0400 | [diff] [blame] | 140 | } |
| 141 | |
Mike Lockwood | eabe8bf | 2010-08-31 14:35:23 -0400 | [diff] [blame] | 142 | static void |
Mike Lockwood | 56c8524 | 2014-03-07 13:29:08 -0800 | [diff] [blame] | 143 | android_mtp_MtpServer_send_device_property_changed(JNIEnv *env, jobject thiz, jint property) |
| 144 | { |
| 145 | Mutex::Autolock autoLock(sMutex); |
| 146 | |
| 147 | MtpServer* server = getMtpServer(env, thiz); |
| 148 | if (server) |
| 149 | server->sendDevicePropertyChanged(property); |
| 150 | else |
| 151 | ALOGE("server is null in send_object_removed"); |
| 152 | } |
| 153 | |
| 154 | static void |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 155 | android_mtp_MtpServer_add_storage(JNIEnv *env, jobject thiz, jobject jstorage) |
Mike Lockwood | 66e57f6 | 2011-02-18 13:24:01 -0500 | [diff] [blame] | 156 | { |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 157 | Mutex::Autolock autoLock(sMutex); |
| 158 | |
| 159 | MtpServer* server = getMtpServer(env, thiz); |
| 160 | if (server) { |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 161 | jint storageID = env->GetIntField(jstorage, field_MtpStorage_storageId); |
| 162 | jstring path = (jstring)env->GetObjectField(jstorage, field_MtpStorage_path); |
| 163 | jstring description = (jstring)env->GetObjectField(jstorage, field_MtpStorage_description); |
Mike Lockwood | 5169054 | 2011-05-09 20:16:05 -0700 | [diff] [blame] | 164 | jboolean removable = env->GetBooleanField(jstorage, field_MtpStorage_removable); |
Mike Lockwood | 7a59dd2 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 165 | jlong maxFileSize = env->GetLongField(jstorage, field_MtpStorage_maxFileSize); |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 166 | |
| 167 | const char *pathStr = env->GetStringUTFChars(path, NULL); |
James Dong | 3977472 | 2011-04-06 11:57:48 -0700 | [diff] [blame] | 168 | if (pathStr != NULL) { |
| 169 | const char *descriptionStr = env->GetStringUTFChars(description, NULL); |
| 170 | if (descriptionStr != NULL) { |
Mike Lockwood | 7a59dd2 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 171 | MtpStorage* storage = new MtpStorage(storageID, pathStr, descriptionStr, |
Jerry Zhang | f9c5c25 | 2017-08-16 18:07:51 -0700 | [diff] [blame^] | 172 | removable, maxFileSize); |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 173 | server->addStorage(storage); |
James Dong | 3977472 | 2011-04-06 11:57:48 -0700 | [diff] [blame] | 174 | env->ReleaseStringUTFChars(path, pathStr); |
| 175 | env->ReleaseStringUTFChars(description, descriptionStr); |
| 176 | } else { |
| 177 | env->ReleaseStringUTFChars(path, pathStr); |
| 178 | } |
| 179 | } |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 180 | } else { |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 181 | ALOGE("server is null in add_storage"); |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 182 | } |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | static void |
| 186 | android_mtp_MtpServer_remove_storage(JNIEnv *env, jobject thiz, jint storageId) |
| 187 | { |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 188 | Mutex::Autolock autoLock(sMutex); |
| 189 | |
| 190 | MtpServer* server = getMtpServer(env, thiz); |
| 191 | if (server) { |
| 192 | MtpStorage* storage = server->getStorage(storageId); |
| 193 | if (storage) { |
| 194 | server->removeStorage(storage); |
| 195 | delete storage; |
| 196 | } |
| 197 | } else |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 198 | ALOGE("server is null in remove_storage"); |
Mike Lockwood | 66e57f6 | 2011-02-18 13:24:01 -0500 | [diff] [blame] | 199 | } |
| 200 | |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 201 | // ---------------------------------------------------------------------------- |
| 202 | |
Daniel Micay | 76f6a86 | 2015-09-19 17:31:01 -0400 | [diff] [blame] | 203 | static const JNINativeMethod gMethods[] = { |
Jerry Zhang | bb598ee | 2016-10-24 14:35:08 -0700 | [diff] [blame] | 204 | {"native_configure", "(Z)V", (void *)android_mtp_configure}, |
Alex Klyubin | abdc2b4 | 2016-12-21 11:19:52 -0800 | [diff] [blame] | 205 | {"native_setup", "(Landroid/mtp/MtpDatabase;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", |
Mike Lockwood | 0cd0136 | 2010-12-30 11:54:33 -0500 | [diff] [blame] | 206 | (void *)android_mtp_MtpServer_setup}, |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 207 | {"native_run", "()V", (void *)android_mtp_MtpServer_run}, |
| 208 | {"native_cleanup", "()V", (void *)android_mtp_MtpServer_cleanup}, |
Mike Lockwood | 0cd0136 | 2010-12-30 11:54:33 -0500 | [diff] [blame] | 209 | {"native_send_object_added", "(I)V", (void *)android_mtp_MtpServer_send_object_added}, |
| 210 | {"native_send_object_removed", "(I)V", (void *)android_mtp_MtpServer_send_object_removed}, |
Mike Lockwood | 56c8524 | 2014-03-07 13:29:08 -0800 | [diff] [blame] | 211 | {"native_send_device_property_changed", "(I)V", |
| 212 | (void *)android_mtp_MtpServer_send_device_property_changed}, |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 213 | {"native_add_storage", "(Landroid/mtp/MtpStorage;)V", |
| 214 | (void *)android_mtp_MtpServer_add_storage}, |
| 215 | {"native_remove_storage", "(I)V", (void *)android_mtp_MtpServer_remove_storage}, |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 216 | }; |
| 217 | |
Mike Lockwood | 0cd0136 | 2010-12-30 11:54:33 -0500 | [diff] [blame] | 218 | int register_android_mtp_MtpServer(JNIEnv *env) |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 219 | { |
| 220 | jclass clazz; |
| 221 | |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 222 | clazz = env->FindClass("android/mtp/MtpStorage"); |
| 223 | if (clazz == NULL) { |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 224 | ALOGE("Can't find android/mtp/MtpStorage"); |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 225 | return -1; |
| 226 | } |
| 227 | field_MtpStorage_storageId = env->GetFieldID(clazz, "mStorageId", "I"); |
| 228 | if (field_MtpStorage_storageId == NULL) { |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 229 | ALOGE("Can't find MtpStorage.mStorageId"); |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 230 | return -1; |
| 231 | } |
| 232 | field_MtpStorage_path = env->GetFieldID(clazz, "mPath", "Ljava/lang/String;"); |
| 233 | if (field_MtpStorage_path == NULL) { |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 234 | ALOGE("Can't find MtpStorage.mPath"); |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 235 | return -1; |
| 236 | } |
| 237 | field_MtpStorage_description = env->GetFieldID(clazz, "mDescription", "Ljava/lang/String;"); |
| 238 | if (field_MtpStorage_description == NULL) { |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 239 | ALOGE("Can't find MtpStorage.mDescription"); |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 240 | return -1; |
| 241 | } |
Mike Lockwood | 5169054 | 2011-05-09 20:16:05 -0700 | [diff] [blame] | 242 | field_MtpStorage_removable = env->GetFieldID(clazz, "mRemovable", "Z"); |
| 243 | if (field_MtpStorage_removable == NULL) { |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 244 | ALOGE("Can't find MtpStorage.mRemovable"); |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 245 | return -1; |
| 246 | } |
Mike Lockwood | 7a59dd2 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 247 | field_MtpStorage_maxFileSize = env->GetFieldID(clazz, "mMaxFileSize", "J"); |
| 248 | if (field_MtpStorage_maxFileSize == NULL) { |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 249 | ALOGE("Can't find MtpStorage.mMaxFileSize"); |
Mike Lockwood | 7a59dd2 | 2011-07-11 09:18:03 -0400 | [diff] [blame] | 250 | return -1; |
| 251 | } |
Mike Lockwood | b239b683 | 2011-04-05 10:21:27 -0400 | [diff] [blame] | 252 | |
Mike Lockwood | 0cd0136 | 2010-12-30 11:54:33 -0500 | [diff] [blame] | 253 | clazz = env->FindClass("android/mtp/MtpServer"); |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 254 | if (clazz == NULL) { |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 255 | ALOGE("Can't find android/mtp/MtpServer"); |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 256 | return -1; |
| 257 | } |
Ashok Bhat | e2e5932 | 2013-12-17 19:04:19 +0000 | [diff] [blame] | 258 | field_MtpServer_nativeContext = env->GetFieldID(clazz, "mNativeContext", "J"); |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 259 | if (field_MtpServer_nativeContext == NULL) { |
Steve Block | 3762c31 | 2012-01-06 19:20:56 +0000 | [diff] [blame] | 260 | ALOGE("Can't find MtpServer.mNativeContext"); |
Mike Lockwood | dcc3194 | 2011-07-11 15:04:38 -0400 | [diff] [blame] | 261 | return -1; |
| 262 | } |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 263 | |
| 264 | return AndroidRuntime::registerNativeMethods(env, |
Mike Lockwood | 0cd0136 | 2010-12-30 11:54:33 -0500 | [diff] [blame] | 265 | "android/mtp/MtpServer", gMethods, NELEM(gMethods)); |
Mike Lockwood | 98ef64e | 2010-06-29 16:42:13 -0400 | [diff] [blame] | 266 | } |