From 59686f6c352fd70fec5ce8c7a2a867d6ecf15ff0 Mon Sep 17 00:00:00 2001 From: Daichi Hirono Date: Wed, 28 Oct 2015 16:43:32 +0900 Subject: [PATCH] Update JavaDoc in MtpDatabase. BUG=25162822 Change-Id: Icfd9391daa01846f5ec12d5ea7448ebc7444a05c --- .../src/com/android/mtp/MtpDatabase.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/MtpDocumentsProvider/src/com/android/mtp/MtpDatabase.java b/packages/MtpDocumentsProvider/src/com/android/mtp/MtpDatabase.java index df9d44ac37554..df4a9f0b5325e 100644 --- a/packages/MtpDocumentsProvider/src/com/android/mtp/MtpDatabase.java +++ b/packages/MtpDocumentsProvider/src/com/android/mtp/MtpDatabase.java @@ -20,8 +20,15 @@ import java.nio.charset.StandardCharsets; * Database for MTP objects. * The object handle which is identifier for object in MTP protocol is not stable over sessions. * When we resume the process, we need to remap our document ID with MTP's object handle. - * The database object remembers the map of document ID and fullpath, and helps to remap object - * handle and document ID by comparing fullpath. + * + * If the remote MTP device is backed by typical file system, the file name + * is unique among files in a directory. However, MTP protocol itself does + * not guarantee the uniqueness of name so we cannot use fullpath as ID. + * + * Instead of fullpath, we use artificial ID generated by MtpDatabase itself. The database object + * remembers the map of document ID and object handle, and remaps new object handle with document ID + * by comparing the directory structure and object name. + * * TODO: Remove @VisibleForTesting annotation when we start to use this class. */ @VisibleForTesting