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

Commit b999b0cb authored by Daichi Hirono's avatar Daichi Hirono
Browse files

Move TestResources class to the outside of MtpDocumentProviderTest.

TestResources class will be used in MtpDatabaseTest.

BUG=25162822

Change-Id: I4f51b517532bbc111e95e7ebd96787a2e6f0f87a
parent 0c4a7695
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -16,9 +16,6 @@

package com.android.mtp;

import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.database.Cursor;
import android.mtp.MtpConstants;
import android.mtp.MtpObjectInfo;
@@ -26,7 +23,6 @@ import android.net.Uri;
import android.provider.DocumentsContract.Root;
import android.provider.DocumentsContract;
import android.test.AndroidTestCase;
import android.test.mock.MockResources;
import android.test.suitebuilder.annotation.SmallTest;

import java.io.FileNotFoundException;
@@ -39,16 +35,7 @@ public class MtpDocumentsProviderTest extends AndroidTestCase {
    private TestContentResolver mResolver;
    private MtpDocumentsProvider mProvider;
    private TestMtpManager mMtpManager;
    private final MockResources mResources = new MockResources() {
        @Override
        public String getString(int id) throws NotFoundException {
            switch (id) {
                case R.string.root_name:
                    return "%1$s %2$s";
            }
            throw new NotFoundException();
        }
    };
    private final TestResources mResources = new TestResources();

    @Override
    public void setUp() throws IOException {
+30 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.mtp;

import android.test.mock.MockResources;

class TestResources extends MockResources {
    @Override
    public String getString(int id) throws NotFoundException {
        switch (id) {
            case R.string.root_name:
                return "%1$s %2$s";
        }
        throw new NotFoundException();
    }
}