Skip to content

refactor(AnkiDroidApp): extract setup code#21156

Open
david-allison wants to merge 4 commits into
ankidroid:mainfrom
david-allison:setup-2
Open

refactor(AnkiDroidApp): extract setup code#21156
david-allison wants to merge 4 commits into
ankidroid:mainfrom
david-allison:setup-2

Conversation

@david-allison
Copy link
Copy Markdown
Member

Purpose / Description

Before we handle setup failures, we should break AnkiDroidApp into initializing features, so we can determine whether a feature failing should be fatal

Fixes

Approach

Simple method extraction + use of setup

How Has This Been Tested?

See the linked PR

executed setupContextMenus in 470.125us
executed makeBackendUsable in 143.208us
Creating notification channel with id/name: General Notifications/AnkiDroid
Creating notification channel with id/name: Synchronization/Synchronization
Creating notification channel with id/name: Review Reminders/Review Reminders
AnkiDroidApp: Starting Services
executed setupNotifications in 3.405208ms
executed initializeAnkiDroidDirectory in 1.079ms
listening for rollover events
executed setupLifecycleLogging in 108.291us

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Copy link
Copy Markdown
Contributor

@criticalAY criticalAY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏼, (CI should be green)

@criticalAY criticalAY added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels May 27, 2026
* extract to a method: 'setupContextMenus'
* document a little
* makeBackendUsable - this is called externally
  so setup should not be in the method
* initializeAnkiDroidDirectory
* extract + log time to execute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Second Approval Has one approval, one more approval to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants