Move MTP Java classes to android.mtp.* package.
Change-Id: Ib18bcaabf314241a95e517d0b93be5845d988e2c Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import android.provider.MediaStore.Video;
|
||||
import android.media.DecoderCapabilities;
|
||||
import android.media.DecoderCapabilities.VideoDecoder;
|
||||
import android.media.DecoderCapabilities.AudioDecoder;
|
||||
import android.mtp.MtpConstants;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
@@ -28,6 +28,7 @@ import android.database.Cursor;
|
||||
import android.database.SQLException;
|
||||
import android.drm.DrmManagerClient;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.mtp.MtpConstants;
|
||||
import android.net.Uri;
|
||||
import android.os.Environment;
|
||||
import android.os.Process;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.media;
|
||||
package android.mtp;
|
||||
|
||||
/**
|
||||
* {@hide}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.media;
|
||||
package android.mtp;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.ContentValues;
|
||||
@@ -22,6 +22,7 @@ import android.content.IContentProvider;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.media.MediaScanner;
|
||||
import android.net.Uri;
|
||||
import android.os.Environment;
|
||||
import android.os.RemoteException;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.media;
|
||||
package android.mtp;
|
||||
|
||||
import android.content.IContentProvider;
|
||||
import android.database.Cursor;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.media;
|
||||
package android.mtp;
|
||||
|
||||
/**
|
||||
* Encapsulates the ObjectPropList dataset used by the GetObjectPropList command.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.media;
|
||||
package android.mtp;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.media;
|
||||
package android.mtp;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.media;
|
||||
package android.mtp;
|
||||
|
||||
import android.database.AbstractWindowedCursor;
|
||||
import android.database.CursorWindow;
|
||||
@@ -9,10 +9,10 @@ LOCAL_SRC_FILES:= \
|
||||
android_media_ResampleInputStream.cpp \
|
||||
android_media_MediaProfiles.cpp \
|
||||
android_media_AmrInputStream.cpp \
|
||||
android_media_MtpDatabase.cpp \
|
||||
android_media_MtpServer.cpp \
|
||||
android_media_PtpClient.cpp \
|
||||
android_media_PtpCursor.cpp \
|
||||
android_mtp_MtpDatabase.cpp \
|
||||
android_mtp_MtpServer.cpp \
|
||||
android_mtp_PtpClient.cpp \
|
||||
android_mtp_PtpCursor.cpp \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libandroid_runtime \
|
||||
|
||||
@@ -774,11 +774,11 @@ extern int register_android_media_MediaRecorder(JNIEnv *env);
|
||||
extern int register_android_media_MediaScanner(JNIEnv *env);
|
||||
extern int register_android_media_ResampleInputStream(JNIEnv *env);
|
||||
extern int register_android_media_MediaProfiles(JNIEnv *env);
|
||||
extern int register_android_media_PtpClient(JNIEnv *env);
|
||||
extern int register_android_media_PtpCursor(JNIEnv *env);
|
||||
extern int register_android_media_MtpDatabase(JNIEnv *env);
|
||||
extern int register_android_media_MtpServer(JNIEnv *env);
|
||||
extern int register_android_media_AmrInputStream(JNIEnv *env);
|
||||
extern int register_android_mtp_MtpDatabase(JNIEnv *env);
|
||||
extern int register_android_mtp_MtpServer(JNIEnv *env);
|
||||
extern int register_android_mtp_PtpClient(JNIEnv *env);
|
||||
extern int register_android_mtp_PtpCursor(JNIEnv *env);
|
||||
|
||||
jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
||||
{
|
||||
@@ -826,22 +826,22 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
||||
goto bail;
|
||||
}
|
||||
|
||||
if (register_android_media_PtpClient(env) < 0) {
|
||||
if (register_android_mtp_PtpClient(env) < 0) {
|
||||
LOGE("ERROR: PtpClient native registration failed");
|
||||
goto bail;
|
||||
}
|
||||
|
||||
if (register_android_media_PtpCursor(env) < 0) {
|
||||
if (register_android_mtp_PtpCursor(env) < 0) {
|
||||
LOGE("ERROR: PtpCursor native registration failed");
|
||||
goto bail;
|
||||
}
|
||||
|
||||
if (register_android_media_MtpDatabase(env) < 0) {
|
||||
if (register_android_mtp_MtpDatabase(env) < 0) {
|
||||
LOGE("ERROR: MtpDatabase native registration failed");
|
||||
goto bail;
|
||||
}
|
||||
|
||||
if (register_android_media_MtpServer(env) < 0) {
|
||||
if (register_android_mtp_MtpServer(env) < 0) {
|
||||
LOGE("ERROR: MtpServer native registration failed");
|
||||
goto bail;
|
||||
}
|
||||
|
||||
@@ -1029,7 +1029,7 @@ void MyMtpDatabase::sessionEnded() {
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static void
|
||||
android_media_MtpDatabase_setup(JNIEnv *env, jobject thiz)
|
||||
android_mtp_MtpDatabase_setup(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("setup\n");
|
||||
@@ -1040,7 +1040,7 @@ android_media_MtpDatabase_setup(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
static void
|
||||
android_media_MtpDatabase_finalize(JNIEnv *env, jobject thiz)
|
||||
android_mtp_MtpDatabase_finalize(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("finalize\n");
|
||||
@@ -1053,7 +1053,7 @@ android_media_MtpDatabase_finalize(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
static jstring
|
||||
android_media_MtpPropertyGroup_format_date_time(JNIEnv *env, jobject thiz, jlong seconds)
|
||||
android_mtp_MtpPropertyGroup_format_date_time(JNIEnv *env, jobject thiz, jlong seconds)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
char date[20];
|
||||
@@ -1067,26 +1067,26 @@ android_media_MtpPropertyGroup_format_date_time(JNIEnv *env, jobject thiz, jlong
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static JNINativeMethod gMtpDatabaseMethods[] = {
|
||||
{"native_setup", "()V", (void *)android_media_MtpDatabase_setup},
|
||||
{"native_finalize", "()V", (void *)android_media_MtpDatabase_finalize},
|
||||
{"native_setup", "()V", (void *)android_mtp_MtpDatabase_setup},
|
||||
{"native_finalize", "()V", (void *)android_mtp_MtpDatabase_finalize},
|
||||
};
|
||||
|
||||
static JNINativeMethod gMtpPropertyGroupMethods[] = {
|
||||
{"format_date_time", "(J)Ljava/lang/String;",
|
||||
(void *)android_media_MtpPropertyGroup_format_date_time},
|
||||
(void *)android_mtp_MtpPropertyGroup_format_date_time},
|
||||
};
|
||||
|
||||
static const char* const kClassPathName = "android/media/MtpDatabase";
|
||||
static const char* const kClassPathName = "android/mtp/MtpDatabase";
|
||||
|
||||
int register_android_media_MtpDatabase(JNIEnv *env)
|
||||
int register_android_mtp_MtpDatabase(JNIEnv *env)
|
||||
{
|
||||
jclass clazz;
|
||||
|
||||
LOGD("register_android_media_MtpDatabase\n");
|
||||
LOGD("register_android_mtp_MtpDatabase\n");
|
||||
|
||||
clazz = env->FindClass("android/media/MtpDatabase");
|
||||
clazz = env->FindClass("android/mtp/MtpDatabase");
|
||||
if (clazz == NULL) {
|
||||
LOGE("Can't find android/media/MtpDatabase");
|
||||
LOGE("Can't find android/mtp/MtpDatabase");
|
||||
return -1;
|
||||
}
|
||||
method_beginSendObject = env->GetMethodID(clazz, "beginSendObject", "(Ljava/lang/String;IIIJJ)I");
|
||||
@@ -1145,7 +1145,7 @@ int register_android_media_MtpDatabase(JNIEnv *env)
|
||||
return -1;
|
||||
}
|
||||
method_getObjectPropertyList = env->GetMethodID(clazz, "getObjectPropertyList",
|
||||
"(JIJII)Landroid/media/MtpPropertyList;");
|
||||
"(JIJII)Landroid/mtp/MtpPropertyList;");
|
||||
if (method_getObjectPropertyList == NULL) {
|
||||
LOGE("Can't find getObjectPropertyList");
|
||||
return -1;
|
||||
@@ -1193,9 +1193,9 @@ int register_android_media_MtpDatabase(JNIEnv *env)
|
||||
}
|
||||
|
||||
// now set up fields for MtpPropertyList class
|
||||
clazz = env->FindClass("android/media/MtpPropertyList");
|
||||
clazz = env->FindClass("android/mtp/MtpPropertyList");
|
||||
if (clazz == NULL) {
|
||||
LOGE("Can't find android/media/MtpPropertyList");
|
||||
LOGE("Can't find android/mtp/MtpPropertyList");
|
||||
return -1;
|
||||
}
|
||||
field_mCount = env->GetFieldID(clazz, "mCount", "I");
|
||||
@@ -1235,9 +1235,9 @@ int register_android_media_MtpDatabase(JNIEnv *env)
|
||||
}
|
||||
|
||||
if (AndroidRuntime::registerNativeMethods(env,
|
||||
"android/media/MtpDatabase", gMtpDatabaseMethods, NELEM(gMtpDatabaseMethods)))
|
||||
"android/mtp/MtpDatabase", gMtpDatabaseMethods, NELEM(gMtpDatabaseMethods)))
|
||||
return -1;
|
||||
|
||||
return AndroidRuntime::registerNativeMethods(env,
|
||||
"android/media/MtpPropertyGroup", gMtpPropertyGroupMethods, NELEM(gMtpPropertyGroupMethods));
|
||||
"android/mtp/MtpPropertyGroup", gMtpPropertyGroupMethods, NELEM(gMtpPropertyGroupMethods));
|
||||
}
|
||||
@@ -43,7 +43,7 @@ using namespace android;
|
||||
static jfieldID field_context;
|
||||
static Mutex sMutex;
|
||||
|
||||
// in android_media_MtpDatabase.cpp
|
||||
// in android_mtp_MtpDatabase.cpp
|
||||
extern MtpDatabase* getMtpDatabase(JNIEnv *env, jobject database);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
#endif // HAVE_ANDROID_OS
|
||||
|
||||
static void
|
||||
android_media_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase,
|
||||
android_mtp_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase,
|
||||
jstring storagePath, jlong reserveSpace)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
@@ -160,14 +160,14 @@ android_media_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase,
|
||||
}
|
||||
|
||||
static void
|
||||
android_media_MtpServer_finalize(JNIEnv *env, jobject thiz)
|
||||
android_mtp_MtpServer_finalize(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
LOGD("finalize\n");
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
android_media_MtpServer_start(JNIEnv *env, jobject thiz)
|
||||
android_mtp_MtpServer_start(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("start\n");
|
||||
@@ -177,7 +177,7 @@ android_media_MtpServer_start(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
static void
|
||||
android_media_MtpServer_stop(JNIEnv *env, jobject thiz)
|
||||
android_mtp_MtpServer_stop(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("stop\n");
|
||||
@@ -185,7 +185,7 @@ android_media_MtpServer_stop(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
static void
|
||||
android_media_MtpServer_send_object_added(JNIEnv *env, jobject thiz, jint handle)
|
||||
android_mtp_MtpServer_send_object_added(JNIEnv *env, jobject thiz, jint handle)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context);
|
||||
@@ -195,7 +195,7 @@ android_media_MtpServer_send_object_added(JNIEnv *env, jobject thiz, jint handle
|
||||
}
|
||||
|
||||
static void
|
||||
android_media_MtpServer_send_object_removed(JNIEnv *env, jobject thiz, jint handle)
|
||||
android_mtp_MtpServer_send_object_removed(JNIEnv *env, jobject thiz, jint handle)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
MtpThread *thread = (MtpThread *)env->GetIntField(thiz, field_context);
|
||||
@@ -205,7 +205,7 @@ android_media_MtpServer_send_object_removed(JNIEnv *env, jobject thiz, jint hand
|
||||
}
|
||||
|
||||
static void
|
||||
android_media_MtpServer_set_ptp_mode(JNIEnv *env, jobject thiz, jboolean usePtp)
|
||||
android_mtp_MtpServer_set_ptp_mode(JNIEnv *env, jobject thiz, jboolean usePtp)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("set_ptp_mode\n");
|
||||
@@ -218,27 +218,27 @@ android_media_MtpServer_set_ptp_mode(JNIEnv *env, jobject thiz, jboolean usePtp)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static JNINativeMethod gMethods[] = {
|
||||
{"native_setup", "(Landroid/media/MtpDatabase;Ljava/lang/String;J)V",
|
||||
(void *)android_media_MtpServer_setup},
|
||||
{"native_finalize", "()V", (void *)android_media_MtpServer_finalize},
|
||||
{"native_start", "()V", (void *)android_media_MtpServer_start},
|
||||
{"native_stop", "()V", (void *)android_media_MtpServer_stop},
|
||||
{"native_send_object_added", "(I)V", (void *)android_media_MtpServer_send_object_added},
|
||||
{"native_send_object_removed", "(I)V", (void *)android_media_MtpServer_send_object_removed},
|
||||
{"native_set_ptp_mode", "(Z)V", (void *)android_media_MtpServer_set_ptp_mode},
|
||||
{"native_setup", "(Landroid/mtp/MtpDatabase;Ljava/lang/String;J)V",
|
||||
(void *)android_mtp_MtpServer_setup},
|
||||
{"native_finalize", "()V", (void *)android_mtp_MtpServer_finalize},
|
||||
{"native_start", "()V", (void *)android_mtp_MtpServer_start},
|
||||
{"native_stop", "()V", (void *)android_mtp_MtpServer_stop},
|
||||
{"native_send_object_added", "(I)V", (void *)android_mtp_MtpServer_send_object_added},
|
||||
{"native_send_object_removed", "(I)V", (void *)android_mtp_MtpServer_send_object_removed},
|
||||
{"native_set_ptp_mode", "(Z)V", (void *)android_mtp_MtpServer_set_ptp_mode},
|
||||
};
|
||||
|
||||
static const char* const kClassPathName = "android/media/MtpServer";
|
||||
static const char* const kClassPathName = "android/mtp/MtpServer";
|
||||
|
||||
int register_android_media_MtpServer(JNIEnv *env)
|
||||
int register_android_mtp_MtpServer(JNIEnv *env)
|
||||
{
|
||||
jclass clazz;
|
||||
|
||||
LOGD("register_android_media_MtpServer\n");
|
||||
LOGD("register_android_mtp_MtpServer\n");
|
||||
|
||||
clazz = env->FindClass("android/media/MtpServer");
|
||||
clazz = env->FindClass("android/mtp/MtpServer");
|
||||
if (clazz == NULL) {
|
||||
LOGE("Can't find android/media/MtpServer");
|
||||
LOGE("Can't find android/mtp/MtpServer");
|
||||
return -1;
|
||||
}
|
||||
field_context = env->GetFieldID(clazz, "mNativeContext", "I");
|
||||
@@ -248,5 +248,5 @@ int register_android_media_MtpServer(JNIEnv *env)
|
||||
}
|
||||
|
||||
return AndroidRuntime::registerNativeMethods(env,
|
||||
"android/media/MtpServer", gMethods, NELEM(gMethods));
|
||||
"android/mtp/MtpServer", gMethods, NELEM(gMethods));
|
||||
}
|
||||
@@ -103,7 +103,7 @@ void MyClient::deviceRemoved(MtpDevice *device) {
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static void
|
||||
android_media_PtpClient_setup(JNIEnv *env, jobject thiz)
|
||||
android_mtp_PtpClient_setup(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("setup\n");
|
||||
@@ -114,7 +114,7 @@ android_media_PtpClient_setup(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
static void
|
||||
android_media_PtpClient_finalize(JNIEnv *env, jobject thiz)
|
||||
android_mtp_PtpClient_finalize(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("finalize\n");
|
||||
@@ -126,7 +126,7 @@ android_media_PtpClient_finalize(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
static jboolean
|
||||
android_media_PtpClient_start(JNIEnv *env, jobject thiz)
|
||||
android_mtp_PtpClient_start(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("start\n");
|
||||
@@ -138,7 +138,7 @@ android_media_PtpClient_start(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
static void
|
||||
android_media_PtpClient_stop(JNIEnv *env, jobject thiz)
|
||||
android_mtp_PtpClient_stop(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("stop\n");
|
||||
@@ -148,7 +148,7 @@ android_media_PtpClient_stop(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
static jboolean
|
||||
android_media_PtpClient_delete_object(JNIEnv *env, jobject thiz,
|
||||
android_mtp_PtpClient_delete_object(JNIEnv *env, jobject thiz,
|
||||
jint device_id, jlong object_id)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
@@ -162,7 +162,7 @@ android_media_PtpClient_delete_object(JNIEnv *env, jobject thiz,
|
||||
}
|
||||
|
||||
static jlong
|
||||
android_media_PtpClient_get_parent(JNIEnv *env, jobject thiz,
|
||||
android_mtp_PtpClient_get_parent(JNIEnv *env, jobject thiz,
|
||||
jint device_id, jlong object_id)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
@@ -176,7 +176,7 @@ android_media_PtpClient_get_parent(JNIEnv *env, jobject thiz,
|
||||
}
|
||||
|
||||
static jlong
|
||||
android_media_PtpClient_get_storage_id(JNIEnv *env, jobject thiz,
|
||||
android_mtp_PtpClient_get_storage_id(JNIEnv *env, jobject thiz,
|
||||
jint device_id, jlong object_id)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
@@ -190,7 +190,7 @@ android_media_PtpClient_get_storage_id(JNIEnv *env, jobject thiz,
|
||||
}
|
||||
|
||||
static jboolean
|
||||
android_media_PtpClient_import_file(JNIEnv *env, jobject thiz,
|
||||
android_mtp_PtpClient_import_file(JNIEnv *env, jobject thiz,
|
||||
jint device_id, jlong object_id, jstring dest_path)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
@@ -209,28 +209,28 @@ android_media_PtpClient_import_file(JNIEnv *env, jobject thiz,
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static JNINativeMethod gMethods[] = {
|
||||
{"native_setup", "()V", (void *)android_media_PtpClient_setup},
|
||||
{"native_finalize", "()V", (void *)android_media_PtpClient_finalize},
|
||||
{"native_start", "()Z", (void *)android_media_PtpClient_start},
|
||||
{"native_stop", "()V", (void *)android_media_PtpClient_stop},
|
||||
{"native_delete_object", "(IJ)Z", (void *)android_media_PtpClient_delete_object},
|
||||
{"native_get_parent", "(IJ)J", (void *)android_media_PtpClient_get_parent},
|
||||
{"native_get_storage_id", "(IJ)J", (void *)android_media_PtpClient_get_storage_id},
|
||||
{"native_setup", "()V", (void *)android_mtp_PtpClient_setup},
|
||||
{"native_finalize", "()V", (void *)android_mtp_PtpClient_finalize},
|
||||
{"native_start", "()Z", (void *)android_mtp_PtpClient_start},
|
||||
{"native_stop", "()V", (void *)android_mtp_PtpClient_stop},
|
||||
{"native_delete_object", "(IJ)Z", (void *)android_mtp_PtpClient_delete_object},
|
||||
{"native_get_parent", "(IJ)J", (void *)android_mtp_PtpClient_get_parent},
|
||||
{"native_get_storage_id", "(IJ)J", (void *)android_mtp_PtpClient_get_storage_id},
|
||||
{"native_import_file", "(IJLjava/lang/String;)Z",
|
||||
(void *)android_media_PtpClient_import_file},
|
||||
(void *)android_mtp_PtpClient_import_file},
|
||||
};
|
||||
|
||||
static const char* const kClassPathName = "android/media/PtpClient";
|
||||
static const char* const kClassPathName = "android/mtp/PtpClient";
|
||||
|
||||
int register_android_media_PtpClient(JNIEnv *env)
|
||||
int register_android_mtp_PtpClient(JNIEnv *env)
|
||||
{
|
||||
jclass clazz;
|
||||
|
||||
LOGD("register_android_media_PtpClient\n");
|
||||
LOGD("register_android_mtp_PtpClient\n");
|
||||
|
||||
clazz = env->FindClass("android/media/PtpClient");
|
||||
clazz = env->FindClass("android/mtp/PtpClient");
|
||||
if (clazz == NULL) {
|
||||
LOGE("Can't find android/media/PtpClient");
|
||||
LOGE("Can't find android/mtp/PtpClient");
|
||||
return -1;
|
||||
}
|
||||
method_deviceAdded = env->GetMethodID(clazz, "deviceAdded", "(I)V");
|
||||
@@ -250,5 +250,5 @@ int register_android_media_PtpClient(JNIEnv *env)
|
||||
}
|
||||
|
||||
return AndroidRuntime::registerNativeMethods(env,
|
||||
"android/media/PtpClient", gMethods, NELEM(gMethods));
|
||||
"android/mtp/PtpClient", gMethods, NELEM(gMethods));
|
||||
}
|
||||
@@ -37,7 +37,7 @@ using namespace android;
|
||||
|
||||
static jfieldID field_context;
|
||||
|
||||
// From android_media_PtpClient.cpp
|
||||
// From android_mtp_PtpClient.cpp
|
||||
MtpClient * get_client_from_object(JNIEnv * env, jobject javaClient);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -48,11 +48,11 @@ static bool ExceptionCheck(void* env)
|
||||
}
|
||||
|
||||
static void
|
||||
android_media_PtpCursor_setup(JNIEnv *env, jobject thiz, jobject javaClient,
|
||||
android_mtp_PtpCursor_setup(JNIEnv *env, jobject thiz, jobject javaClient,
|
||||
jint queryType, jint deviceID, jlong storageID, jlong objectID, jintArray javaColumns)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("android_media_PtpCursor_setup queryType: %d deviceID: %d storageID: %lld objectID: %lld\n",
|
||||
LOGD("android_mtp_PtpCursor_setup queryType: %d deviceID: %d storageID: %lld objectID: %lld\n",
|
||||
queryType, deviceID, storageID, objectID);
|
||||
|
||||
int* columns = NULL;
|
||||
@@ -73,7 +73,7 @@ android_media_PtpCursor_setup(JNIEnv *env, jobject thiz, jobject javaClient,
|
||||
}
|
||||
|
||||
static void
|
||||
android_media_PtpCursor_finalize(JNIEnv *env, jobject thiz)
|
||||
android_mtp_PtpCursor_finalize(JNIEnv *env, jobject thiz)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
LOGD("finalize\n");
|
||||
@@ -83,7 +83,7 @@ android_media_PtpCursor_finalize(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
static jint
|
||||
android_media_PtpCursor_fill_window(JNIEnv *env, jobject thiz, jobject javaWindow, jint startPos)
|
||||
android_mtp_PtpCursor_fill_window(JNIEnv *env, jobject thiz, jobject javaWindow, jint startPos)
|
||||
{
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
CursorWindow* window = get_window_from_object(env, javaWindow);
|
||||
@@ -104,25 +104,25 @@ android_media_PtpCursor_fill_window(JNIEnv *env, jobject thiz, jobject javaWindo
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static JNINativeMethod gMethods[] = {
|
||||
{"native_setup", "(Landroid/media/PtpClient;IIJJ[I)V",
|
||||
(void *)android_media_PtpCursor_setup},
|
||||
{"native_finalize", "()V", (void *)android_media_PtpCursor_finalize},
|
||||
{"native_setup", "(Landroid/mtp/PtpClient;IIJJ[I)V",
|
||||
(void *)android_mtp_PtpCursor_setup},
|
||||
{"native_finalize", "()V", (void *)android_mtp_PtpCursor_finalize},
|
||||
{"native_fill_window", "(Landroid/database/CursorWindow;I)I",
|
||||
(void *)android_media_PtpCursor_fill_window},
|
||||
(void *)android_mtp_PtpCursor_fill_window},
|
||||
|
||||
};
|
||||
|
||||
static const char* const kClassPathName = "android/media/PtpCursor";
|
||||
static const char* const kClassPathName = "android/mtp/PtpCursor";
|
||||
|
||||
int register_android_media_PtpCursor(JNIEnv *env)
|
||||
int register_android_mtp_PtpCursor(JNIEnv *env)
|
||||
{
|
||||
jclass clazz;
|
||||
|
||||
LOGD("register_android_media_PtpCursor\n");
|
||||
LOGD("register_android_mtp_PtpCursor\n");
|
||||
|
||||
clazz = env->FindClass("android/media/PtpCursor");
|
||||
clazz = env->FindClass("android/mtp/PtpCursor");
|
||||
if (clazz == NULL) {
|
||||
LOGE("Can't find android/media/PtpCursor");
|
||||
LOGE("Can't find android/mtp/PtpCursor");
|
||||
return -1;
|
||||
}
|
||||
field_context = env->GetFieldID(clazz, "mNativeContext", "I");
|
||||
@@ -132,5 +132,5 @@ int register_android_media_PtpCursor(JNIEnv *env)
|
||||
}
|
||||
|
||||
return AndroidRuntime::registerNativeMethods(env,
|
||||
"android/media/PtpCursor", gMethods, NELEM(gMethods));
|
||||
"android/mtp/PtpCursor", gMethods, NELEM(gMethods));
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.media.MtpConstants;
|
||||
import android.mtp.MtpConstants;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Ptp;
|
||||
|
||||
Reference in New Issue
Block a user