Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2097a9e authored by Mike Lockwood's avatar Mike Lockwood Committed by Android (Google) Code Review
Browse files

Merge "Remove some scafolding and test code that is no longer worth maintaining."

parents 177eb38e c5c7853b
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -74,26 +74,6 @@ public class MtpDatabase {
        native_finalize();
    }

    // called from native code
    private int getObjectHandle(String path) {
        Log.d(TAG, "getObjectHandle " + path);
        Cursor c = null;
        try {
            c = mMediaProvider.query(mObjectsUri, ID_PROJECTION,
                            PATH_WHERE, new String[] { path }, null);
            if (c != null && c.moveToNext()) {
                return c.getInt(0);
            }
        } catch (RemoteException e) {
            Log.e(TAG, "RemoteException in getObjectHandle", e);
        } finally {
            if (c != null) {
                c.close();
            }
        }
        return 0;
    }

    private int addFile(String path, int format, int parent,
                         int storage, long size, long modified) {
        Log.d(TAG, "addFile " + path);
+0 −13
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ using namespace android;

// ----------------------------------------------------------------------------

static jmethodID method_getObjectHandle;
static jmethodID method_addFile;
static jmethodID method_getObjectList;
static jmethodID method_getObjectProperty;
@@ -63,8 +62,6 @@ public:
    virtual                         ~MyMtpDatabase();
    void                            cleanup(JNIEnv *env);

    virtual MtpObjectHandle         getObjectHandle(const char* path);

    virtual MtpObjectHandle         addFile(const char* path,
                                            MtpObjectFormat format,
                                            MtpObjectHandle parent,
@@ -138,11 +135,6 @@ void MyMtpDatabase::cleanup(JNIEnv *env) {
MyMtpDatabase::~MyMtpDatabase() {
}

MtpObjectHandle MyMtpDatabase::getObjectHandle(const char* path) {
    JNIEnv* env = AndroidRuntime::getJNIEnv();
    return env->CallIntMethod(mDatabase, method_getObjectHandle, env->NewStringUTF(path));
}

MtpObjectHandle MyMtpDatabase::addFile(const char* path,
                                            MtpObjectFormat format,
                                            MtpObjectHandle parent,
@@ -405,11 +397,6 @@ int register_android_media_MtpDatabase(JNIEnv *env)
        LOGE("Can't find android/media/MtpDatabase");
        return -1;
    }
    method_getObjectHandle = env->GetMethodID(clazz, "getObjectHandle", "(Ljava/lang/String;)I");
    if (method_getObjectHandle == NULL) {
        LOGE("Can't find getObjectHandle");
        return -1;
    }
    method_addFile = env->GetMethodID(clazz, "addFile", "(Ljava/lang/String;IIIJJ)I");
    if (method_addFile == NULL) {
        LOGE("Can't find addFile");
+0 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
#include "private/android_filesystem_config.h"

#include "MtpServer.h"
#include "MtpSqliteDatabase.h"  // REMOVE

using namespace android;

+0 −43
Original line number Diff line number Diff line
@@ -24,62 +24,19 @@ LOCAL_SRC_FILES:= \
                  MtpDebug.cpp                          \
                  MtpDevice.cpp                         \
                  MtpDeviceInfo.cpp                     \
                  MtpMediaScanner.cpp                   \
                  MtpObjectInfo.cpp                     \
                  MtpPacket.cpp                         \
                  MtpProperty.cpp                       \
                  MtpRequestPacket.cpp                  \
                  MtpResponsePacket.cpp                 \
                  MtpServer.cpp                         \
                  MtpSqliteDatabase.cpp                 \
                  MtpStorageInfo.cpp                    \
                  MtpStringBuffer.cpp                   \
                  MtpStorage.cpp                        \
                  MtpUtils.cpp                          \
                  SqliteDatabase.cpp                    \
                  SqliteStatement.cpp                   \

LOCAL_MODULE:= libmtp

LOCAL_C_INCLUDES := external/sqlite/dist

LOCAL_CFLAGS := -DMTP_DEVICE -DMTP_HOST

include $(BUILD_STATIC_LIBRARY)

ifneq ($(TARGET_SIMULATOR),true)

include $(CLEAR_VARS)

LOCAL_SRC_FILES:=                                       \
                  mtptest.cpp                           \

LOCAL_MODULE:= mtptest

LOCAL_CFLAGS := -DMTP_DEVICE

LOCAL_SHARED_LIBRARIES := libutils libsqlite libcutils \
	libmedia

LOCAL_STATIC_LIBRARIES := libmtp

include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)

LOCAL_MODULE := scantest
LOCAL_SRC_FILES:=                                       \
                  scantest.cpp                          \


LOCAL_STATIC_LIBRARIES := libmtp

LOCAL_C_INCLUDES := external/sqlite/dist
LOCAL_SHARED_LIBRARIES := libutils libsqlite libmedia

LOCAL_CFLAGS := -g
LOCAL_LDFLAGS := -g

include $(BUILD_EXECUTABLE)

endif
+0 −5
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
#define _MTP_DATABASE_H

#include "MtpTypes.h"
#include "SqliteDatabase.h"

namespace android {

@@ -28,7 +27,6 @@ class MtpDatabase {
public:
    virtual ~MtpDatabase() {}

    virtual MtpObjectHandle         getObjectHandle(const char* path) = 0;
    virtual MtpObjectHandle         addFile(const char* path,
                                            MtpObjectFormat format,
                                            MtpObjectHandle parent,
@@ -52,9 +50,6 @@ public:
                                            int64_t& fileLength) = 0;
    virtual bool                    deleteFile(MtpObjectHandle handle) = 0;

    // helper for media scanner
    virtual MtpObjectHandle*        getFileList(int& outCount) = 0;

    virtual void                    beginTransaction() = 0;
    virtual void                    commitTransaction() = 0;
    virtual void                    rollbackTransaction() = 0;
Loading