Closed Bug 1979823 Opened 11 months ago Closed 11 months ago

Move PrivateBrowsingLockFeature initialization to the HomeActivity

Categories

(Firefox for Android :: Privacy, task)

All
Android
task

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: jonalmeida, Assigned: jonalmeida)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

The PrivateBrowsingLockFeature is meant to live the lifetime of the host activity (HomeActivity) which is where it is also initialized, but we keep it in Components.kt which makes the feature live the lifetime of the application.

Lets move the initialization code to where it currently happens to avoid side-effects of instances living longer than they should.

The PrivateBrowsingLockFeature lives longer that the activity it is
attached too, so lets keep the scope the same.

Added a PrivateBrowsingLockUseCases to follow our use case patterns
that replaces the onSuccessfulAuthentication which doesn't need to be
coupled together since it only dispatches to the AppStore.

The PrivateBrowsingLockFeature lives longer that the activity it is
attached too, so lets keep the scope the same.

Added a PrivateBrowsingLockUseCases to follow our use case patterns
that replaces the onSuccessfulAuthentication which doesn't need to be
coupled together since it only dispatches to the AppStore.

Attachment #9503501 - Attachment is obsolete: true

Now that we aren't using the application instance of the feature to hold
our state, we should read the AppStore value during init similar to our
persisted feature enabled flag.

We don't really need to check whether there are private tabs AND
isPrivateScreenLocked because private tabs are never persisted, but I
left that original logic in there because it doesn't seem to hurt to
have it.

Blocks: 1961133
Pushed by jonalmeida942@gmail.com: https://github.com/mozilla-firefox/firefox/commit/a809809198bc https://hg.mozilla.org/integration/autoland/rev/7f6b6ba39c8e Move PrivateBrowsingLockFeature constructor to where it happens r=twhite,android-reviewers https://github.com/mozilla-firefox/firefox/commit/00805e51211a https://hg.mozilla.org/integration/autoland/rev/e3e1d1b06d94 Update tests in PrivateBrowsingLockFeatureTest using UseCase r=twhite,android-reviewers https://github.com/mozilla-firefox/firefox/commit/b179442bef84 https://hg.mozilla.org/integration/autoland/rev/5d50e131c5a8 Fix setting initial state of PrivateBrowsingLockFeature r=twhite,android-reviewers
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: