Closed Bug 1812149 Opened 3 years ago Closed 3 years ago

LocaleAwareAppCompatActivity should use a ContextWrapper to update the locale instead

Categories

(Firefox for Android :: General, enhancement, P1)

All
Android
enhancement

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox111 --- unaffected
firefox112 --- unaffected
firefox113 --- fixed

People

(Reporter: jonalmeida, Assigned: jonalmeida)

References

(Blocks 1 open bug)

Details

(Whiteboard: [android-print][geckoview:m112][geckoview:m113])

Attachments

(1 file)

There are times when we need to use the original Context and not the updated context after a configuration change.

We've seen this recently with the removal of the deprecated APIs in Resources.updateConfiguration() which no longer update the existing Context, but instead provide a new Activity Context via Context.createConfigurationContext.

When looking at how the new window.print GeckoView API will work in our Android Components code, the Context provided to us from the LocaleAwareAppCompatActivity throws an IllegalStateException on the context type.

Other users have also faced this issue as well with the removal of the deprecated API.

What we should do, is use a ContextWrapper that is meant for this purpose, provide some changes and delegate the rest to the default implementation, and also giving us access to the original context that we would need with the PrintManager via ContextWrapper.getBaseContext().

Blocks: 1808755
Whiteboard: [android-print]
Blocks: 1809919
Whiteboard: [android-print] → [android-print][geckoview:m112?]
Severity: -- → N/A
Rank: 300
Priority: -- → P3
No longer blocks: 1809919
Depends on: 1809919
Rank: 300 → 200
Priority: P3 → P2
Blocks: 1659818
Assignee: nobody → jonalmeida942
Status: NEW → ASSIGNED
Target Milestone: --- → 112 Branch
Priority: P2 → P1
Whiteboard: [android-print][geckoview:m112?] → [android-print][geckoview:m112]

This work is done in 112, but we are landing it in 113 since it's late in the release cycle.

Whiteboard: [android-print][geckoview:m112] → [android-print][geckoview:m112][geckoview:m113]
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Flags: qe-verify+
Resolution: --- → FIXED
Target Milestone: 112 Branch → 113 Branch
Flags: qe-verify+

(In reply to Jonathan Almeida [:jonalmeida] from comment #2)

This work is done in 112, but we are landing it in 113 since it's late in the release cycle.

Jonathan, should we uplift your fix to Beta 112? Will users experience problems in 112 if this fix ships in 113?

Flags: needinfo?(jonalmeida942)

No, this patch is only useful with ohall's window.print changes. So uplifting this will have no value to users as the window.print patch has to ride the trains.

Flags: needinfo?(jonalmeida942)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: