summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Bird <sbird@cyngn.com>2016-06-27 14:28:27 -0700
committerStephen Bird <sbird@cyngn.com>2016-07-05 17:50:38 -0700
commit9a01de33853d0f8ce1f91f5bf27718143c798cd6 (patch)
tree543bb3a5b4c0683910fe1f88617c395ea8b938d4 /src
parentf1946ebc37e7f7564fb9ce10b41f003ec82d331d (diff)
downloadandroid_packages_apps_Dialer-9a01de33853d0f8ce1f91f5bf27718143c798cd6.tar.gz
android_packages_apps_Dialer-9a01de33853d0f8ce1f91f5bf27718143c798cd6.tar.bz2
android_packages_apps_Dialer-9a01de33853d0f8ce1f91f5bf27718143c798cd6.zip
Set content intent to final button intent
Change-Id: I55435c26539ac444012ae2cb431e760420e96a30 Ticket: CD-687
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/discovery/DiscoveryEventHandler.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/com/android/dialer/discovery/DiscoveryEventHandler.java b/src/com/android/dialer/discovery/DiscoveryEventHandler.java
index c73038baf..9e5f23584 100644
--- a/src/com/android/dialer/discovery/DiscoveryEventHandler.java
+++ b/src/com/android/dialer/discovery/DiscoveryEventHandler.java
@@ -197,16 +197,21 @@ public class DiscoveryEventHandler {
NotificationNudge nn = new NotificationNudge(mKey,
Nudge.Type.IMMEDIATE, title, body);
- 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));
+
+ if (actions != null && actions.length != 0) {
+ for (Parcelable action : actions) {
+ NotificationNudge.Button button = (NotificationNudge.Button) action;
+ nn.addButton(button);
+ }
+ // 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);
}