From bdad2357a1f0d2aca7f1106f3195d1fd929dc1d1 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 22 Feb 2020 20:10:23 -0500 Subject: Issue #1053 - Remove android support from netwerk --- netwerk/protocol/http/UserAgentUpdates.jsm | 7 +------ netwerk/protocol/http/nsHttpHandler.cpp | 28 +--------------------------- 2 files changed, 2 insertions(+), 33 deletions(-) (limited to 'netwerk/protocol/http') diff --git a/netwerk/protocol/http/UserAgentUpdates.jsm b/netwerk/protocol/http/UserAgentUpdates.jsm index ab88ffd40..4b3ae574a 100644 --- a/netwerk/protocol/http/UserAgentUpdates.jsm +++ b/netwerk/protocol/http/UserAgentUpdates.jsm @@ -143,14 +143,9 @@ this.UserAgentUpdates = { // try to load next one if the previous load failed return prevLoad ? prevLoad.then(null, tryNext) : tryNext(); }, null).then(null, (ex) => { -#ifdef MOZ_WIDGET_ANDROID - // Make one last attempt to read from the Fennec APK root. - return readChannel("resource://android/" + FILE_UPDATES); -#else - // All previous (non-Android) load attempts have failed, so we bail. + // All previous load attempts have failed, so we bail. throw new Error("UserAgentUpdates: Failed to load " + FILE_UPDATES + ex + "\n" + ex.stack); -#endif }).then((update) => { // Apply update if loading was successful this._applyUpdate(update); diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 2691a2a77..e1b7c9bff 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -127,30 +127,6 @@ NewURI(const nsACString &aSpec, return NS_OK; } -#ifdef ANDROID -static nsCString -GetDeviceModelId() { - // Assumed to be running on the main thread - // We need the device property in either case - nsAutoCString deviceModelId; - nsCOMPtr infoService = do_GetService("@mozilla.org/system-info;1"); - MOZ_ASSERT(infoService, "Could not find a system info service"); - nsAutoString androidDevice; - nsresult rv = infoService->GetPropertyAsAString(NS_LITERAL_STRING("device"), androidDevice); - if (NS_SUCCEEDED(rv)) { - deviceModelId = NS_LossyConvertUTF16toASCII(androidDevice); - } - nsAutoCString deviceString; - rv = Preferences::GetCString(UA_PREF("device_string"), &deviceString); - if (NS_SUCCEEDED(rv)) { - deviceString.Trim(" ", true, true); - deviceString.ReplaceSubstring(NS_LITERAL_CSTRING("%DEVICEID%"), deviceModelId); - return deviceString; - } - return deviceModelId; -} -#endif - //----------------------------------------------------------------------------- // nsHttpHandler //----------------------------------------------------------------------------- @@ -792,9 +768,7 @@ nsHttpHandler::InitUserAgentComponents() #ifndef MOZ_UA_OS_AGNOSTIC // Gather platform. mPlatform.AssignLiteral( -#if defined(ANDROID) - "Android" -#elif defined(XP_WIN) +#if defined(XP_WIN) "Windows" #elif defined(XP_MACOSX) "Macintosh" -- cgit v1.2.3