Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b33eacdb authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Ignore the result of the on share callback in ShareActionProvider.

1. The reason for having this callback on the ShareActionProvider
   is to notify the client that a share happened so he can update
   the UI.

Change-Id: I65e8a8db8d4add0cd23d53be0286b14b4b4640b4
parent f21bea24
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -80,16 +80,22 @@ public class ShareActionProvider extends ActionProvider {

        /**
         * Called when a share target has been selected. The client can
         * decide whether to handle the intent or rely on the default
         * behavior which is launching it.
         * decide whether to perform some action before the sharing is
         * actually performed.
         * <p>
         * <strong>Note:</strong> Modifying the intent is not permitted and
         *     any changes to the latter will be ignored.
         * </p>
         * <p>
         * <strong>Note:</strong> You should <strong>not</strong> handle the
         *     intent here. This callback aims to notify the client that a
         *     sharing is being performed, so the client can update the UI
         *     if necessary.
         * </p>
         *
         * @param source The source of the notification.
         * @param intent The intent for launching the chosen share target.
         * @return Whether the client has handled the intent.
         * @return The return result is ignored. Always return false for consistency.
         */
        public boolean onShareTargetSelected(ShareActionProvider source, Intent intent);
    }
@@ -308,7 +314,7 @@ public class ShareActionProvider extends ActionProvider {
        @Override
        public boolean onChooseActivity(ActivityChooserModel host, Intent intent) {
            if (mOnShareTargetSelectedListener != null) {
                return mOnShareTargetSelectedListener.onShareTargetSelected(
                mOnShareTargetSelectedListener.onShareTargetSelected(
                        ShareActionProvider.this, intent);
            }
            return false;