Bug 1231416 - fix Mulet UA string generation rule. r=fabrice.
MozReview-Commit-ID: 69fIxw0FO9l
--- a/b2g/dev/confvars.sh
+++ b/b2g/dev/confvars.sh
@@ -4,8 +4,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
MOZ_B2G=1
MOZ_MULET=1
. ${srcdir}/browser/confvars.sh
MOZ_BUNDLED_FONTS=1
+MOZ_UA_OS_AGNOSTIC=1
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -321,17 +321,17 @@ nsHttpHandler::Init()
if (NS_FAILED(rv)) return rv;
rv = InitConnectionMgr();
if (NS_FAILED(rv)) return rv;
mSchedulingContextService =
do_GetService("@mozilla.org/network/scheduling-context-service;1");
-#ifdef ANDROID
+#if defined(ANDROID) || defined(MOZ_MULET)
mProductSub.AssignLiteral(MOZILLA_UAVERSION);
#else
mProductSub.AssignLiteral("20100101");
#endif
#if DEBUG
// dump user agent prefs
LOG(("> legacy-app-name = %s\n", mLegacyAppName.get()));
@@ -772,29 +772,29 @@ nsHttpHandler::InitUserAgentComponents()
if (NS_SUCCEEDED(rv) && isTV) {
mCompatDevice.AssignLiteral("TV");
} else {
mCompatDevice.AssignLiteral("Mobile");
}
}
#endif // ANDROID
-#ifdef FXOS_SIMULATOR
+#ifdef MOZ_MULET
{
// Add the `Mobile` or `Tablet` or `TV` token when running in the b2g
// desktop simulator via preference.
nsCString deviceType;
nsresult rv = Preferences::GetCString("devtools.useragent.device_type", &deviceType);
if (NS_SUCCEEDED(rv)) {
mCompatDevice.Assign(deviceType);
} else {
mCompatDevice.AssignLiteral("Mobile");
}
}
-#endif // FXOS_SIMULATOR
+#endif // MOZ_MULET
#if defined(MOZ_WIDGET_GONK)
// Device model identifier should be a simple token, which can be composed
// of letters, numbers, hyphen ("-") and dot (".").
// Any other characters means the identifier is invalid and ignored.
nsCString deviceId;
rv = Preferences::GetCString("general.useragent.device_id", &deviceId);
if (NS_SUCCEEDED(rv)) {