From 13a8e788810c006e964cc3a87c0ddb9ca1eb9114 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 22 Feb 2020 20:48:32 -0500 Subject: Issue #1053 - Remove android support from netwerk/protocol/http/nsHttpHandler.cpp --- netwerk/protocol/http/nsHttpHandler.cpp | 55 --------------------------------- 1 file changed, 55 deletions(-) (limited to 'netwerk') diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index e1b7c9bff..32e50712f 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -783,49 +783,6 @@ nsHttpHandler::InitUserAgentComponents() #endif -#ifdef ANDROID - nsCOMPtr infoService = do_GetService("@mozilla.org/system-info;1"); - MOZ_ASSERT(infoService, "Could not find a system info service"); - nsresult rv; - // Add the Android version number to the Fennec platform identifier. -#if defined MOZ_WIDGET_ANDROID -#ifndef MOZ_UA_OS_AGNOSTIC // Don't add anything to mPlatform since it's empty. - nsAutoString androidVersion; - rv = infoService->GetPropertyAsAString( - NS_LITERAL_STRING("release_version"), androidVersion); - if (NS_SUCCEEDED(rv)) { - mPlatform += " "; - // If the 2nd character is a ".", we know the major version is a single - // digit. If we're running on a version below 4 we pretend to be on - // Android KitKat (4.4) to work around scripts sniffing for low versions. - if (androidVersion[1] == 46 && androidVersion[0] < 52) { - mPlatform += "4.4"; - } else { - mPlatform += NS_LossyConvertUTF16toASCII(androidVersion); - } - } -#endif -#endif - // Add the `Mobile` or `Tablet` or `TV` token when running on device. - bool isTablet; - rv = infoService->GetPropertyAsBool(NS_LITERAL_STRING("tablet"), &isTablet); - if (NS_SUCCEEDED(rv) && isTablet) { - mCompatDevice.AssignLiteral("Tablet"); - } else { - bool isTV; - rv = infoService->GetPropertyAsBool(NS_LITERAL_STRING("tv"), &isTV); - if (NS_SUCCEEDED(rv) && isTV) { - mCompatDevice.AssignLiteral("TV"); - } else { - mCompatDevice.AssignLiteral("Mobile"); - } - } - - if (Preferences::GetBool(UA_PREF("use_device"), false)) { - mDeviceModelId = mozilla::net::GetDeviceModelId(); - } -#endif // ANDROID - #ifdef MOZ_MULET { // Add the `Mobile` or `Tablet` or `TV` token when running in the b2g @@ -1005,18 +962,6 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) mUserAgentIsDirty = true; } -#ifdef ANDROID - // general.useragent.use_device - if (PREF_CHANGED(UA_PREF("use_device"))) { - if (Preferences::GetBool(UA_PREF("use_device"), false)) { - mDeviceModelId = mozilla::net::GetDeviceModelId(); - } else { - mDeviceModelId = EmptyCString(); - } - mUserAgentIsDirty = true; - } -#endif - // // HTTP options // -- cgit v1.2.3