@ -159,25 +159,25 @@ internal class ReleaseMetricController(
@Suppress ( " LongMethod " )
@Suppress ( " LongMethod " )
private fun Fact . toEvent ( ) : Event ? = when {
private fun Fact . toEvent ( ) : Event ? = when {
Component . FEATURE _PROMPTS to LoginDialogFacts . Items . DISPLAY -> Event . LoginDialogPromptDisplayed
Component . FEATURE _PROMPTS == component && LoginDialogFacts . Items . DISPLAY == item -> Event . LoginDialogPromptDisplayed
Component . FEATURE _PROMPTS to LoginDialogFacts . Items . CANCEL -> Event . LoginDialogPromptCancelled
Component . FEATURE _PROMPTS == component && LoginDialogFacts . Items . CANCEL == item -> Event . LoginDialogPromptCancelled
Component . FEATURE _PROMPTS to LoginDialogFacts . Items . NEVER _SAVE -> Event . LoginDialogPromptNeverSave
Component . FEATURE _PROMPTS == component && LoginDialogFacts . Items . NEVER _SAVE == item -> Event . LoginDialogPromptNeverSave
Component . FEATURE _PROMPTS to LoginDialogFacts . Items . SAVE -> Event . LoginDialogPromptSave
Component . FEATURE _PROMPTS == component && LoginDialogFacts . Items . SAVE == item -> Event . LoginDialogPromptSave
Component . FEATURE _PROMPTS to CreditCardAutofillDialogFacts . Items . AUTOFILL _CREDIT _CARD _FORM _DETECTED ->
Component . FEATURE _PROMPTS == component && CreditCardAutofillDialogFacts . Items . AUTOFILL _CREDIT _CARD _FORM _DETECTED == item ->
Event . CreditCardFormDetected
Event . CreditCardFormDetected
Component . FEATURE _PROMPTS to CreditCardAutofillDialogFacts . Items . AUTOFILL _CREDIT _CARD _SUCCESS ->
Component . FEATURE _PROMPTS == component && CreditCardAutofillDialogFacts . Items . AUTOFILL _CREDIT _CARD _SUCCESS == item ->
Event . CreditCardAutofilled
Event . CreditCardAutofilled
Component . FEATURE _PROMPTS to CreditCardAutofillDialogFacts . Items . AUTOFILL _CREDIT _CARD _PROMPT _SHOWN ->
Component . FEATURE _PROMPTS == component && CreditCardAutofillDialogFacts . Items . AUTOFILL _CREDIT _CARD _PROMPT _SHOWN == item ->
Event . CreditCardAutofillPromptShown
Event . CreditCardAutofillPromptShown
Component . FEATURE _PROMPTS to CreditCardAutofillDialogFacts . Items . AUTOFILL _CREDIT _CARD _PROMPT _EXPANDED ->
Component . FEATURE _PROMPTS == component && CreditCardAutofillDialogFacts . Items . AUTOFILL _CREDIT _CARD _PROMPT _EXPANDED == item ->
Event . CreditCardAutofillPromptExpanded
Event . CreditCardAutofillPromptExpanded
Component . FEATURE _PROMPTS to CreditCardAutofillDialogFacts . Items . AUTOFILL _CREDIT _CARD _PROMPT _DISMISSED ->
Component . FEATURE _PROMPTS == component && CreditCardAutofillDialogFacts . Items . AUTOFILL _CREDIT _CARD _PROMPT _DISMISSED == item ->
Event . CreditCardAutofillPromptDismissed
Event . CreditCardAutofillPromptDismissed
Component . FEATURE _CONTEXTMENU to ContextMenuFacts . Items . ITEM -> {
Component . FEATURE _CONTEXTMENU == component && ContextMenuFacts . Items . ITEM == item -> {
metadata ?. get ( " item " ) ?. let { Event . ContextMenuItemTapped . create ( it . toString ( ) ) }
metadata ?. get ( " item " ) ?. let { Event . ContextMenuItemTapped . create ( it . toString ( ) ) }
}
}
Component . FEATURE _CONTEXTMENU to ContextMenuFacts . Items . TEXT _SELECTION _OPTION -> {
Component . FEATURE _CONTEXTMENU == component && ContextMenuFacts . Items . TEXT _SELECTION _OPTION == item -> {
when ( metadata ?. get ( " textSelectionOption " ) ?. toString ( ) ) {
when ( metadata ?. get ( " textSelectionOption " ) ?. toString ( ) ) {
CONTEXT _MENU _COPY -> Event . ContextMenuCopyTapped
CONTEXT _MENU _COPY -> Event . ContextMenuCopyTapped
CONTEXT _MENU _SEARCH , CONTEXT _MENU _SEARCH _PRIVATELY -> Event . ContextMenuSearchTapped
CONTEXT _MENU _SEARCH , CONTEXT _MENU _SEARCH _PRIVATELY -> Event . ContextMenuSearchTapped
@ -187,23 +187,23 @@ internal class ReleaseMetricController(
}
}
}
}
Component . BROWSER _TOOLBAR to ToolbarFacts . Items . MENU -> {
Component . BROWSER _TOOLBAR == component && ToolbarFacts . Items . MENU == item -> {
metadata ?. get ( " customTab " ) ?. let { Event . CustomTabsMenuOpened } ?: Event . ToolbarMenuShown
metadata ?. get ( " customTab " ) ?. let { Event . CustomTabsMenuOpened } ?: Event . ToolbarMenuShown
}
}
Component . BROWSER _MENU to BrowserMenuFacts . Items . WEB _EXTENSION _MENU _ITEM -> {
Component . BROWSER _MENU == component && BrowserMenuFacts . Items . WEB _EXTENSION _MENU _ITEM == item -> {
metadata ?. get ( " id " ) ?. let { Event . AddonsOpenInToolbarMenu ( it . toString ( ) ) }
metadata ?. get ( " id " ) ?. let { Event . AddonsOpenInToolbarMenu ( it . toString ( ) ) }
}
}
Component . FEATURE _CUSTOMTABS to CustomTabsFacts . Items . CLOSE -> Event . CustomTabsClosed
Component . FEATURE _CUSTOMTABS == component && CustomTabsFacts . Items . CLOSE == item -> Event . CustomTabsClosed
Component . FEATURE _CUSTOMTABS to CustomTabsFacts . Items . ACTION _BUTTON -> Event . CustomTabsActionTapped
Component . FEATURE _CUSTOMTABS == component && CustomTabsFacts . Items . ACTION _BUTTON == item -> Event . CustomTabsActionTapped
Component . FEATURE _MEDIA to MediaFacts . Items . NOTIFICATION -> {
Component . FEATURE _MEDIA == component && MediaFacts . Items . NOTIFICATION == item -> {
when ( action ) {
when ( action ) {
Action . PLAY -> Event . NotificationMediaPlay
Action . PLAY -> Event . NotificationMediaPlay
Action . PAUSE -> Event . NotificationMediaPause
Action . PAUSE -> Event . NotificationMediaPause
else -> null
else -> null
}
}
}
}
Component . FEATURE _MEDIA to MediaFacts . Items . STATE -> {
Component . FEATURE _MEDIA == component && MediaFacts . Items . STATE == item -> {
when ( action ) {
when ( action ) {
Action . PLAY -> Event . MediaPlayState
Action . PLAY -> Event . MediaPlayState
Action . PAUSE -> Event . MediaPauseState
Action . PAUSE -> Event . MediaPauseState
@ -211,7 +211,7 @@ internal class ReleaseMetricController(
else -> null
else -> null
}
}
}
}
Component . SUPPORT _WEBEXTENSIONS to WebExtensionFacts . Items . WEB _EXTENSIONS _INITIALIZED -> {
Component . SUPPORT _WEBEXTENSIONS == component && WebExtensionFacts . Items . WEB _EXTENSIONS _INITIALIZED == item -> {
metadata ?. get ( " installed " ) ?. let { installedAddons ->
metadata ?. get ( " installed " ) ?. let { installedAddons ->
if ( installedAddons is List < * > ) {
if ( installedAddons is List < * > ) {
settings . installedAddonsCount = installedAddons . size
settings . installedAddonsCount = installedAddons . size
@ -228,7 +228,7 @@ internal class ReleaseMetricController(
null
null
}
}
Component . COMPOSE_AWESOMEBAR to ComposeAwesomeBarFacts . Items . PROVIDER _DURATION -> {
Component . BROWSER_AWESOMEBAR == component && ComposeAwesomeBarFacts . Items . PROVIDER _DURATION == item -> {
metadata ?. get ( ComposeAwesomeBarFacts . MetadataKeys . DURATION _PAIR ) ?. let { providerTiming ->
metadata ?. get ( ComposeAwesomeBarFacts . MetadataKeys . DURATION _PAIR ) ?. let { providerTiming ->
require ( providerTiming is Pair < * , * > ) { " Expected providerTiming to be a Pair " }
require ( providerTiming is Pair < * , * > ) { " Expected providerTiming to be a Pair " }
when ( val provider = providerTiming . first as AwesomeBar . SuggestionProvider ) {
when ( val provider = providerTiming . first as AwesomeBar . SuggestionProvider ) {
@ -247,13 +247,13 @@ internal class ReleaseMetricController(
}
}
null
null
}
}
Component . FEATURE _PWA to ProgressiveWebAppFacts . Items . HOMESCREEN _ICON _TAP -> {
Component . FEATURE _PWA == component && ProgressiveWebAppFacts . Items . HOMESCREEN _ICON _TAP == item -> {
Event . ProgressiveWebAppOpenFromHomescreenTap
Event . ProgressiveWebAppOpenFromHomescreenTap
}
}
Component . FEATURE _PWA to ProgressiveWebAppFacts . Items . INSTALL _SHORTCUT -> {
Component . FEATURE _PWA == component && ProgressiveWebAppFacts . Items . INSTALL _SHORTCUT == item -> {
Event . ProgressiveWebAppInstallAsShortcut
Event . ProgressiveWebAppInstallAsShortcut
}
}
Component . FEATURE _TOP _SITES to TopSitesFacts . Items . COUNT -> {
Component . FEATURE _TOP _SITES == component && TopSitesFacts . Items . COUNT == item -> {
value ?. let {
value ?. let {
var count = 0
var count = 0
try {
try {
@ -266,59 +266,59 @@ internal class ReleaseMetricController(
}
}
null
null
}
}
Component . FEATURE _SYNCEDTABS to SyncedTabsFacts . Items . SYNCED _TABS _SUGGESTION _CLICKED -> {
Component . FEATURE _SYNCEDTABS == component && SyncedTabsFacts . Items . SYNCED _TABS _SUGGESTION _CLICKED == item -> {
Event . SyncedTabSuggestionClicked
Event . SyncedTabSuggestionClicked
}
}
Component . FEATURE _AWESOMEBAR to AwesomeBarFacts . Items . BOOKMARK _SUGGESTION _CLICKED -> {
Component . FEATURE _AWESOMEBAR == component && AwesomeBarFacts . Items . BOOKMARK _SUGGESTION _CLICKED == item -> {
Event . BookmarkSuggestionClicked
Event . BookmarkSuggestionClicked
}
}
Component . FEATURE _AWESOMEBAR to AwesomeBarFacts . Items . CLIPBOARD _SUGGESTION _CLICKED -> {
Component . FEATURE _AWESOMEBAR == component && AwesomeBarFacts . Items . CLIPBOARD _SUGGESTION _CLICKED == item -> {
Event . ClipboardSuggestionClicked
Event . ClipboardSuggestionClicked
}
}
Component . FEATURE _AWESOMEBAR to AwesomeBarFacts . Items . HISTORY _SUGGESTION _CLICKED -> {
Component . FEATURE _AWESOMEBAR == component && AwesomeBarFacts . Items . HISTORY _SUGGESTION _CLICKED == item -> {
Event . HistorySuggestionClicked
Event . HistorySuggestionClicked
}
}
Component . FEATURE _AWESOMEBAR to AwesomeBarFacts . Items . SEARCH _ACTION _CLICKED -> {
Component . FEATURE _AWESOMEBAR == component && AwesomeBarFacts . Items . SEARCH _ACTION _CLICKED == item -> {
Event . SearchActionClicked
Event . SearchActionClicked
}
}
Component . FEATURE _AWESOMEBAR to AwesomeBarFacts . Items . SEARCH _SUGGESTION _CLICKED -> {
Component . FEATURE _AWESOMEBAR == component && AwesomeBarFacts . Items . SEARCH _SUGGESTION _CLICKED == item -> {
Event . SearchSuggestionClicked
Event . SearchSuggestionClicked
}
}
Component . FEATURE _AWESOMEBAR to AwesomeBarFacts . Items . OPENED _TAB _SUGGESTION _CLICKED -> {
Component . FEATURE _AWESOMEBAR == component && AwesomeBarFacts . Items . OPENED _TAB _SUGGESTION _CLICKED == item -> {
Event . OpenedTabSuggestionClicked
Event . OpenedTabSuggestionClicked
}
}
Component . LIB _DATAPROTECT to SecurePrefsReliabilityExperiment . Companion . Actions . EXPERIMENT -> {
Component . LIB _DATAPROTECT == component && SecurePrefsReliabilityExperiment . Companion . Actions . EXPERIMENT == item -> {
Event . SecurePrefsExperimentFailure ( metadata ?. get ( " javaClass " ) as String ? ?: " null " )
Event . SecurePrefsExperimentFailure ( metadata ?. get ( " javaClass " ) as String ? ?: " null " )
}
}
Component . LIB _DATAPROTECT to SecurePrefsReliabilityExperiment . Companion . Actions . GET -> {
Component . LIB _DATAPROTECT == component && SecurePrefsReliabilityExperiment . Companion . Actions . GET == item -> {
if ( SecurePrefsReliabilityExperiment . Companion . Values . FAIL . v == value ?. toInt ( ) ) {
if ( SecurePrefsReliabilityExperiment . Companion . Values . FAIL . v == value ?. toInt ( ) ) {
Event . SecurePrefsGetFailure ( metadata ?. get ( " javaClass " ) as String ? ?: " null " )
Event . SecurePrefsGetFailure ( metadata ?. get ( " javaClass " ) as String ? ?: " null " )
} else {
} else {
Event . SecurePrefsGetSuccess ( value ?: " " )
Event . SecurePrefsGetSuccess ( value ?: " " )
}
}
}
}
Component . LIB _DATAPROTECT to SecurePrefsReliabilityExperiment . Companion . Actions . WRITE -> {
Component . LIB _DATAPROTECT == component && SecurePrefsReliabilityExperiment . Companion . Actions . WRITE == item -> {
if ( SecurePrefsReliabilityExperiment . Companion . Values . FAIL . v == value ?. toInt ( ) ) {
if ( SecurePrefsReliabilityExperiment . Companion . Values . FAIL . v == value ?. toInt ( ) ) {
Event . SecurePrefsWriteFailure ( metadata ?. get ( " javaClass " ) as String ? ?: " null " )
Event . SecurePrefsWriteFailure ( metadata ?. get ( " javaClass " ) as String ? ?: " null " )
} else {
} else {
Event . SecurePrefsWriteSuccess
Event . SecurePrefsWriteSuccess
}
}
}
}
Component . LIB _DATAPROTECT to SecurePrefsReliabilityExperiment . Companion . Actions . RESET -> {
Component . LIB _DATAPROTECT == component && SecurePrefsReliabilityExperiment . Companion . Actions . RESET == item -> {
Event . SecurePrefsReset
Event . SecurePrefsReset
}
}
Component . FEATURE _SEARCH to AdsTelemetry . SERP _ADD _CLICKED -> {
Component . FEATURE _SEARCH == component && AdsTelemetry . SERP _ADD _CLICKED == item -> {
Event . SearchAdClicked ( value !! )
Event . SearchAdClicked ( value !! )
}
}
Component . FEATURE _SEARCH to AdsTelemetry . SERP _SHOWN _WITH _ADDS -> {
Component . FEATURE _SEARCH == component && AdsTelemetry . SERP _SHOWN _WITH _ADDS == item -> {
Event . SearchWithAds ( value !! )
Event . SearchWithAds ( value !! )
}
}
Component . FEATURE _SEARCH to InContentTelemetry . IN _CONTENT _SEARCH -> {
Component . FEATURE _SEARCH == component && InContentTelemetry . IN _CONTENT _SEARCH == item -> {
Event . SearchInContent ( value !! )
Event . SearchInContent ( value !! )
}
}
Component . FEATURE _AUTOFILL to AutofillFacts . Items . AUTOFILL _REQUEST -> {
Component . FEATURE _AUTOFILL == component && AutofillFacts . Items . AUTOFILL _REQUEST == item -> {
val hasMatchingLogins = metadata ?. get ( AutofillFacts . Metadata . HAS _MATCHING _LOGINS ) as Boolean ?
val hasMatchingLogins = metadata ?. get ( AutofillFacts . Metadata . HAS _MATCHING _LOGINS ) as Boolean ?
if ( hasMatchingLogins == true ) {
if ( hasMatchingLogins == true ) {
Event . AndroidAutofillRequestWithLogins
Event . AndroidAutofillRequestWithLogins
@ -326,21 +326,21 @@ internal class ReleaseMetricController(
Event . AndroidAutofillRequestWithoutLogins
Event . AndroidAutofillRequestWithoutLogins
}
}
}
}
Component . FEATURE _AUTOFILL to AutofillFacts . Items . AUTOFILL _SEARCH -> {
Component . FEATURE _AUTOFILL == component && AutofillFacts . Items . AUTOFILL _SEARCH == item -> {
if ( action == Action . SELECT ) {
if ( action == Action . SELECT ) {
Event . AndroidAutofillSearchItemSelected
Event . AndroidAutofillSearchItemSelected
} else {
} else {
Event . AndroidAutofillSearchDisplayed
Event . AndroidAutofillSearchDisplayed
}
}
}
}
Component . FEATURE _AUTOFILL to AutofillFacts . Items . AUTOFILL _LOCK -> {
Component . FEATURE _AUTOFILL == component && AutofillFacts . Items . AUTOFILL _LOCK == item -> {
if ( action == Action . CONFIRM ) {
if ( action == Action . CONFIRM ) {
Event . AndroidAutofillUnlockSuccessful
Event . AndroidAutofillUnlockSuccessful
} else {
} else {
Event . AndroidAutofillUnlockCanceled
Event . AndroidAutofillUnlockCanceled
}
}
}
}
Component . FEATURE _AUTOFILL to AutofillFacts . Items . AUTOFILL _CONFIRMATION -> {
Component . FEATURE _AUTOFILL == component && AutofillFacts . Items . AUTOFILL _CONFIRMATION == item -> {
if ( action == Action . CONFIRM ) {
if ( action == Action . CONFIRM ) {
Event . AndroidAutofillConfirmationSuccessful
Event . AndroidAutofillConfirmationSuccessful
} else {
} else {