Closed Bug 964776 Opened 10 years ago Closed 10 years ago

[Flatfish][Settings] No vibrating alert motor, "Vibrate" option should be removed from Settings

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ericcc, Assigned: yifan)

Details

(Keywords: verifyme, Whiteboard: [flatfish][TCP=polish])

Attachments

(2 files)

GAIA commit e314d089d988f0eb1bef2404858c60b734dc4130

$GAIA_DISTRIBUTION_DIR=distribution_tablet make reset-gaia

1. Open "Settings" -> "Sound"
2. <ISSUE> "Vibrate" existed.
Flags: needinfo?(frlee)
Attached image SettingsSound.png
flatfish doesn't support Vibration from HW perspective, so vibrate option needs to be removed from setting.
Flags: needinfo?(frlee)
Whiteboard: [Flatfish only] → [Flatfish only][developer+]
Keywords: verifyme
Is this bug anyway related to the Tablet Contribution Program?
Keywords: verifyme
Whiteboard: [Flatfish only][developer+] → [flatfish][TCP]
Assignee: nobody → yliao
Settings app uses API to check for device functionality support, and show/hide the corresponding setting items relatively.

For vibration, it seems there isn't an API that could do it.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator.vibrate
http://www.w3.org/TR/vibration/#vibration-interface
navigator.vibrate() does nothing when a device doesn't support vibration and it still returns true.

Tried it on flatfish. Any ideas on checking for device vibration support?
Flags: needinfo?(arthur.chen)
For feature detection that is not well supported in gecko, a workaround would be using a json file. There is a similar case in settings app where we are unable to detect if the light sensor is available on the device. We added a sensors.json in the end. Please check https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Market_customizations_guide for details.
Flags: needinfo?(arthur.chen)
Thank you! I assume that means we would need to create another json such as vibrator.json for this, or simply put a key value pair for vibration support in sensors.json. What's your suggestion on it?
Flags: needinfo?(arthur.chen)
As this is actually a rare case, I would prefer placing it in the same file but rename it with a more general name.
Flags: needinfo?(arthur.chen)
How about device-features.json? Should we open another bug to make the naming change and then come back to this one?
Flags: needinfo?(arthur.chen)
The name is good to me. I think doing the rename in this bug is fine.
Flags: needinfo?(arthur.chen)
Whiteboard: [flatfish][TCP] → [flatfish][TCP=polish]
Attached file pull request
Modifications:

* Rename customization/sensors.json to customization/device-features.json
* Modify build.js to replace sensors.json with device-features.json
* Show/Hide 'Vibrate' checkbox according to the 'vibration' value in device-features.json
* Update .gitignore and integration test

Once it's landed, I will update the documentations as well. I found these 2 relevant links.
https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Market_customizations_guide#sensors.json
https://wiki.mozilla.org/FirefoxOS/TCP/Patching#Start_to_build_flatfish

Customization example, same applies to devices without vibration support:
1. Create a customization folder with device-features.json in it.
2. Code {"vibration":false} in device-featrues.json for flatfish.
3. Add GAIA_DISTRIBUTION_DIR=<customization-path> when building gaia for flatfish.
Attachment #8472782 - Flags: review?(arthur.chen)
Comment on attachment 8472782 [details] [review]
pull request

Good job! Thank you for taking the effort. r=me with the comment addressed.
Attachment #8472782 - Flags: review?(arthur.chen) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: