File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 1818
1919import android .net .http .EventHandler ;
2020import android .net .http .RequestHandle ;
21+ import android .os .Build ;
2122import android .util .Log ;
2223import android .webkit .CacheManager .CacheResult ;
2324
@@ -35,6 +36,7 @@ class FrameLoader {
3536 private int mCacheMode ;
3637 private String mReferrer ;
3738 private String mContentType ;
39+ private final String mUaprofHeader ;
3840
3941 private static final int URI_PROTOCOL = 0x100 ;
4042
@@ -57,6 +59,8 @@ class FrameLoader {
5759 mMethod = method ;
5860 mCacheMode = WebSettings .LOAD_NORMAL ;
5961 mSettings = settings ;
62+ mUaprofHeader = mListener .getContext ().getResources ().getString (
63+ com .android .internal .R .string .config_useragentprofile_url , Build .MODEL );
6064 }
6165
6266 public void setReferrer (String ref ) {
@@ -356,6 +360,11 @@ private void populateStaticHeaders() {
356360 }
357361
358362 mHeaders .put ("User-Agent" , mSettings .getUserAgentString ());
363+
364+ // Set the x-wap-profile header
365+ if (mUaprofHeader != null && mUaprofHeader .length () > 0 ) {
366+ mHeaders .put ("x-wap-profile" , mUaprofHeader );
367+ }
359368 }
360369
361370 /**
Original file line number Diff line number Diff line change 332332 <!-- 2 means give warning -->
333333 <integer name =" config_datause_notification_type" >2</integer >
334334
335+ <!-- The URL that should be sent in an x-wap-profile header with an HTTP request,
336+ as defined in the Open Mobile Alliance User Agent Profile specification
337+ OMA-TS-UAProf-V2_0-20060206-A Section 8.1.1.1. If the URL contains a '%s'
338+ format string then that substring will be replaced with the value of
339+ Build.MODEL. The format string shall not be escaped. -->
340+ <string name =" config_useragentprofile_url" ></string >
341+
335342</resources >
You can’t perform that action at this time.
0 commit comments