It turns out to be useful to allow enumeration on a per-tag basis,
and it's easy to support based on the data structures we have, so
add a tag parameter to getNextEvent().
diff --git a/services/java/com/android/server/DropBoxService.java b/services/java/com/android/server/DropBoxService.java
index 3a4c3ac..6c96a46 100644
--- a/services/java/com/android/server/DropBoxService.java
+++ b/services/java/com/android/server/DropBoxService.java
@@ -244,7 +244,7 @@
                 mContentResolver, Settings.Gservices.DROPBOX_TAG_PREFIX + tag));
     }
 
-    public synchronized DropBoxEntry getNextEntry(long millis) {
+    public synchronized DropBoxEntry getNextEntry(String tag, long millis) {
         if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.READ_LOGS)
                 != PackageManager.PERMISSION_GRANTED) {
             throw new SecurityException("READ_LOGS permission required");
@@ -257,7 +257,10 @@
             return null;
         }
 
-        for (EntryFile entry : mAllFiles.contents.tailSet(new EntryFile(millis + 1))) {
+        FileList list = tag == null ? mAllFiles : mFilesByTag.get(tag);
+        if (list == null) return null;
+
+        for (EntryFile entry : list.contents.tailSet(new EntryFile(millis + 1))) {
             if (entry.tag == null) continue;
             try {
                 File file = (entry.flags & DropBoxEntry.IS_EMPTY) != 0 ? null : entry.file;