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

Commit d3b7e002 authored by Stephen Bird's avatar Stephen Bird Committed by Gerrit Code Review
Browse files

Set content intent to final button intent

Change-Id: I55435c26539ac444012ae2cb431e760420e96a30
Ticket: CD-687
(cherry picked from commit 9a01de33)
parent dcf80e17
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -197,16 +197,21 @@ public class DiscoveryEventHandler {
        NotificationNudge nn = new NotificationNudge(mKey,
                Nudge.Type.IMMEDIATE, title, body);

        nn.setLargeIcon(notificationIcon);
        nn.setOnShowIntent(buildActionIntent(body,
                DiscoverySignalReceiver.DISCOVERY_NUDGE_SHOWN, component));

        if (actions != null && actions.length != 0) {
            for (Parcelable action : actions) {
                NotificationNudge.Button button = (NotificationNudge.Button) action;
                nn.addButton(button);
            }

        nn.setLargeIcon(notificationIcon);
        nn.setOnShowIntent(buildActionIntent(body,
                DiscoverySignalReceiver.DISCOVERY_NUDGE_SHOWN, component));
        nn.setContentIntent(buildActionIntent(body,
                DiscoverySignalReceiver.DISCOVERY_NUDGE_DISMISS, component));
            // Note: the incall tech spec requires that the final action (right most visually)
            // button must always be the affirmative action.
            NotificationNudge.Button bodyButton
                    = (NotificationNudge.Button) actions[actions.length - 1];
            nn.setContentIntent(bodyButton.getOnClickIntent());
        }

        DiscoveryManagerServices.DiscoveryManagerApi.publishNudge(mClient, nn);
    }