Skip to content

Commit

Permalink
For mozilla-mobile#15368 - Adds telemetry for fullscreen, pip (mozill…
Browse files Browse the repository at this point in the history
  • Loading branch information
codrut-topliceanu committed Dec 15, 2020
1 parent 01db516 commit d0b09b7
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
26 changes: 26 additions & 0 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2932,6 +2932,32 @@ media_state:
notification_emails:
- fenix-core@mozilla.com
expires: "2021-08-01"
fullscreen:
type: event
description: |
Video set to fullscreen.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/15368
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/16833
data_sensitivity:
- interaction
notification_emails:
- fenix-core@mozilla.com
expires: "2021-08-01"
picture_in_picture:
type: event
description: |
Video set to picture in picture mode.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/15368
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/16833
data_sensitivity:
- interaction
notification_emails:
- fenix-core@mozilla.com
expires: "2021-08-01"

logins:
open_logins:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler,
}

final override fun onPictureInPictureModeChanged(enabled: Boolean) {
if (enabled) requireComponents.analytics.metrics.track(Event.MediaPictureInPictureState)
pipFeature?.onPictureInPictureModeChanged(enabled)
}

Expand Down Expand Up @@ -1217,6 +1218,8 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler,
browserToolbarView.expand()
// Without this, fullscreen has a margin at the top.
engineView.setVerticalClipping(0)

requireComponents.analytics.metrics.track(Event.MediaFullscreenState)
} else {
activity?.exitImmersiveModeIfNeeded()
(activity as? HomeActivity)?.let { activity ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ sealed class Event {
object MediaPlayState : Event()
object MediaPauseState : Event()
object MediaStopState : Event()
object MediaFullscreenState : Event()
object MediaPictureInPictureState : Event()
object InAppNotificationDownloadOpen : Event()
object InAppNotificationDownloadTryAgain : Event()
object NotificationDownloadCancel : Event()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,12 @@ private val Event.wrapper: EventWrapper<*>?
is Event.MediaStopState -> EventWrapper<NoExtraKeys>(
{ MediaState.stop.record(it) }
)
is Event.MediaFullscreenState -> EventWrapper<NoExtraKeys>(
{ MediaState.fullscreen.record(it) }
)
is Event.MediaPictureInPictureState -> EventWrapper<NoExtraKeys>(
{ MediaState.pictureInPicture.record(it) }
)
is Event.InAppNotificationDownloadOpen -> EventWrapper<NoExtraKeys>(
{ DownloadNotification.inAppOpen.record(it) }
)
Expand Down
2 changes: 2 additions & 0 deletions docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ The following metrics are added to the ping:
| master_password.migration |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Logins were successfully migrated using a master password. |[1](https://github.com/mozilla-mobile/fenix/pull/14468#issuecomment-684114534)||2021-03-01 |2 |
| media_notification.pause |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the pause icon on the media notification |[1](https://github.com/mozilla-mobile/fenix/pull/5520), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |
| media_notification.play |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the play icon on the media notification |[1](https://github.com/mozilla-mobile/fenix/pull/5520), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |
| media_state.fullscreen |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Video set to fullscreen. |[1](https://github.com/mozilla-mobile/fenix/issues/15368)||2021-08-01 |2 |
| media_state.pause |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Media playback was paused. |[1](https://github.com/mozilla-mobile/fenix/pull/6463), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |
| media_state.picture_in_picture |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Video set to picture in picture mode. |[1](https://github.com/mozilla-mobile/fenix/issues/15368)||2021-08-01 |2 |
| media_state.play |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Media started playing. |[1](https://github.com/mozilla-mobile/fenix/pull/6463), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |
| media_state.stop |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Media playback has ended. |[1](https://github.com/mozilla-mobile/fenix/pull/6463), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |
| onboarding.finish |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user taps starts browsing and ends the onboarding experience. |[1](https://github.com/mozilla-mobile/fenix/pull/11867), [2](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |
Expand Down

0 comments on commit d0b09b7

Please sign in to comment.