Add test package for MTPDocumentsProvider.

BUG=20274999

Change-Id: I179692d3b14392a0634d4c0ace21a9d96a2d0d6a
diff --git a/Android.mk b/Android.mk
index 02cd677..ec18463 100644
--- a/Android.mk
+++ b/Android.mk
@@ -2,10 +2,9 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_PACKAGE_NAME := MtpDocumentsProvider
 LOCAL_CERTIFICATE := media
 
 include $(BUILD_PACKAGE)
+include $(LOCAL_PATH)/tests/Android.mk
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 9a1dc36..6172354 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
           package="com.android.mtp"
           android:sharedUserId="android.media">
diff --git a/tests/Android.mk b/tests/Android.mk
new file mode 100644
index 0000000..8538379
--- /dev/null
+++ b/tests/Android.mk
@@ -0,0 +1,11 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := tests
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_PACKAGE_NAME := MtpDocumentsProviderTests
+LOCAL_INSTRUMENTATION_FOR := MtpDocumentsProvider
+LOCAL_CERTIFICATE := media
+
+include $(BUILD_PACKAGE)
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
new file mode 100644
index 0000000..50b7521
--- /dev/null
+++ b/tests/AndroidManifest.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.android.mtp.tests"
+    android:sharedUserId="android.media">
+
+    <application>
+        <uses-library android:name="android.test.runner" />
+    </application>
+
+    <instrumentation android:name="android.test.InstrumentationTestRunner"
+        android:targetPackage="com.android.mtp"
+        android:label="Tests for MtpDocumentsProvider" />
+
+</manifest>
diff --git a/tests/src/com/android/mtp/MtpDocumentsProviderTest.java b/tests/src/com/android/mtp/MtpDocumentsProviderTest.java
new file mode 100644
index 0000000..990d6ae
--- /dev/null
+++ b/tests/src/com/android/mtp/MtpDocumentsProviderTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.AndroidTestCase;
+import android.test.suitebuilder.annotation.SmallTest;
+
+@SmallTest
+public class MtpDocumentsProviderTest extends AndroidTestCase {
+    public void testBasic() {
+        final MtpDocumentsProvider provider = new MtpDocumentsProvider();
+        assertNotNull(provider);
+    }
+}