Bug 1180996 - Basic device name on Android. r=margaret

This commit is contained in:
J. Ryan Stinnett 2015-07-06 21:46:59 -05:00
Родитель 037d573caf
Коммит 40c8d39e82
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -183,7 +183,7 @@ LocalDevice.prototype = {
*/ */
_generate: function() { _generate: function() {
if (Services.appinfo.widgetToolkit == "gonk") { if (Services.appinfo.widgetToolkit == "gonk") {
// For Gonk devices, create one from the device name plus a little // For Firefox OS devices, create one from the device name plus a little
// randomness. The goal is just to distinguish devices in an office // randomness. The goal is just to distinguish devices in an office
// environment where many people may have the same device model for // environment where many people may have the same device model for
// testing purposes (which would otherwise all report the same name). // testing purposes (which would otherwise all report the same name).
@ -193,6 +193,10 @@ LocalDevice.prototype = {
// To hex and zero pad // To hex and zero pad
randomID = ("00000000" + randomID.toString(16)).slice(-8); randomID = ("00000000" + randomID.toString(16)).slice(-8);
this.name = name + "-" + randomID; this.name = name + "-" + randomID;
} else if (Services.appinfo.widgetToolkit == "android") {
// For Firefox for Android, use the device's model name.
// TODO: Bug 1180997: Find the right way to expose an editable name
this.name = sysInfo.get("device");
} else { } else {
this.name = sysInfo.get("host"); this.name = sysInfo.get("host");
} }