}
@Override
+ public void onSessionUpdated(Uri uri) {
+ Log.v(TAG, "onSessionUpdated: " + uri);
+ mDataAdapter.refresh(uri);
+ }
+
+ @Override
public void onSessionDone(final Uri sessionUri) {
Log.v(TAG, "onSessionDone:" + sessionUri);
Uri contentUri = Storage.getContentUriForSessionUri(sessionUri);
* Updates the preview from the file created from
* {@link #getTempOutputFile()}.
*/
- public void updatePreviewAndIndicator();
+ public void updatePreview();
/**
* Adds a progress listener to this session.
@Override
public void updateThumbnail(Bitmap bitmap) {
mPlaceholderManager.replacePlaceholder(mPlaceHolderSession, bitmap);
- mSessionManager.notifyTaskQueued(mUri);
+ mSessionManager.notifySessionUpdated(mUri);
}
@Override
}
@Override
- public void updatePreviewAndIndicator() {
+ public void updatePreview() {
final File path;
if (mTempOutputFile.isUsable()) {
path = mTempOutputFile.getFile();
Bitmap placeholder = BitmapFactory.decodeByteArray(jpegData, 0, jpegData.length,
options);
mPlaceholderManager.replacePlaceholder(mPlaceHolderSession, placeholder);
- onCaptureIndicatorUpdate(placeholder, 0 /* rotation */);
+ mSessionManager.notifySessionUpdated(mUri);
}
});
}
public void onSessionQueued(Uri mediaUri);
/**
+ * Called when the media underlying the session with the given Uri has
+ * been updated.
+ */
+ public void onSessionUpdated(Uri mediaUri);
+
+ /**
* Called when the capture indicator for the given session has changed
* and should be updated.
*
}
/**
+ * Notifies all task listeners that the media associated with the task has
+ * been updated.
+ */
+ void notifySessionUpdated(final Uri uri) {
+ mMainHandler.execute(new Runnable() {
+ @Override
+ public void run() {
+ synchronized (mTaskListeners) {
+ for (SessionListener listener : mTaskListeners) {
+ listener.onSessionUpdated(uri);
+ }
+ }
+ }
+ });
+ }
+
+ /**
* Notifies all task listeners that the task with the given URI has updated
* its media.
*