Skip to content

refactor(AnkiDroidApp): extract setup code#21156

Merged
lukstbit merged 4 commits into
ankidroid:mainfrom
david-allison:setup-2
May 30, 2026
Merged

refactor(AnkiDroidApp): extract setup code#21156
lukstbit merged 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

@criticalAY criticalAY left a comment

Copy link
Copy Markdown
Contributor

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

@lukstbit lukstbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@lukstbit lukstbit added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels May 30, 2026
@lukstbit lukstbit added this pull request to the merge queue May 30, 2026
Merged via the queue into ankidroid:main with commit 3eef8cd May 30, 2026
20 checks passed
@github-actions github-actions Bot added this to the 2.25 release milestone May 30, 2026
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label May 30, 2026
@david-allison david-allison deleted the setup-2 branch May 30, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants