Skip to content

Refactored the analytics#226

Merged
kcw-grunt merged 2 commits into
developfrom
techdebt/set-analytics-off
Apr 28, 2026
Merged

Refactored the analytics#226
kcw-grunt merged 2 commits into
developfrom
techdebt/set-analytics-off

Conversation

@kcw-grunt

@kcw-grunt kcw-grunt commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

📱 Description

This PR refactors the analytics implementation by consolidating event tracking, disabling main activity open events, and adjusting sync analytics thresholds. Firebase analytics collection is now controlled via build variant-specific resource values instead of hardcoded logic. The unlock event constant is simplified to be method-agnostic.

Platform

  • Android

🎯 Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔧 Refactoring (code change that neither fixes a bug nor adds a feature)
  • 📚 Documentation update
  • 🎨 UI/UX improvement
  • ⚡ Performance improvement
  • 🧪 Test addition or improvement

Modifications

  • app/build.gradle.kts: Added build variant-specific firebase_analytics_collection_enabled resource values (disabled for debug, enabled for release).
  • app/src/main/java/com/brainwallet/constants/BWConstants.kt: Removed unused _BW_MAIN_OPEN constant; renamed _20200217_DUWB to _20200217_DU for method-agnostic unlock event tracking.
  • app/src/main/java/com/brainwallet/data/repository/SyncAnalyticsRepository.kt: Changed sync completion threshold from totalDuration == 0L to totalDuration <= 8000L to filter out short syncs.
  • app/src/main/java/com/brainwallet/ui/BrainwalletActivity.kt: Removed _BW_MAIN_OPEN event logging from onCreate(); updated unlock event constant reference from _20200217_DUWB to _20200217_DU.
  • app/src/main/java/com/brainwallet/ui/screens/unlock/components/UnLockScreenBody.kt: Updated unlock event constant reference from _20200217_DUWB to _20200217_DU.
  • app/src/test/kotlin/com/brainwallet/consants/BWConstantsTest.kt: Removed _BW_MAIN_OPEN from test validation lists; updated constant references from _20200217_DUWB to _20200217_DU in both test methods.

Removals

  • Removed _BW_MAIN_OPEN constant and its logging call from BrainwalletActivity.onCreate() — main activity open events are no longer tracked.

📊 Statistics

  • Additions: 8 lines
  • Deletions: 12 lines
  • Files Changed: 6
  • Commits: 1

🎯 Reviewers

@kcw-grunt, @josikie

@kcw-grunt
kcw-grunt requested a review from josikie April 28, 2026 07:58
@kcw-grunt kcw-grunt self-assigned this Apr 28, 2026
@kcw-grunt kcw-grunt added techdebt Fixes that maintain the code android labels Apr 28, 2026
@gruntsoftware gruntsoftware deleted a comment from github-actions Bot Apr 28, 2026
@kcw-grunt
kcw-grunt merged commit 2025282 into develop Apr 28, 2026
2 checks passed
@kcw-grunt
kcw-grunt deleted the techdebt/set-analytics-off branch April 28, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

android techdebt Fixes that maintain the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant