For #26502: Add time group and private extras in history telemetry

This commit is contained in:
Roger Yang 2022-09-07 12:55:49 -04:00 committed by mergify[bot]
parent 9ed3e8e138
commit 30814884b5
2 changed files with 25 additions and 45 deletions

View File

@ -3238,37 +3238,30 @@ history:
type: boolean
description: |
True if the history item is synced from other devices otherwise false.
time_group:
type: string
description: |
What time group does the history item belongs to.
Possible values: [Today], [Yesterday], [ThisWeek], [ThisMonth],
[Older].
is_private:
type: boolean
description: |
True if the history item is opened in a private tab, otherwise false.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18178
- https://github.com/mozilla-mobile/fenix/issues/26502
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18261
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21038#issuecomment-906757301
- https://github.com/mozilla-mobile/fenix/pull/26503#issuecomment-1219761407
- https://github.com/mozilla-mobile/fenix/pull/26863
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
- mavduevskiy@mozilla.com
expires: never
metadata:
tags:
- History
opened_item_in_new_tab:
type: event
description: |
A user opened a history item in a new tab
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18178
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18261
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21038#issuecomment-906757301
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
- erichards@mozilla.com
- royang@mozilla.com
expires: never
metadata:
tags:
@ -3293,25 +3286,6 @@ history:
metadata:
tags:
- History
opened_item_in_private_tab:
type: event
description: |
A user opened a history item in a private tab
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18178
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18261
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21038#issuecomment-906757301
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
- erichards@mozilla.com
expires: never
metadata:
tags:
- History
opened_items_in_private_tabs:
type: event
description: |

View File

@ -333,25 +333,31 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
}
private fun openItem(item: History.Regular) {
GleanHistory.openedItem.record(GleanHistory.OpenedItemExtra(item.isRemote))
GleanHistory.openedItem.record(
GleanHistory.OpenedItemExtra(
isRemote = item.isRemote,
timeGroup = item.historyTimeGroup.toString(),
isPrivate = (activity as HomeActivity).browsingModeManager.mode == BrowsingMode.Private,
),
)
(activity as HomeActivity).openToBrowserAndLoad(
searchTermOrURL = item.url,
newTab = true,
from = BrowserDirection.FromHistory
from = BrowserDirection.FromHistory,
)
}
private fun displayDeleteTimeRange() {
DeleteConfirmationDialogFragment(
historyInteractor = historyInteractor
historyInteractor = historyInteractor,
).show(childFragmentManager, null)
}
private fun share(data: List<ShareData>) {
GleanHistory.shared.record(NoExtras())
val directions = HistoryFragmentDirections.actionGlobalShareFragment(
data = data.toTypedArray()
data = data.toTypedArray(),
)
navigateToHistoryFragment(directions)
}
@ -359,7 +365,7 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
private fun navigateToHistoryFragment(directions: NavDirections) {
findNavController().nav(
R.id.historyFragment,
directions
directions,
)
}
@ -371,7 +377,7 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
}
internal class DeleteConfirmationDialogFragment(
private val historyInteractor: HistoryInteractor
private val historyInteractor: HistoryInteractor,
) : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog =
AlertDialog.Builder(requireContext()).apply {