Bug 1871548 - Add telemetry for Open PDF in Fenix
This commit is contained in:
committed by
Ryan VanderMeulen
parent
481f256abc
commit
2bea4582fd
@@ -113,3 +113,5 @@ fun Intent.toSafeIntent(): SafeIntent = SafeIntent(this)
|
||||
|
||||
const val EXTRA_ACTIVITY_REFERRER_PACKAGE = "activity_referrer_package"
|
||||
const val EXTRA_ACTIVITY_REFERRER_CATEGORY = "activity_referrer_category"
|
||||
|
||||
const val INTENT_TYPE_PDF = "application/pdf"
|
||||
|
||||
@@ -376,6 +376,27 @@ events:
|
||||
metadata:
|
||||
tags:
|
||||
- PrivateBrowsing
|
||||
opened_ext_pdf:
|
||||
type: event
|
||||
description: |
|
||||
A user opened a PDF with Fenix from another app
|
||||
extra_keys:
|
||||
referrer_is_fenix:
|
||||
description: |
|
||||
If the PDF was opened from Fenix itself (for example from the Download notification)
|
||||
type: boolean
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1871548
|
||||
data_reviews:
|
||||
- https://github.com/mozilla-mobile/firefox-android/pull/4940
|
||||
data_sensitivity:
|
||||
- interaction
|
||||
notification_emails:
|
||||
- android-probes@mozilla.com
|
||||
- mcastelluccio@mozilla.com
|
||||
- calixte@mozilla.com
|
||||
- sylvestre@mozilla.com
|
||||
expires: never
|
||||
synced_tab_opened:
|
||||
type: event
|
||||
description: |
|
||||
|
||||
@@ -15,6 +15,7 @@ import mozilla.components.feature.intent.ext.sanitize
|
||||
import mozilla.components.feature.intent.processing.IntentProcessor
|
||||
import mozilla.components.support.utils.EXTRA_ACTIVITY_REFERRER_CATEGORY
|
||||
import mozilla.components.support.utils.EXTRA_ACTIVITY_REFERRER_PACKAGE
|
||||
import mozilla.components.support.utils.INTENT_TYPE_PDF
|
||||
import mozilla.components.support.utils.ext.getApplicationInfoCompat
|
||||
import org.mozilla.fenix.GleanMetrics.Events
|
||||
import org.mozilla.fenix.HomeActivity.Companion.PRIVATE_BROWSING_MODE
|
||||
@@ -73,6 +74,12 @@ class IntentReceiverActivity : Activity() {
|
||||
|
||||
addReferrerInformation(intent)
|
||||
|
||||
if (intent.type == INTENT_TYPE_PDF) {
|
||||
val referrerIsFenix =
|
||||
intent.getStringExtra(EXTRA_ACTIVITY_REFERRER_PACKAGE) == this.packageName
|
||||
Events.openedExtPdf.record(Events.OpenedExtPdfExtra(referrerIsFenix))
|
||||
}
|
||||
|
||||
val processor = getIntentProcessors(private).firstOrNull { it.process(intent) }
|
||||
val intentProcessorType = components.intentProcessors.getType(processor)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user