From ba312cfbac64c0f192a70d4d906c4febc5e27787 Mon Sep 17 00:00:00 2001 From: rahulsainani Date: Tue, 19 Dec 2023 15:20:11 +0100 Subject: [PATCH] Bug 1870829 - Add review checker enabled attribute for custom targeting (cherry picked from commit f8a24b062839d6b02a664dd342cf6314c4143d6b) --- .../mozilla/fenix/messaging/CustomAttributeProvider.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/messaging/CustomAttributeProvider.kt b/app/src/main/java/org/mozilla/fenix/messaging/CustomAttributeProvider.kt index 4facd60db..621ef144c 100644 --- a/app/src/main/java/org/mozilla/fenix/messaging/CustomAttributeProvider.kt +++ b/app/src/main/java/org/mozilla/fenix/messaging/CustomAttributeProvider.kt @@ -35,11 +35,14 @@ object CustomAttributeProvider : JexlAttributeProvider { * will unlikely to targeted as expected. */ fun getCustomTargetingAttributes(context: Context): JSONObject { - val isFirstRun = context.settings().isFirstNimbusRun + val settings = context.settings() + val isFirstRun = settings.isFirstNimbusRun + val isReviewCheckerEnabled = settings.isReviewQualityCheckEnabled return JSONObject( mapOf( // By convention, we should use snake case. "is_first_run" to isFirstRun, + "is_review_checker_enabled" to isReviewCheckerEnabled, // This camelCase attribute is a boolean value represented as a string. // This is left for backwards compatibility. @@ -74,7 +77,8 @@ object CustomAttributeProvider : JexlAttributeProvider { UTM_TERM to settings.utmTerm, UTM_CONTENT to settings.utmContent, - "are_notifications_enabled" to NotificationManagerCompat.from(context).areNotificationsEnabledSafe(), + "are_notifications_enabled" to NotificationManagerCompat.from(context) + .areNotificationsEnabledSafe(), ), ) }