From b809a47b9f2a5dd1b6237000b525060fea21fafa Mon Sep 17 00:00:00 2001 From: Mark Wei Date: Wed, 6 Nov 2013 14:25:37 -0800 Subject: Add javadoc explaining when to implement async FD vs sync IS methods. Change-Id: I8a5e739c14d357b0b6b724cdbff45cd116458660 --- src/com/android/bitmap/RequestKey.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/com') diff --git a/src/com/android/bitmap/RequestKey.java b/src/com/android/bitmap/RequestKey.java index d9c15ae..adf1d72 100644 --- a/src/com/android/bitmap/RequestKey.java +++ b/src/com/android/bitmap/RequestKey.java @@ -70,6 +70,9 @@ public interface RequestKey { * the given callback. This method will be called first; if it returns null, * {@link #createInputStream()} will be called. * + * Clients should implement this method if files are in the local cache folder, or if files must + * be downloaded and cached. + * * This method must be called from the UI thread. * * @param key The key to create a FileDescriptorFactory for. This key will be passed to the @@ -89,6 +92,9 @@ public interface RequestKey { * Create an {@link InputStream} for the source. This method will be called if * {@link #createFileDescriptorFactoryAsync(RequestKey, Callback)} returns null. * + * Clients should implement this method if files exist in the assets/ folder, or for prototypes + * that open a connection directly on a URL (be warned that this will cause GCs). + * * This method can be called from any thread. */ public InputStream createInputStream() throws IOException; -- cgit v1.2.3