OSDN Git Service

Merge "Revert "Revert "Add device document to MtpDatabase."""
authorDaichi Hirono <hirono@google.com>
Tue, 15 Dec 2015 08:19:29 +0000 (08:19 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 15 Dec 2015 08:19:29 +0000 (08:19 +0000)
1  2 
packages/MtpDocumentsProvider/tests/src/com/android/mtp/MtpDatabaseTest.java

@@@ -62,21 -60,9 +62,21 @@@ public class MtpDatabaseTest extends An
          mDatabase = null;
      }
  
 +    private static int getInt(Cursor cursor, String columnName) {
 +        return cursor.getInt(cursor.getColumnIndex(columnName));
 +    }
 +
 +    private static boolean isNull(Cursor cursor, String columnName) {
 +        return cursor.isNull(cursor.getColumnIndex(columnName));
 +    }
 +
 +    private static String getString(Cursor cursor, String columnName) {
 +        return cursor.getString(cursor.getColumnIndex(columnName));
 +    }
 +
      public void testPutRootDocuments() throws Exception {
-         mDatabase.getMapper().startAddingDocuments(null);
-         mDatabase.getMapper().putRootDocuments(0, resources, new MtpRoot[] {
+         mDatabase.getMapper().startAddingDocuments("deviceDocId");
+         mDatabase.getMapper().putRootDocuments("deviceDocId", resources, new MtpRoot[] {
                  new MtpRoot(0, 1, "Device", "Storage", 1000, 2000, ""),
                  new MtpRoot(0, 2, "Device", "Storage", 2000, 4000, ""),
                  new MtpRoot(0, 3, "Device", "/@#%&<>Storage", 3000, 6000,"")