Closed
Bug 974601
Opened 12 years ago
Closed 12 years ago
Avoid saving new configuration on refresh if still using default HomeConfig
Categories
(Firefox for Android Graveyard :: Awesomescreen, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 31
People
(Reporter: lucasr, Assigned: lucasr)
References
Details
Attachments
(1 file, 1 obsolete file)
|
23.18 KB,
patch
|
Margaret
:
review+
|
Details | Diff | Splinter Review |
When a full refresh is triggered (e.g. from a locale change) but the user hasn't changed the default list of panels, we should simply trigger a reload on all active HomeConfig instances instead of saving the refreshed state to disk. The default configuration is loaded from memory so we should only save it to disk if the new list of panels is actually different.
In order to do that, we'll a way to know if the returned list from HomeConfig.load() is the default one. Requires some API changes that are planned in bug 967742.
Updated•12 years ago
|
Priority: -- → P1
| Assignee | ||
Comment 2•12 years ago
|
||
| Assignee | ||
Comment 3•12 years ago
|
||
Comment on attachment 8395781 [details] [diff] [review]
Avoid saving HomeConfig state if still using default configuration (r=margaret)
Overview:
- Changes backend to take/return State instances in save()/load() -- to allow us to properly track the 'default' state of the config.
- Tracks changes to the State instance made with the Editor API and transfer the 'default' state to the newly created State instance accordingly on apply/commit calls.
- Whenever we try to save the default config to disk, we simply send a local broadcast message to force loaders to refresh and skip writing the state to disk altogether.
Attachment #8395781 -
Flags: review?(margaret.leibovic)
Comment 4•12 years ago
|
||
Comment on attachment 8395781 [details] [diff] [review]
Avoid saving HomeConfig state if still using default configuration (r=margaret)
Review of attachment 8395781 [details] [diff] [review]:
-----------------------------------------------------------------
Sorry for the slow review, this looks good. I like that we're using State in HomeConfigPrefsBackend now. I just have one concern about the similarity of ForceLoadChangeListener and ReloadBroadcastReceiver.
::: mobile/android/base/home/HomeConfigLoader.java
@@ +109,5 @@
> + @Override
> + public void onReceive(Context context, Intent intent) {
> + onContentChanged();
> + }
> + }
This seems a bit redundant with the OnChangeListener. Is there any way we could get rid of the OnChangeListener, and only use this ReloadBroadcastReceiver instead? That is, instead of having HomeConfigPrefsBackend call mChangeListener.onChange, it could just fire a RELOAD_BROADCAST.
Attachment #8395781 -
Flags: review?(margaret.leibovic) → feedback+
| Assignee | ||
Comment 5•12 years ago
|
||
(In reply to :Margaret Leibovic from comment #4)
> Comment on attachment 8395781 [details] [diff] [review]
> Avoid saving HomeConfig state if still using default configuration
> (r=margaret)
>
> Review of attachment 8395781 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Sorry for the slow review, this looks good. I like that we're using State in
> HomeConfigPrefsBackend now. I just have one concern about the similarity of
> ForceLoadChangeListener and ReloadBroadcastReceiver.
>
> ::: mobile/android/base/home/HomeConfigLoader.java
> @@ +109,5 @@
> > + @Override
> > + public void onReceive(Context context, Intent intent) {
> > + onContentChanged();
> > + }
> > + }
>
> This seems a bit redundant with the OnChangeListener. Is there any way we
> could get rid of the OnChangeListener, and only use this
> ReloadBroadcastReceiver instead? That is, instead of having
> HomeConfigPrefsBackend call mChangeListener.onChange, it could just fire a
> RELOAD_BROADCAST.
Good point. Let me try that.
| Assignee | ||
Comment 6•12 years ago
|
||
| Assignee | ||
Comment 7•12 years ago
|
||
Comment on attachment 8398485 [details] [diff] [review]
Avoid saving HomeConfig state if still using default configuration (r=margaret)
- Encapsulated the broadcast bits in the backend
- Consolidated both the reload and change cases into a single OnReloadListener
Attachment #8398485 -
Flags: review?(margaret.leibovic)
| Assignee | ||
Updated•12 years ago
|
Attachment #8395781 -
Attachment is obsolete: true
Comment 8•12 years ago
|
||
Comment on attachment 8398485 [details] [diff] [review]
Avoid saving HomeConfig state if still using default configuration (r=margaret)
Review of attachment 8398485 [details] [diff] [review]:
-----------------------------------------------------------------
Nice improvement.
Attachment #8398485 -
Flags: review?(margaret.leibovic) → review+
| Assignee | ||
Comment 9•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 31
Comment 11•11 years ago
|
||
Setting P2 hub bugs to block hub v2 EPIC bug (targeting fx31 release).
Filter on epic-hub-bugs.
Blocks: 1014030
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•