added android log

This commit is contained in:
Thibault Deckers 2020-02-07 18:59:55 +01:00
parent 5e92613fac
commit b8666b4a33

View file

@ -3,6 +3,8 @@ package deckers.thibault.aves.channelhandlers;
import android.app.Activity; import android.app.Activity;
import android.util.Log; import android.util.Log;
import java.time.Duration;
import java.time.Instant;
import java.util.stream.Stream; import java.util.stream.Stream;
import deckers.thibault.aves.model.ImageEntry; import deckers.thibault.aves.model.ImageEntry;
@ -29,9 +31,11 @@ public class MediaStoreStreamHandler implements EventChannel.StreamHandler {
void fetchAll(Activity activity) { void fetchAll(Activity activity) {
Log.d(LOG_TAG, "fetchAll start"); Log.d(LOG_TAG, "fetchAll start");
Stream<ImageEntry> stream = new MediaStoreImageProvider().fetchAll(activity); Instant start = Instant.now();
Stream<ImageEntry> stream = new MediaStoreImageProvider().fetchAll(activity); // 100ms
stream.map(ImageEntry::toMap) stream.map(ImageEntry::toMap)
.forEach(entry -> eventSink.success(entry)); .forEach(entry -> eventSink.success(entry)); // 250ms
eventSink.endOfStream(); eventSink.endOfStream();
Log.d(LOG_TAG, "fetchAll complete in " + Duration.between(start, Instant.now()).toMillis() + "ms");
} }
} }