Closed Bug 1996806 Opened 8 months ago Closed 7 months ago

Refactor deleteAndQuit and remove casts to HomeActivity when calling the method.

Categories

(Firefox for Android :: General, task)

All
Android
task

Tracking

()

RESOLVED FIXED
147 Branch
Tracking Status
firefox147 --- fixed

People

(Reporter: mcarare, Assigned: mcarare)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [fxdroid][group6] )

Attachments

(1 file)

We should also centralizes the creation of the controller in the calling classes (BaseBrowserFragment, HomeFragment, MenuDialogFragment) and simplify the deleteAndQuit function.

The Bugbug bot thinks this bug should belong to the 'Firefox for Android::Tooling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Tooling
Component: Tooling → General
Summary: Rerfactor deleteAndQuit to improve readability and remove casts to Homeactivity when calling the method. → Refactor deleteAndQuit and remove casts to HomeActivity when calling the method.

This patch refactors the "delete browsing data on quit" feature to improve its structure, testability, and reliability.

The core changes include:

  • Refactoring deleteAndQuit into a new deleteDataAndQuit extension of DeleteBrowsingDataController
  • This new structure ensures that the app termination logic (e.g., finishAndRemoveTask()) is always called, even if data deletion fails.
  • The DeleteBrowsingDataController is now instantiated and passed down from UI entry points (HomeFragment, BaseBrowserFragment), making the feature's dependencies explicit and improving testability.
  • Added comprehensive unit tests for the deleteDataAndQuit logic covering various scenarios.
Blocks: 2002483
Pushed by mcarare@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c872c9e69a67 https://hg.mozilla.org/integration/autoland/rev/193ee3d42b12 Centralize and improve "delete data on quit" logic r=android-reviewers,jonalmeida
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 147 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: