Closed Bug 905849 Opened 11 years ago Closed 11 years ago

[Settings] let the user select a ringtone with the Pick activity

Categories

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

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 905856

People

(Reporter: djf, Assigned: djf)

References

Details

Attachments

(1 file)

The settings app currently hardcodes the available system ringtones, and those are the only choices available to the user.  The inability to set custom ringtones is one of the top three issues that users are complaining about right now.  (According to the August 12 FirefoxOS feedback summary)

This bug would alter ringtone setting to parallel the wallpaper setting code we already have.

The settings app would be modified to remove the hardcoded list of ringtones and instead just initiate a pick activity for type audio/*.

Then, we'd write an iconless Ringtone app (to parallel the iconless Wallpaper app) to offer the standard system ringtones to the user.

With that feature in place, users would be able to pick ringtones from the set of system ringtones or from their music in the music app.  (If there are technical reasons not to use full-length songs as ringtones, then we'll have to modify the request somehow so that the music app is not listed as a choice, until we can write "editing" code to allow the user to select just a portion of a song).

The coolest thing about this, though, is that carriers and third parties can release apps in the market place that serve custom wallpapers and custom ringtones. When the user goes to set a ringtone, they might see multiple choices:

  System Ringtones
  Music
  Movistar Ringtones
  Annoying Ringtones
cc'ing Kaze and Evelyn because they own the settings app, and Josh because this would be a step toward the customizability that he wants.

Nominating for Koi because this blocks a feature that our partners really want landed in v1.2.
blocking-b2g: --- → koi?
Etienne,

Could you comment on the implications of allowing entire songs to be picked from the music app and used as ringtones?  Would that break things?
Flags: needinfo?(etienne)
(In reply to David Flanagan [:djf] from comment #2)
> Etienne,
> 
> Could you comment on the implications of allowing entire songs to be picked
> from the music app and used as ringtones?  Would that break things?

The only way to know is to try :)

The ringtone player is a classic |new Audio()| and the ringtone itself is an ogg data-url'ed into a mozSetting (dialer.ringtone).

The heaviest ringtone we have right now is 72KB.

It should be pretty straightforward to add a bigger mp3 to the current ringtones in order to test:
* the memory consumption
* the delay it may incur before the first ring (we definitely don't want to regress on this front)
Flags: needinfo?(etienne)
Assignee: nobody → dflanagan
The attachment is a link to a github pull request.

The PR is not ready to merge yet, but it is a proof of concept that I want available for testing and feedback.

Kaze: I need to do something like this in preparation for some high-priority DRM work that needs to land in 1.2.  Does this look okay to you?  Should we generalize it to handle notification sounds as well as ringtones?
Attachment #793897 - Flags: feedback?(kaze)
(In reply to Etienne Segonzac (:etienne) from comment #3)
> (In reply to David Flanagan [:djf] from comment #2)
> > Etienne,
> > 
> > Could you comment on the implications of allowing entire songs to be picked
> > from the music app and used as ringtones?  Would that break things?
> 
> The only way to know is to try :)
> 

I tried, and when trying to save an .m4a song as a base64 data url into the settings database causes a crash. Maybe an OOM?  I didn't investigate and instead used "type:ringtone" in the activity so that the music players are not offered to the user as a choice for picking ringtones. That's a feature that will have to wait.
Anthony,

Note that this bug alone won't be enough to implement what is requested in bug 878057. This part just opens things up so that other apps can provide ringtones. But it won't make the Music app into a ringtone provider, which is what I think people want.  That may require extra work to fix the issue in comment 5.

Perhaps it would be better to mark bug 878057 as depending on this one rather than duplicating this one.
Flags: needinfo?(anthony)
You're right, let me change this.
Flags: needinfo?(anthony)
Blocks: 878057
Hi David

Here's the pull request with UI of select ringtone screen updated to look same as Alerts. https://github.com/mozilla-b2g/gaia/pull/11867

Please review. Thanks
Flags: needinfo?(dflanagan)
There are few minor issues seen that i am looking into
1. Click of Done should take user back to Sound screen , even if there is no change in selection of ringtone.

2. Default ring tone shows up as undefined under Settings -> Sound -> Ringer

3. There is an ugly flicker when select a ringtone screen loads on tap under Ringer. ( Settings -> Sound -> Ringer -> selected tone)
Clearing needinfo. Punam and I talked via IRC.
Flags: needinfo?(dflanagan)
Hi David

As discussed, I have updated the PR https://github.com/mozilla-b2g/gaia/pull/11867, to show selected alert tone under Settings->Sounds. I have squashed my commits in to single commits for easy pick. Please review.

Thanks!
Flags: needinfo?(dflanagan)
Punam,

I see that you modified the code to display the name of the current alert tone in the menu instead of the generic "Change". What I actually meant was to change it so that both ringtones and alert tones are selected with a pick activity.  For ringtones we use type:"ringtone". For alerts, use type:"alerttone". 

Let's use the ringtone app to list either ringtones or alert tones depending on the type parameter of the activity.  (Note that you'll have to modify the manifest.webapp of the ringtones app to specify that it can handle the alerttone type as well.)
Flags: needinfo?(dflanagan)
Hi David

PR https://github.com/mozilla-b2g/gaia/pull/11867 is updated to use pick activity for both alerts and ringtone and is merged with latest master. Please review.

Thanks!
Flags: needinfo?(dflanagan)
Punam,

I've merged the our work on this bug into the larger patch for bug 905856.  See https://github.com/mozilla-b2g/gaia/pull/11914/files
Flags: needinfo?(dflanagan)
Closing this bug.  All the work on it has moved into bug 905856.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Blocks: 909619
Reset flag for duped bug.
blocking-b2g: koi? → ---
Attachment #793897 - Flags: feedback?(kaze)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: