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

Commit e9373290 authored by Daichi Hirono's avatar Daichi Hirono Committed by Android (Google) Code Review
Browse files

Merge "Don't map root documents in DocumentLoader." into nyc-dev

parents 75bb7a6e 071313e8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -9,5 +9,10 @@ LOCAL_PRIVILEGED_MODULE := true
LOCAL_JNI_SHARED_LIBRARIES := libappfuse_jni
LOCAL_PROGUARD_FLAG_FILES := proguard.flags

# Only enable asserts on userdebug/eng builds
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
LOCAL_JACK_FLAGS += -D jack.assert.policy=enable
endif

include $(BUILD_PACKAGE)
include $(call all-makefiles-under, $(LOCAL_PATH))
+4 −2
Original line number Diff line number Diff line
@@ -69,7 +69,8 @@ class DocumentLoader implements AutoCloseable {
     */
    synchronized Cursor queryChildDocuments(String[] columnNames, Identifier parent)
            throws IOException {
        Preconditions.checkArgument(parent.mDeviceId == mDevice.deviceId);
        assert parent.mDeviceId == mDevice.deviceId;

        LoaderTask task = mTaskList.findTask(parent);
        if (task == null) {
            if (parent.mDocumentId == null) {
@@ -256,7 +257,8 @@ class DocumentLoader implements AutoCloseable {

        LoaderTask(MtpManager manager, MtpDatabase database, int[] operationsSupported,
                Identifier identifier) {
            Preconditions.checkNotNull(operationsSupported);
            assert operationsSupported != null;
            assert identifier.mDocumentType != MtpDatabaseConstants.DOCUMENT_TYPE_DEVICE;
            mManager = manager;
            mDatabase = database;
            mOperationsSupported = operationsSupported;
+2 −1
Original line number Diff line number Diff line
@@ -617,6 +617,7 @@ class MtpDatabase {
        final String whereClosure =
                "parent." + COLUMN_DEVICE_ID + " = ? AND " +
                "parent." + COLUMN_ROW_STATE + " IN (?, ?) AND " +
                "parent." + COLUMN_DOCUMENT_TYPE + " != ? AND " +
                "child." + COLUMN_ROW_STATE + " = ?";
        try (final Cursor cursor = mDatabase.query(
                fromClosure,
@@ -626,7 +627,7 @@ class MtpDatabase {
                        "parent." + Document.COLUMN_DOCUMENT_ID,
                        "parent." + COLUMN_DOCUMENT_TYPE),
                whereClosure,
                strings(deviceId, ROW_STATE_VALID, ROW_STATE_INVALIDATED,
                strings(deviceId, ROW_STATE_VALID, ROW_STATE_INVALIDATED, DOCUMENT_TYPE_DEVICE,
                        ROW_STATE_DISCONNECTED),
                null,
                null,