diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2010-11-03 11:38:06 -0700 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2010-11-03 11:38:06 -0700 |
commit | db2403ff3251bebb5dd6bdb98f826a8e04dc6ed1 (patch) | |
tree | 8c0c2c69eee0d6b551390fd017366d36e3d6d8c5 | |
parent | 42c94791b08022b9b214c1efb10b252567d1f0fa (diff) | |
parent | bdb0896ba5078a09d667482c4c91ee279fa2f0e6 (diff) | |
download | frameworks_base-db2403ff3251bebb5dd6bdb98f826a8e04dc6ed1.zip frameworks_base-db2403ff3251bebb5dd6bdb98f826a8e04dc6ed1.tar.gz frameworks_base-db2403ff3251bebb5dd6bdb98f826a8e04dc6ed1.tar.bz2 |
Merge "Add support for UAProf header in HTTP requests"
-rw-r--r-- | core/java/android/webkit/FrameLoader.java | 9 | ||||
-rw-r--r-- | core/res/res/values/config.xml | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/webkit/FrameLoader.java b/core/java/android/webkit/FrameLoader.java index 7fd993a..021b53c 100644 --- a/core/java/android/webkit/FrameLoader.java +++ b/core/java/android/webkit/FrameLoader.java @@ -18,6 +18,7 @@ package android.webkit; import android.net.http.EventHandler; import android.net.http.RequestHandle; +import android.os.Build; import android.util.Log; import android.webkit.CacheManager.CacheResult; @@ -35,6 +36,7 @@ class FrameLoader { private int mCacheMode; private String mReferrer; private String mContentType; + private final String mUaprofHeader; private static final int URI_PROTOCOL = 0x100; @@ -57,6 +59,8 @@ class FrameLoader { mMethod = method; mCacheMode = WebSettings.LOAD_NORMAL; mSettings = settings; + mUaprofHeader = mListener.getContext().getResources().getString( + com.android.internal.R.string.config_useragentprofile_url, Build.MODEL); } public void setReferrer(String ref) { @@ -356,6 +360,11 @@ class FrameLoader { } mHeaders.put("User-Agent", mSettings.getUserAgentString()); + + // Set the x-wap-profile header + if (mUaprofHeader != null && mUaprofHeader.length() > 0) { + mHeaders.put("x-wap-profile", mUaprofHeader); + } } /** diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 59e4a55..ebfab91 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -332,4 +332,11 @@ <!-- 2 means give warning --> <integer name="config_datause_notification_type">2</integer> + <!-- 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> |