Closed Bug 847459 Opened 7 years ago Closed 7 years ago

empty device name should use default name rather than previous name


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

Gonk (Firefox OS)
Not set


(blocking-b2g:leo+, firefox22 wontfix, firefox23 wontfix, firefox24 fixed, b2g18 verified, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)

blocking-b2g leo+
Tracking Status
firefox22 --- wontfix
firefox23 --- wontfix
firefox24 --- fixed
b2g18 --- verified
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix


(Reporter: ggrisco, Assigned: gerard-majax)




(Whiteboard: [CR 458289])


(2 files, 1 obsolete file)

1. Go to bluetooth settings
2. click rename in the device options and delete all of the characters from the box and say ok

Expected Results: under "Visable to all", expected to see null name.
Actual Results:  under "Visable to all" device name is still displayed as the default name.

3. click rename button again, and give the device a non-null name and say ok

The name still shows as the default name.

After turning BT off then on again, this problem seems to go away.
blocking-b2g: --- → tef?
(not blocking for tef, would be nice to have to leo from our POV so handing off to leo triage team)
blocking-b2g: tef? → leo?
blocking-b2g: leo? → -
tracking-b2g18: --- → +
(upgrading to leo+.  This failure is reported against the BT test plan that we are using for v1.1.  Email me for more details if needed.)
blocking-b2g: - → leo+
tracking-b2g18: + → ---
Is empty device name correct?
I never see the spec of this part. But in android, it is not allowed to use "empty name" in bluetooth device.
Reproduced on Keon, v1-train
Flags: needinfo?(ffos-product)
After reading the source, in apps/settings/js/bluetooth.js, one can see:

      var nameEntered = window.prompt(_('change-phone-name'), myName);
      if (!nameEntered || nameEntered === '' || nameEntered === myName)

And on master,
Flags: needinfo?(ffos-product) → needinfo?(firefoxos-ux-bugzilla)
Attached patch Small workaround (obsolete) — Splinter Review
I have this tentative patch that allows to at least notify the user that the name is invalid. Basically I'm looping until either the user enters a valid name, or he cancel the window.prompt. Accoring to :evelyn on IRC, this kind of change needs a UX decision.
Assignee: nobody → lissyx+mozillians
Current behavior: if user enter space or let the field empty, it just like cancel the rename process, the rename window is closed and nothing updated.
Reassigning to Casey to verify behavior while Rob is out this week.
Flags: needinfo?(firefoxos-ux-bugzilla)
Flags: needinfo?(kyee)
I think it would make sense to rather than notifying the user, we should just change the name to a default name.   I think because the user made the change, there would be no sense in notify or warn them about the change.
Flags: needinfo?(kyee)
No, let's just do what Casey asked (see new bug title).
Summary: Bluetooth settings does not show changed device name → empty device name should use default name rather than previous name
(In reply to Alex Keybl [:akeybl] from comment #11)
> No, let's just do what Casey asked (see new bug title).

Okay, I'll work on this next week.
(In reply to Alex Keybl [:akeybl] from comment #11)
> No, let's just do what Casey asked (see new bug title).

Okay, but the default device name is taken from ro.product.model, and as far as I can tell we have no way to have it in gaia currently.
For example, on my Keon:

root@android:/etc/bluetooth # cat main.conf                                    


# Default adaper name
# %h - substituted for hostname
# %d - substituted for adapter id
# %b - substituted for ro.product.brand
# %m - substituted for ro.product.model
# %n - substituted for
Name = %m
Okay, the name is all handled on bluetoothd side, and gecko communicates via DBUS for this.

In absence of /data/misc/bluetoothd/<MAC>/config, bluetoothd uses the name as specified in the config file I was referring previously.

Then it builds the /data/misc/bluetoothd/<MAC>/config file (and others) with some content like this:
name GP-KEON
pairable yes

Which is then reused later. Gecko only asks/set the name via the DBus interface, hence never write any names itself. As far as I could see, no way from DBus to reset this.
This first patch add the gecko part to expose ro.product.model value as deviceinfo.product_model in settings.
Attachment #749260 - Attachment is obsolete: true
Attachment #754465 - Flags: review?(tzimmermann)
This pull request is the gaia counterpart: it uses the deviceinfo.product_model value to reset the bluetooth device name to its default value whenever the user enters an empty name, thus conforming to the behavior asked in this bug.
Attachment #754467 - Flags: review?(kaze)
Comment on attachment 754465 [details] [diff] [review]
Gecko part: exposing ro.product.model as deviceinfo.product_model

Review of attachment 754465 [details] [diff] [review]:

r+'ed, although I'm not so sure if the overall idea is really sound.
Attachment #754465 - Flags: review?(tzimmermann) → review+
Comment on attachment 754467 [details]
Gaia part: Link to Github

I think this patch introduces a race condition, see my comments on github. Clearing the review flag, please set it to r? again when you’ve updated your pull request.
Attachment #754467 - Flags: review?(kaze)
Comment on attachment 754467 [details]
Gaia part: Link to Github

r=me with nitpick addressed, see comment on github.
Attachment #754467 - Flags: review+
Hello people, can we land this ? Thanks :)

Set the keyword 'checkin-needed' if you want the Gecko patches to be committed. The Gaia patches have to be merged on github.

Best regards
Keywords: checkin-needed
Blocks: 876350
Whiteboard: [CR 458289] → [CR 458289][leave open]
Setting checkin-needed for the Gaia part and the v1-train/b2g18 uplifts.
Flags: needinfo?(jhford)
Keywords: checkin-needed
Whiteboard: [CR 458289][leave open] → [CR 458289]
Merged on master:
Closed: 7 years ago
Resolution: --- → FIXED
v1-train: b7a9ca3
Flags: needinfo?(jhford)
Flags: in-moztrap?
Flags: in-moztrap? → in-moztrap+
Followed STR in Comment 0 and verified fix. Empty device name shows default name rather than previous name.

Environmental Variables
Build ID: 20130807071207
Gaia: 60ca81600a080dae33058b0692ecaa213556c926
Platform Version: 18.1
Firmware Version: D300f08o
You need to log in before you can comment on or make changes to this bug.