mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
Issue #1053 - Remove android support from netwerk/protocol/http/nsHttpHandler.cpp
This commit is contained in:
parent
93a435ae22
commit
bb8b180863
1 changed files with 0 additions and 55 deletions
|
|
@ -783,49 +783,6 @@ nsHttpHandler::InitUserAgentComponents()
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef ANDROID
|
||||
nsCOMPtr<nsIPropertyBag2> 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
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue