Closed Bug 1150423 Opened 7 years ago Closed 7 years ago

[System] expose device type to system app

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: johnhu, Assigned: chens)

References

Details

Attachments

(1 file)

To enable multiple device type in one system app, we should expose device type to system app. The following is our plan:

1. Create a FeatureDetector module which wraps feature detections functions, like navigator.getFeature(), document.implementation.hasFeature(xxx, xxx) and device type.
2. use system app's build script to expose __DEVICE_TYPE to window object
3. register FeatureDetector's deviceType to service.
BTW, please modify the navigator.getFeature used by InputWindowManager[1] to FeatureDetector

[1] https://github.com/mozilla-b2g/gaia/blob/bfe504b49533fb268c5ddda99c606aa66442b313/apps/system/js/input_window_manager.js#L271-L280
Comment on attachment 8587327 [details] [review]
[gaia] shamenchens:Bug1150423-ExposeDeviceType > mozilla-b2g:master

Alive, this patch introduce FeatureDetector to system app and exposes device type/device memory to service, would you review changes in system app? thanks!

Ricky, we tend to replace some variable in build time, and I add `matchFileContentInZip` to helper function for build integration test, would you review changes in build system part? thanks!
Attachment #8587327 - Flags: review?(ricky060709)
Attachment #8587327 - Flags: review?(alive)
Comment on attachment 8587327 [details] [review]
[gaia] shamenchens:Bug1150423-ExposeDeviceType > mozilla-b2g:master

LGTM for build system part. Please fix the nit before landing.
Attachment #8587327 - Flags: review?(ricky060709) → review+
Comment on attachment 8587327 [details] [review]
[gaia] shamenchens:Bug1150423-ExposeDeviceType > mozilla-b2g:master

r+ with nits, feel free to flag review again if you have problem with the change.
Attachment #8587327 - Flags: review?(alive) → review+
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Assignee: nobody → chens
You need to log in before you can comment on or make changes to this bug.