Closed Bug 1020152 Opened 10 years ago Closed 10 years ago

Generate pre_installed_collections.json in build time

Categories

(Firefox OS Graveyard :: Gaia::Everything.me, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-v2.0 fixed, b2g-v2.1 fixed)

RESOLVED FIXED
2.0 S4 (20june)
Tracking Status
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed

People

(Reporter: crdlc, Assigned: albert)

References

Details

(Whiteboard: [systemsfe])

Attachments

(1 file)

Algorithm 1) Extract pre-defined collections from "homescreens.json" file 2) Create a file called "pre_defined_collections.json" with the descriptors for those pre-defined collections E.g. Pre-defined collections: tv and social pre_defined_collections.json: {"collections": [ { "name": "Tv", "categoryId": "213", "pinned": [ ["app://video.gaiamobile.org/manifest.webapp"] ], "icon": "/collections/tv/icon_90.png", "background": "/collections/tv/background_480x800.jpg" }, { "name": "Social", "categoryId": "289", "pinned": [ ["app://communications.gaiamobile.org/manifest.webapp", "dialer"], ["app://communications.gaiamobile.org/manifest.webapp", "contacts"], ["app://sms.gaiamobile.org/manifest.webapp"], ["app://email.gaiamobile.org/manifest.webapp"] ], "icon": "/collections/social/icon_90.png", "background": "/collections/social/background_480x800.jpg" } ]} The data will be taken from https://github.com/mozilla-b2g/gaia/tree/master/apps/collection/collections Obviously, the generation process should calculate the best icon and background for the target device and also the manifest paths to apps within collections
Blocks: 1016225
Whiteboard: [systemsfe]
Blocks: 1020155
Assignee: nobody → acperez
Sorry pre_predefined_collections -> pre_installed_collections
Summary: Generate pre_defined_collections.json in build time → Generate pre_installed_collections in build time
Summary: Generate pre_installed_collections in build time → Generate pre_installed_collections.json in build time
Attached file Patch
Generate at build time init.json with collections for apps/verticalhome, pre_installed_collections.json for apps/collections and clear resources of collections in the stage folder (unused collections, icons and backgrounds) to avoid pushing them to the device because application.zip size increases a lot. As code to generate both json is almost the same and it has been used by both application and verticalhome apps, I created a new script in build folder.
Attachment #8438213 - Flags: review?(yurenju.mozilla)
Hi Albert, could you give more context for reviewing this pr? 1. what the purpose of collection app is? I try to long press on homescreen to add smart collection but it does not work. 2. why do we need pre_installed_collections.json? 3. looks you extract homescreen-manager from verticalhome to another module, we should also update horizontal homescreen.
Flags: needinfo?(acperez)
(In reply to Yuren [:yurenju] from comment #3) > Hi Albert, could you give more context for reviewing this pr? > 1. what the purpose of collection app is? I try to long press on homescreen > to add smart collection but it does not work. The purpose of collection app is to externalize collections from the homescreen app to enable collections from third-party. The whole functionality of collections is not already landed, so is normal that you couldn't add smart collections. > 2. why do we need pre_installed_collections.json? pre_installed_collections.json is used to preload collections in a datastore in order to share them between the collections app and the vertical homescreen. On the first boot, collections are stored in the datastore. Then, when homescreen app find a collection to be painted it request the metadata for the collection to the datastore. > 3. looks you extract homescreen-manager from verticalhome to another module, > we should also update horizontal homescreen. Collections in horizontal and vertical homescreens work in a different way. However, horizontal homescreen is going to be removed, for that reason I didn't modified the horizontal home, do you think we should apply changes to horizontal home also?
Flags: needinfo?(acperez)
because we still use horizontal on tablet :)
but you are right, we don't need to modify horizontal homescreen if we have no plan to support this feature on horizontal homescreen
Comment on attachment 8438213 [details] Patch I left comments on github, please check it, there are two major issues: 1. some path looks doesn't work on Windows 2. we should have a integration or unit test case for this change especially for GAIA_DEVICE_TYPE.
Attachment #8438213 - Flags: review?(yurenju.mozilla)
Attachment #8438213 - Flags: review?(yurenju.mozilla)
Some errors fixed. Added some test. Removed GAIA_DEVICE_TYPE because vertical home is only for phone, it will be added if needed in the future.
Comment on attachment 8438213 [details] Patch r=yurenju and I also test it on Windows, looks we can get correct pre_install_collections.json with this pr. please fix typo on your pr which I mentioned on github.
Attachment #8438213 - Flags: review?(yurenju.mozilla) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment on attachment 8438213 [details] Patch This is needed for the vertical homescreen smart collections work. It's also npotb, so it should generally be safe to uplift. Thanks!
Attachment #8438213 - Flags: approval-gaia-v2.0?(bbajaj)
Attachment #8438213 - Flags: approval-gaia-v2.0?(bbajaj) → approval-gaia-v2.0+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: