remove the CTA button "Learn More" on ROW small notification
Fixes: 264322731
Test: Manual
Change-Id: I13585fd564c2c8a51dc50cbf8ed46ae3b8e57047
diff --git a/adservices/apk/java/com/android/adservices/ui/notifications/ConsentNotificationTrigger.java b/adservices/apk/java/com/android/adservices/ui/notifications/ConsentNotificationTrigger.java
index 42e6879..c57e57e 100644
--- a/adservices/apk/java/com/android/adservices/ui/notifications/ConsentNotificationTrigger.java
+++ b/adservices/apk/java/com/android/adservices/ui/notifications/ConsentNotificationTrigger.java
@@ -157,35 +157,35 @@
.bigText(
isEuDevice
? context.getString(
- R.string.notificationUI_notification_content_eu)
+ R.string.notificationUI_notification_ga_content_eu)
: context.getString(
- R.string.notificationUI_notification_content));
- return new NotificationCompat.Builder(context, CHANNEL_ID)
- .setSmallIcon(R.drawable.ic_info_icon)
- .setContentTitle(
- context.getString(
- isEuDevice
- ? R.string.notificationUI_notification_ga_title_eu
- : R.string.notificationUI_notification_ga_title))
- .setContentText(
- context.getString(
- isEuDevice
- ? R.string.notificationUI_notification_ga_content_eu
- : R.string.notificationUI_notification_ga_content))
- .setStyle(textStyle)
- .setPriority(NOTIFICATION_PRIORITY)
- .setAutoCancel(true)
- .setContentIntent(pendingIntent)
- .addAction(
- isEuDevice
- ? R.string.notificationUI_notification_cta_eu
- : R.string.notificationUI_notification_cta,
- context.getString(
- isEuDevice
- ? R.string.notificationUI_notification_cta_eu
- : R.string.notificationUI_notification_cta),
- pendingIntent)
- .build();
+ R.string.notificationUI_notification_ga_content));
+ NotificationCompat.Builder notification =
+ new NotificationCompat.Builder(context, CHANNEL_ID)
+ .setSmallIcon(R.drawable.ic_info_icon)
+ .setContentTitle(
+ context.getString(
+ isEuDevice
+ ? R.string.notificationUI_notification_ga_title_eu
+ : R.string.notificationUI_notification_ga_title))
+ .setContentText(
+ context.getString(
+ isEuDevice
+ ? R.string.notificationUI_notification_ga_content_eu
+ : R.string.notificationUI_notification_ga_content))
+ .setStyle(textStyle)
+ .setPriority(NOTIFICATION_PRIORITY)
+ .setAutoCancel(true)
+ .setContentIntent(pendingIntent);
+ // EU needs a "View Details" CTA
+ return isEuDevice
+ ? notification
+ .addAction(
+ R.string.notificationUI_notification_ga_cta_eu,
+ context.getString(R.string.notificationUI_notification_ga_cta_eu),
+ pendingIntent)
+ .build()
+ : notification.build();
}
/**
diff --git a/adservices/apk/tests/src/com/android/adservices/ui/notifications/ConsentNotificationTriggerTest.java b/adservices/apk/tests/src/com/android/adservices/ui/notifications/ConsentNotificationTriggerTest.java
index 64a6241..6887a1a 100644
--- a/adservices/apk/tests/src/com/android/adservices/ui/notifications/ConsentNotificationTriggerTest.java
+++ b/adservices/apk/tests/src/com/android/adservices/ui/notifications/ConsentNotificationTriggerTest.java
@@ -315,6 +315,7 @@
.isEqualTo(expectedContent);
assertThat(Notification.FLAG_ONGOING_EVENT & notification.flags).isEqualTo(0);
assertThat(Notification.FLAG_NO_CLEAR & notification.flags).isEqualTo(0);
+ assertThat(notification.actions).isNull();
} finally {
mStaticMockSession.finishMocking();
}