Merge db2403ff
from open-source master
Change-Id: I90dfa2f37db901b62690b6becbf5d0d91468672c
This commit is contained in:
@ -18,6 +18,7 @@ package android.webkit;
|
|||||||
|
|
||||||
import android.net.http.EventHandler;
|
import android.net.http.EventHandler;
|
||||||
import android.net.http.RequestHandle;
|
import android.net.http.RequestHandle;
|
||||||
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.webkit.CacheManager.CacheResult;
|
import android.webkit.CacheManager.CacheResult;
|
||||||
|
|
||||||
@ -35,6 +36,7 @@ class FrameLoader {
|
|||||||
private int mCacheMode;
|
private int mCacheMode;
|
||||||
private String mReferrer;
|
private String mReferrer;
|
||||||
private String mContentType;
|
private String mContentType;
|
||||||
|
private final String mUaprofHeader;
|
||||||
|
|
||||||
private static final int URI_PROTOCOL = 0x100;
|
private static final int URI_PROTOCOL = 0x100;
|
||||||
|
|
||||||
@ -57,6 +59,8 @@ class FrameLoader {
|
|||||||
mMethod = method;
|
mMethod = method;
|
||||||
mCacheMode = WebSettings.LOAD_NORMAL;
|
mCacheMode = WebSettings.LOAD_NORMAL;
|
||||||
mSettings = settings;
|
mSettings = settings;
|
||||||
|
mUaprofHeader = mListener.getContext().getResources().getString(
|
||||||
|
com.android.internal.R.string.config_useragentprofile_url, Build.MODEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReferrer(String ref) {
|
public void setReferrer(String ref) {
|
||||||
@ -356,6 +360,11 @@ class FrameLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mHeaders.put("User-Agent", mSettings.getUserAgentString());
|
mHeaders.put("User-Agent", mSettings.getUserAgentString());
|
||||||
|
|
||||||
|
// Set the x-wap-profile header
|
||||||
|
if (mUaprofHeader != null && mUaprofHeader.length() > 0) {
|
||||||
|
mHeaders.put("x-wap-profile", mUaprofHeader);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -381,4 +381,12 @@
|
|||||||
<!-- Boolean indicating if restoring network selection should be skipped -->
|
<!-- Boolean indicating if restoring network selection should be skipped -->
|
||||||
<!-- The restoring is handled by modem if it is true-->
|
<!-- The restoring is handled by modem if it is true-->
|
||||||
<bool translatable="false" name="skip_restoring_network_selection">false</bool>
|
<bool translatable="false" name="skip_restoring_network_selection">false</bool>
|
||||||
|
|
||||||
|
<!-- The URL that should be sent in an x-wap-profile header with an HTTP request,
|
||||||
|
as defined in the Open Mobile Alliance User Agent Profile specification
|
||||||
|
OMA-TS-UAProf-V2_0-20060206-A Section 8.1.1.1. If the URL contains a '%s'
|
||||||
|
format string then that substring will be replaced with the value of
|
||||||
|
Build.MODEL. The format string shall not be escaped. -->
|
||||||
|
<string name="config_useragentprofile_url"></string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Reference in New Issue
Block a user