mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 816899 - Add keys of firmware revision and software info. r=cjones
This commit is contained in:
parent
423e7af568
commit
ef9f3747d2
@ -153,12 +153,14 @@ Components.utils.import('resource://gre/modules/ctypes.jsm');
|
||||
'@mozilla.org/settingsService;1',
|
||||
'nsISettingsService');
|
||||
let lock = gSettingsService.createLock();
|
||||
//MOZ_B2G_VERSION is set in b2g/confvars.sh, and is outputed as a #define value
|
||||
//from configure.in, defaults to 1.0.0 if this value is not exist
|
||||
// MOZ_B2G_VERSION is set in b2g/confvars.sh, and is output as a #define value
|
||||
// from configure.in, defaults to 1.0.0 if this value is not exist.
|
||||
#filter attemptSubstitution
|
||||
let os_version = '@MOZ_B2G_VERSION@';
|
||||
let os_name = '@MOZ_B2G_OS_NAME@';
|
||||
#unfilter attemptSubstitution
|
||||
lock.set('deviceinfo.os', os_version, null, null);
|
||||
lock.set('deviceinfo.software', os_name + ' ' + os_version, null, null);
|
||||
|
||||
let appInfo = Cc["@mozilla.org/xre/app-info;1"]
|
||||
.getService(Ci.nsIXULAppInfo);
|
||||
@ -168,8 +170,9 @@ Components.utils.import('resource://gre/modules/ctypes.jsm');
|
||||
let update_channel = Services.prefs.getCharPref('app.update.channel');
|
||||
lock.set('deviceinfo.update_channel', update_channel, null, null);
|
||||
|
||||
//Get the hardware info from android properties
|
||||
let hardware_version = null;
|
||||
// Get the hardware info and firmware revision from device properties.
|
||||
let hardware_info = null;
|
||||
let firmware_revision = null;
|
||||
try {
|
||||
let cutils = ctypes.open('libcutils.so');
|
||||
let cbuf = ctypes.char.array(128)();
|
||||
@ -185,12 +188,14 @@ Components.utils.import('resource://gre/modules/ctypes.jsm');
|
||||
c_property_get(key, cbuf, defaultValue);
|
||||
return cbuf.readString();
|
||||
}
|
||||
hardware_version = property_get('ro.hardware');
|
||||
hardware_info = property_get('ro.hardware');
|
||||
firmware_revision = property_get('ro.firmware_revision');
|
||||
cutils.close();
|
||||
} catch(e) {
|
||||
//Error
|
||||
// Error.
|
||||
}
|
||||
lock.set('deviceinfo.hardware', hardware_version, null, null);
|
||||
lock.set('deviceinfo.hardware', hardware_info, null, null);
|
||||
lock.set('deviceinfo.firmware_revision', firmware_revision, null, null);
|
||||
})();
|
||||
|
||||
// =================== Debugger ====================
|
||||
|
@ -11,6 +11,7 @@ MOZ_APP_UA_NAME=Firefox
|
||||
MOZ_UA_OS_AGNOSTIC=1
|
||||
|
||||
MOZ_B2G_VERSION=1.0.0-prerelease
|
||||
MOZ_B2G_OS_NAME=Boot2Gecko
|
||||
|
||||
MOZ_BRANDING_DIRECTORY=b2g/branding/unofficial
|
||||
MOZ_OFFICIAL_BRANDING_DIRECTORY=b2g/branding/official
|
||||
|
@ -8524,6 +8524,7 @@ fi
|
||||
|
||||
MOZ_B2G_VERSION=${MOZ_B2G_VERSION:-"1.0.0"}
|
||||
AC_DEFINE_UNQUOTED(MOZ_B2G_VERSION,"$MOZ_B2G_VERSION")
|
||||
AC_DEFINE_UNQUOTED(MOZ_B2G_OS_NAME,"$MOZ_B2G_OS_NAME")
|
||||
|
||||
AC_SUBST(MOZ_APP_NAME)
|
||||
AC_SUBST(MOZ_APP_DISPLAYNAME)
|
||||
|
Loading…
Reference in New Issue
Block a user