Add the m_app_return pixel, fired on every foreground return - #9502
Conversation
ca32998 to
376a28f
Compare
|
Privacy Review task: https://app.asana.com/0/69071770703008/1217524061930625 |
376a28f to
9cfb377
Compare
0d686e5 to
79e3ec7
Compare
f54ff6c to
1025f5e
Compare
1025f5e to
a9e17c5
Compare
79e3ec7 to
784e798
Compare
malmstein
left a comment
There was a problem hiding this comment.
Reviewed statically, stacked PR so no CI APK. CI is green, the two red checks on the PR page are a superseded cancelled run.
Well built. The once-per-foreground latch is clean, fired reset in the process-lifecycle onStop with the fire-restart resume explicitly consumed rather than swallowed forever, and pulling isLaunchByFireAction() out of EnqueuedPixelWorker removes a duplicate rather than adding one. toPixelLaunchSourceValue() being an exhaustive when over BrowserLaunchSource means a new launch source cannot silently fall into other. Checked every enum against emitted values: time_away_bucket, launch_source and after_inactivity_option all match, and the first_daily_count suffix generates the _count and _daily names the code fires. No PII, times bucketed.
Two non-blocking things inline, both about a declared value not matching what can actually be sent.
a9e17c5 to
5e38d86
Compare
784e798 to
b707ebc
Compare
b707ebc to
b2fa6f9
Compare
44612f1 to
dac42dc
Compare
b2fa6f9 to
c4fd050
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 5 total unresolved issues (including 3 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c4fd050. Configure here.
dac42dc to
4bd21d6
Compare
c4fd050 to
668fc71
Compare
668fc71 to
a770375
Compare


Task/Issue URL: https://app.asana.com/1/137249556945/task/1217515446826485?focus=true
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/project/481882893211075/task/1217382844057496?focus=true
API Proposals URL(s) (if applicable): None
Description
m_app_returnis a new pixel fired on every foreground transition. It’s the denominator for every "% of app opens" panel on the dashboard, and reports:time_away_bucketSettingsDataStore.lastSessionBackgroundTimestamp, bucketed (cold_start,lt_1m,1_5m,5_15m,15_30m,30_60m,gt_60m)exceeded_idle_thresholdIdleThresholdResolver.effectiveThresholdSeconds(), reported even when the after-idle feature is ineligibleidle_threshold_secondsIdleThresholdResolver.effectiveThresholdSeconds(settingsDataStore.userSelectedIdleThresholdSeconds)after_inactivity_optionShowOnAppLaunchOptionDataStore.optionFlow, mapped via the existingShowOnAppLaunchOption.getDailyPixelValue()feature_eligibleAndroidBrowserConfigFeature.showNTPAfterIdleReturn().isEnabled()unified_input_availableDuckAiFeatureState.nativeInputFieldEnabledtoggle_visibleDuckChatInputModeState.inputModeCapability == SEARCH_AND_DUCK_AIlaunch_sourceLaunchSourceTracker.launchSource()from various entry pointsSteps to test this PR
Attach logcat, filter for
Pixel sent:. You'll seem_app_return_countandm_app_return_dailyfire on every foreground.Cold start
time_away_bucket=cold_start,exceeded_idle_threshold=falseTime-away buckets
time_away_bucket=lt_1mtime_away_bucketmatches the elapsed buckettime_away_bucket=1_5mIdle threshold / after-inactivity option
exceeded_idle_threshold=falseand idle_threshold_seconds=60exceeded_idle_threshold=trueafter_inactivity_optionisnew_tab_page/last_opened_tab/specific_pageaccordinglyDuck.ai capability
toggle_visible=truetoggle_visible=falseFire-button suppression
not fire
m_app_return_count/_daily(same asml), only a subsequent real return doeslaunch_source
launch_source=standardlaunch_source=widgetlaunch_source=shortcutlaunch_source=urllaunch_source=otherUI changes
Note
Low Risk
Telemetry-only changes with no auth or data-handling impact; fire suppression mirrors existing app-launch pixel behavior.
Overview
Adds
m_app_return(m_app_return_count/m_app_return_daily) as the denominator for “% of app opens” analytics, fired on each foreground return without feature-flag gating.AppReturnPixelSendercentralizes firing: it buckets time away (cold_startthroughgt_60m), compares elapsed background time toIdleThresholdResolver, and attaches after-inactivity option, NTP-after-idle eligibility, Duck.ai input/toggle state, andlaunch_source. Fire-button process restarts are suppressed for the first resume in a session (same grace window asml), with per-foreground-session deduplication reset on processonStop.Entry points call
fireIfNeededfromLaunchBridgeActivity,IntentDispatcherActivity,BrowserActivity.onResume, andSystemSearchActivity.BrowserActivity.intentstampsLAUNCH_SOURCE_PIXEL_VALUEfromBrowserLaunchSource, and favorites widget bundles do the same.EnqueuedPixelWorkernow usesisLaunchByFireAction()from the sender instead of duplicating that logic.Reviewed by Cursor Bugbot for commit a770375. Bugbot is set up for automated code reviews on this repo. Configure here.