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

Commit e0d61a84 authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Remove old quickshare chip when adding a new one

Fix to avoid showing a quickshare chip based on outdated information.
Resets the pending interaction if the user tapped the old quickshare
chip, since we won't get updated information for that chip.

A future change in QPR3 will fix the logic around retrieving the
quickshare data, so we don't hit this edge case in the first place.

Test: manual; verified that taking two screenshots in quick
succession that result in a quickshare chip no longer showed
two chips at the same time
Bug: 258732618

Change-Id: I70b4914068ee883c95345bbc8e3e04fc334394cf
parent 45fdabd5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -870,6 +870,13 @@ public class ScreenshotView extends FrameLayout implements
    }

    void addQuickShareChip(Notification.Action quickShareAction) {
        if (mQuickShareChip != null) {
            mSmartChips.remove(mQuickShareChip);
            mActionsView.removeView(mQuickShareChip);
        }
        if (mPendingInteraction == PendingInteraction.QUICK_SHARE) {
            mPendingInteraction = null;
        }
        if (mPendingInteraction == null) {
            LayoutInflater inflater = LayoutInflater.from(mContext);
            mQuickShareChip = (OverlayActionChip) inflater.inflate(