private static void enqueueUploadStart(UploadContext uploadContext, int completedRetries) { enqueueRequest( uploadContext, new StartUploadWorkItem( uploadContext, completedRetries)); }
@Override public boolean onActivityResult(int resultCode, Intent data) { return ShareInternalUtility.handleActivityResult( getRequestCode(), resultCode, data, resultProcessor); } };
private static void enqueueUploadFinish(UploadContext uploadContext, int completedRetries) { enqueueRequest( uploadContext, new FinishUploadWorkItem( uploadContext, completedRetries)); }
private void onActivityResult( int requestCode, int resultCode, Intent data) { // Look for results ShareInternalUtility.handleActivityResult( requestCode, resultCode, data, getResultProcessor(facebookDialogAnalyticsBundle)); // The handlers from above will run synchronously. So by the time we get here, it should be // safe to stop tracking this call and also serialize the controller to disk clearState(); }
@Override public boolean onActivityResult(int resultCode, Intent data) { return handleActivityResult( requestCode, resultCode, data, getShareResultProcessor(null)); } }
/** * Constructs a new ShareDialog. * @param activity Activity to use to share the provided content. */ public ShareDialog(Activity activity) { super(activity, DEFAULT_REQUEST_CODE); ShareInternalUtility.registerStaticShareCallback(DEFAULT_REQUEST_CODE); }
public static void invokeCallbackWithError( FacebookCallback<Sharer.Result> callback, String error) { invokeOnErrorCallback(callback, error); }
private static void enqueueUploadChunk( UploadContext uploadContext, String chunkStart, String chunkEnd, int completedRetries) { enqueueRequest( uploadContext, new TransferChunkWorkItem( uploadContext, chunkStart, chunkEnd, completedRetries)); }
private Bundle getGraphParametersForShareContent() { ShareContent content = this.shareContent; if (content == null) { return null; } if (content instanceof ShareLinkContent) { return WebDialogParameters.create((ShareLinkContent)content); } else if (content instanceof ShareOpenGraphContent) { return WebDialogParameters.create((ShareOpenGraphContent)content); } return null; }
private void saveState(Bundle analyticsParameters) { // Save off the call id for processing the response storeObjectIdForPendingController(objectId); // Store off the analytics parameters as well, for completion-logging facebookDialogAnalyticsBundle = analyticsParameters; // Serialize to disk, in case we get terminated while waiting for the dialog to complete serializeToDiskAsync(this); }
private void publishAgainIfNeeded(final Bundle analyticsParameters) { if (isObjectLiked != isObjectLikedOnServer && !publishLikeOrUnlikeAsync(isObjectLiked, analyticsParameters)) { // Unable to re-publish the new desired state. Signal that there is an error and // revert the like state back. publishDidError(!isObjectLiked); } }
@Override public void run() { callback.onComplete(controller, error); } });
private static Validator getStoryValidator(){ if(StoryValidator == null){ StoryValidator = new StoryShareValidator(); } return StoryValidator; }
private static Validator getDefaultValidator() { if (DefaultValidator == null) { DefaultValidator = new Validator(); } return DefaultValidator; }
private static Validator getApiValidator() { if (ApiValidator == null) { ApiValidator = new ApiValidator(); } return ApiValidator; }
@Override public void onError(FacebookException exception) { ShareInternalUtility.invokeCallbackWithException(callback, exception); } };
@Override protected void handleError(FacebookException error) { logError(error, "Video '%s' failed to finish uploading", uploadContext.videoId); endUploadWithFailure(error); }
@Override public boolean onActivityResult(int resultCode, Intent data) { return handleActivityResult( requestCode, resultCode, data, getShareResultProcessor(callback)); } });
/** * Constructs a MessageDialog. * @param activity Activity to use to send the provided content. */ public MessageDialog(Activity activity) { super(activity, DEFAULT_REQUEST_CODE); ShareInternalUtility.registerStaticShareCallback(DEFAULT_REQUEST_CODE); }
@Override public void onError(AppCall appCall, FacebookException error) { invokeOnErrorCallback(callback, error); } };