Lines Matching refs:env
53 extern MtpDatabase* getMtpDatabase(JNIEnv *env, jobject database);
55 static inline MtpServer* getMtpServer(JNIEnv *env, jobject thiz) { in getMtpServer() argument
56 return (MtpServer*)env->GetLongField(thiz, field_MtpServer_nativeContext); in getMtpServer()
64 android_mtp_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase, jboolean usePtp, in android_mtp_MtpServer_setup() argument
70 const char *deviceInfoManufacturerStr = env->GetStringUTFChars(deviceInfoManufacturer, NULL); in android_mtp_MtpServer_setup()
71 const char *deviceInfoModelStr = env->GetStringUTFChars(deviceInfoModel, NULL); in android_mtp_MtpServer_setup()
72 const char *deviceInfoDeviceVersionStr = env->GetStringUTFChars(deviceInfoDeviceVersion, NULL); in android_mtp_MtpServer_setup()
73 const char *deviceInfoSerialNumberStr = env->GetStringUTFChars(deviceInfoSerialNumber, NULL); in android_mtp_MtpServer_setup()
74 MtpServer* server = new MtpServer(getMtpDatabase(env, javaDatabase), in android_mtp_MtpServer_setup()
81 env->ReleaseStringUTFChars(deviceInfoManufacturer, deviceInfoManufacturerStr); in android_mtp_MtpServer_setup()
84 env->ReleaseStringUTFChars(deviceInfoModel, deviceInfoModelStr); in android_mtp_MtpServer_setup()
87 env->ReleaseStringUTFChars(deviceInfoDeviceVersion, deviceInfoDeviceVersionStr); in android_mtp_MtpServer_setup()
90 env->ReleaseStringUTFChars(deviceInfoSerialNumber, deviceInfoSerialNumberStr); in android_mtp_MtpServer_setup()
92 env->SetLongField(thiz, field_MtpServer_nativeContext, (jlong)server); in android_mtp_MtpServer_setup()
96 android_mtp_MtpServer_run(JNIEnv *env, jobject thiz) in android_mtp_MtpServer_run() argument
98 MtpServer* server = getMtpServer(env, thiz); in android_mtp_MtpServer_run()
106 android_mtp_MtpServer_cleanup(JNIEnv *env, jobject thiz) in android_mtp_MtpServer_cleanup() argument
110 MtpServer* server = getMtpServer(env, thiz); in android_mtp_MtpServer_cleanup()
113 env->SetLongField(thiz, field_MtpServer_nativeContext, 0); in android_mtp_MtpServer_cleanup()
120 android_mtp_MtpServer_send_object_added(JNIEnv *env, jobject thiz, jint handle) in android_mtp_MtpServer_send_object_added() argument
124 MtpServer* server = getMtpServer(env, thiz); in android_mtp_MtpServer_send_object_added()
132 android_mtp_MtpServer_send_object_removed(JNIEnv *env, jobject thiz, jint handle) in android_mtp_MtpServer_send_object_removed() argument
136 MtpServer* server = getMtpServer(env, thiz); in android_mtp_MtpServer_send_object_removed()
144 android_mtp_MtpServer_send_device_property_changed(JNIEnv *env, jobject thiz, jint property) in android_mtp_MtpServer_send_device_property_changed() argument
148 MtpServer* server = getMtpServer(env, thiz); in android_mtp_MtpServer_send_device_property_changed()
156 android_mtp_MtpServer_add_storage(JNIEnv *env, jobject thiz, jobject jstorage) in android_mtp_MtpServer_add_storage() argument
160 MtpServer* server = getMtpServer(env, thiz); in android_mtp_MtpServer_add_storage()
162 jint storageID = env->GetIntField(jstorage, field_MtpStorage_storageId); in android_mtp_MtpServer_add_storage()
163 jstring path = (jstring)env->GetObjectField(jstorage, field_MtpStorage_path); in android_mtp_MtpServer_add_storage()
164 jstring description = (jstring)env->GetObjectField(jstorage, field_MtpStorage_description); in android_mtp_MtpServer_add_storage()
165 jlong reserveSpace = env->GetLongField(jstorage, field_MtpStorage_reserveSpace); in android_mtp_MtpServer_add_storage()
166 jboolean removable = env->GetBooleanField(jstorage, field_MtpStorage_removable); in android_mtp_MtpServer_add_storage()
167 jlong maxFileSize = env->GetLongField(jstorage, field_MtpStorage_maxFileSize); in android_mtp_MtpServer_add_storage()
169 const char *pathStr = env->GetStringUTFChars(path, NULL); in android_mtp_MtpServer_add_storage()
171 const char *descriptionStr = env->GetStringUTFChars(description, NULL); in android_mtp_MtpServer_add_storage()
176 env->ReleaseStringUTFChars(path, pathStr); in android_mtp_MtpServer_add_storage()
177 env->ReleaseStringUTFChars(description, descriptionStr); in android_mtp_MtpServer_add_storage()
179 env->ReleaseStringUTFChars(path, pathStr); in android_mtp_MtpServer_add_storage()
188 android_mtp_MtpServer_remove_storage(JNIEnv *env, jobject thiz, jint storageId) in android_mtp_MtpServer_remove_storage() argument
192 MtpServer* server = getMtpServer(env, thiz); in android_mtp_MtpServer_remove_storage()
220 int register_android_mtp_MtpServer(JNIEnv *env) in register_android_mtp_MtpServer() argument
224 clazz = env->FindClass("android/mtp/MtpStorage"); in register_android_mtp_MtpServer()
229 field_MtpStorage_storageId = env->GetFieldID(clazz, "mStorageId", "I"); in register_android_mtp_MtpServer()
234 field_MtpStorage_path = env->GetFieldID(clazz, "mPath", "Ljava/lang/String;"); in register_android_mtp_MtpServer()
239 field_MtpStorage_description = env->GetFieldID(clazz, "mDescription", "Ljava/lang/String;"); in register_android_mtp_MtpServer()
244 field_MtpStorage_reserveSpace = env->GetFieldID(clazz, "mReserveSpace", "J"); in register_android_mtp_MtpServer()
249 field_MtpStorage_removable = env->GetFieldID(clazz, "mRemovable", "Z"); in register_android_mtp_MtpServer()
254 field_MtpStorage_maxFileSize = env->GetFieldID(clazz, "mMaxFileSize", "J"); in register_android_mtp_MtpServer()
260 clazz = env->FindClass("android/mtp/MtpServer"); in register_android_mtp_MtpServer()
265 field_MtpServer_nativeContext = env->GetFieldID(clazz, "mNativeContext", "J"); in register_android_mtp_MtpServer()
271 return AndroidRuntime::registerNativeMethods(env, in register_android_mtp_MtpServer()