Deprecate and add lint rule to limit the usage of daysSinceInstalled#8136
Merged
YoussefKeyrouz merged 1 commit intodevelopfrom Apr 7, 2026
Merged
Conversation
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
aitorvs
approved these changes
Apr 3, 2026
Collaborator
aitorvs
left a comment
There was a problem hiding this comment.
lgtm. Thanks for doing this
e831f5a to
4ada182
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Task/Issue URL: https://app.asana.com/1/137249556945/project/1212810093780571/task/1213839965185097?focus=true
Description
This PR deprecates
UserBrowserProperties.daysSinceInstalled()and add Lint rule to limit future usage (with baseline for current usages)TLDR
UserBrowserProperties.daysSinceInstalled()is a less reliable implementation of the existingPackageInfo.firstInstallTimeandPackageInfo.lastUpdateTime. It introduces a race condition that might break the logic if used on startup coroutines (e.g. if called fromRealDuckChat.cacheUserSettings()). So it’s better and more reliable to use the existing time android provides, or APIs that leverage those values such asAppBuildConfig.isNewInstall()Steps to test this PR (Optional, Can only be tested via code pull)
Note
Low Risk
Low risk: changes are limited to deprecating an API and adding a lint check with a baseline to prevent new call sites, with no runtime behavior changes unless callers migrate.
Overview
Deprecates
UserBrowserProperties.daysSinceInstalled()and steers callers toward more reliable install-time APIs.Adds a custom lint rule that flags new usages of
daysSinceInstalled()while allowing existing usages via a baseline, preventing further adoption without breaking current builds.Written by Cursor Bugbot for commit 4ada182. This will update automatically on new commits. Configure here.