Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 57497ec

Browse files
authored
add background as a extra parameter to telemetry (#792)
1 parent c2738e2 commit 57497ec

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

app/src/main/java/org/mozilla/focus/notification/NotificationActionBroadcastReceiver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void onReceive(Context context, Intent intent) {
5656

5757
String messageId = bundle.getString(IntentUtils.EXTRA_NOTIFICATION_MESSAGE_ID, "");
5858
String link = bundle.getString(IntentUtils.EXTRA_NOTIFICATION_LINK, "");
59-
TelemetryWrapper.openNotification(link, messageId);
59+
TelemetryWrapper.openNotification(link, messageId, false);
6060

6161
} else if (bundle.getBoolean(IntentUtils.EXTRA_NOTIFICATION_ACTION_RATE_STAR)) {
6262

app/src/main/java/org/mozilla/focus/telemetry/TelemetryWrapper.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ object TelemetryWrapper {
287287
const val TASK = "task"
288288
const val FINISHED = "finished"
289289
const val ITEM_NAME = "item_name"
290+
const val BACKGROUND = "background"
290291
}
291292

292293
object Extra_Value {
@@ -2501,13 +2502,15 @@ object TelemetryWrapper {
25012502
value = "",
25022503
extras = [
25032504
TelemetryExtra(name = Extra.LINK, value = "${Extra_Value.URL},${Extra_Value.DEEPLINK},null"),
2504-
TelemetryExtra(name = Extra.MESSAGE_ID, value = "messageId")
2505+
TelemetryExtra(name = Extra.MESSAGE_ID, value = "messageId"),
2506+
TelemetryExtra(name = Extra.BACKGROUND, value = "true|false")
25052507
])
25062508
@JvmStatic
2507-
fun openNotification(link: String?, messageId: String?) {
2509+
fun openNotification(link: String?, messageId: String?, background: Boolean) {
25082510
EventBuilder(Category.ACTION, Method.OPEN, Object.NOTIFICATION)
25092511
.extra(Extra.LINK, link ?: "null")
25102512
.extra(Extra.MESSAGE_ID, messageId ?: "null")
2513+
.extra(Extra.BACKGROUND, background.toString())
25112514
.queue()
25122515
}
25132516

app/src/main/java/org/mozilla/rocket/component/LaunchIntentDispatcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class LaunchIntentDispatcher {
153153
val isFromPush = pushMessageId != null
154154
if (isFromPush) {
155155
val link = parseLink(intent)
156-
TelemetryWrapper.openNotification(link, pushMessageId)
156+
TelemetryWrapper.openNotification(link, pushMessageId, true)
157157
}
158158
}
159159

0 commit comments

Comments
 (0)