diff options
-rw-r--r-- | api/7.xml | 286 | ||||
-rw-r--r-- | api/8.xml | 286 | ||||
-rw-r--r-- | api/current.xml | 286 | ||||
-rw-r--r-- | core/java/android/view/View.java | 7 | ||||
-rw-r--r-- | core/java/android/webkit/BrowserFrame.java | 7 | ||||
-rw-r--r-- | core/java/android/webkit/LoadListener.java | 44 |
6 files changed, 49 insertions, 867 deletions
diff --git a/api/7.xml b/api/7.xml index 83d2bc74d186..f6ccc9313b7c 100644 --- a/api/7.xml +++ b/api/7.xml @@ -199633,292 +199633,6 @@ visibility="public" > </field> -<field name="OP_UNUSED_3e" - type="int" - transient="false" - volatile="false" - value="62" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_3f" - type="int" - transient="false" - volatile="false" - value="63" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_40" - type="int" - transient="false" - volatile="false" - value="64" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_41" - type="int" - transient="false" - volatile="false" - value="65" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_42" - type="int" - transient="false" - volatile="false" - value="66" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_43" - type="int" - transient="false" - volatile="false" - value="67" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_73" - type="int" - transient="false" - volatile="false" - value="115" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_79" - type="int" - transient="false" - volatile="false" - value="121" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_7A" - type="int" - transient="false" - volatile="false" - value="122" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E3" - type="int" - transient="false" - volatile="false" - value="227" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E4" - type="int" - transient="false" - volatile="false" - value="228" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E5" - type="int" - transient="false" - volatile="false" - value="229" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E6" - type="int" - transient="false" - volatile="false" - value="230" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E7" - type="int" - transient="false" - volatile="false" - value="231" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E8" - type="int" - transient="false" - volatile="false" - value="232" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E9" - type="int" - transient="false" - volatile="false" - value="233" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EA" - type="int" - transient="false" - volatile="false" - value="234" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EB" - type="int" - transient="false" - volatile="false" - value="235" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EC" - type="int" - transient="false" - volatile="false" - value="236" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_ED" - type="int" - transient="false" - volatile="false" - value="237" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EF" - type="int" - transient="false" - volatile="false" - value="239" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_F1" - type="int" - transient="false" - volatile="false" - value="241" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FC" - type="int" - transient="false" - volatile="false" - value="252" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FD" - type="int" - transient="false" - volatile="false" - value="253" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FE" - type="int" - transient="false" - volatile="false" - value="254" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FF" - type="int" - transient="false" - volatile="false" - value="255" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="OP_USHR_INT" type="int" transient="false" diff --git a/api/8.xml b/api/8.xml index 83d2bc74d186..f6ccc9313b7c 100644 --- a/api/8.xml +++ b/api/8.xml @@ -199633,292 +199633,6 @@ visibility="public" > </field> -<field name="OP_UNUSED_3e" - type="int" - transient="false" - volatile="false" - value="62" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_3f" - type="int" - transient="false" - volatile="false" - value="63" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_40" - type="int" - transient="false" - volatile="false" - value="64" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_41" - type="int" - transient="false" - volatile="false" - value="65" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_42" - type="int" - transient="false" - volatile="false" - value="66" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_43" - type="int" - transient="false" - volatile="false" - value="67" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_73" - type="int" - transient="false" - volatile="false" - value="115" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_79" - type="int" - transient="false" - volatile="false" - value="121" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_7A" - type="int" - transient="false" - volatile="false" - value="122" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E3" - type="int" - transient="false" - volatile="false" - value="227" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E4" - type="int" - transient="false" - volatile="false" - value="228" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E5" - type="int" - transient="false" - volatile="false" - value="229" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E6" - type="int" - transient="false" - volatile="false" - value="230" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E7" - type="int" - transient="false" - volatile="false" - value="231" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E8" - type="int" - transient="false" - volatile="false" - value="232" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E9" - type="int" - transient="false" - volatile="false" - value="233" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EA" - type="int" - transient="false" - volatile="false" - value="234" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EB" - type="int" - transient="false" - volatile="false" - value="235" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EC" - type="int" - transient="false" - volatile="false" - value="236" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_ED" - type="int" - transient="false" - volatile="false" - value="237" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EF" - type="int" - transient="false" - volatile="false" - value="239" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_F1" - type="int" - transient="false" - volatile="false" - value="241" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FC" - type="int" - transient="false" - volatile="false" - value="252" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FD" - type="int" - transient="false" - volatile="false" - value="253" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FE" - type="int" - transient="false" - volatile="false" - value="254" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FF" - type="int" - transient="false" - volatile="false" - value="255" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="OP_USHR_INT" type="int" transient="false" diff --git a/api/current.xml b/api/current.xml index dfa053ac67e9..8b20412de615 100644 --- a/api/current.xml +++ b/api/current.xml @@ -200951,292 +200951,6 @@ visibility="public" > </field> -<field name="OP_UNUSED_3e" - type="int" - transient="false" - volatile="false" - value="62" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_3f" - type="int" - transient="false" - volatile="false" - value="63" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_40" - type="int" - transient="false" - volatile="false" - value="64" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_41" - type="int" - transient="false" - volatile="false" - value="65" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_42" - type="int" - transient="false" - volatile="false" - value="66" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_43" - type="int" - transient="false" - volatile="false" - value="67" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_73" - type="int" - transient="false" - volatile="false" - value="115" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_79" - type="int" - transient="false" - volatile="false" - value="121" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_7A" - type="int" - transient="false" - volatile="false" - value="122" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E3" - type="int" - transient="false" - volatile="false" - value="227" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E4" - type="int" - transient="false" - volatile="false" - value="228" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E5" - type="int" - transient="false" - volatile="false" - value="229" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E6" - type="int" - transient="false" - volatile="false" - value="230" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E7" - type="int" - transient="false" - volatile="false" - value="231" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E8" - type="int" - transient="false" - volatile="false" - value="232" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_E9" - type="int" - transient="false" - volatile="false" - value="233" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EA" - type="int" - transient="false" - volatile="false" - value="234" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EB" - type="int" - transient="false" - volatile="false" - value="235" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EC" - type="int" - transient="false" - volatile="false" - value="236" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_ED" - type="int" - transient="false" - volatile="false" - value="237" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_EF" - type="int" - transient="false" - volatile="false" - value="239" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_F1" - type="int" - transient="false" - volatile="false" - value="241" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FC" - type="int" - transient="false" - volatile="false" - value="252" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FD" - type="int" - transient="false" - volatile="false" - value="253" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FE" - type="int" - transient="false" - volatile="false" - value="254" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> -<field name="OP_UNUSED_FF" - type="int" - transient="false" - volatile="false" - value="255" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="OP_USHR_INT" type="int" transient="false" diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 0b8753659087..1fc367810d22 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -4324,8 +4324,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility requestLayout(); invalidate(); - if (((mViewFlags & VISIBILITY_MASK) == GONE) && hasFocus()) { - clearFocus(); + if (((mViewFlags & VISIBILITY_MASK) == GONE)) { + if (hasFocus()) clearFocus(); + destroyDrawingCache(); } if (mAttachInfo != null) { mAttachInfo.mViewVisibilityChanged = true; @@ -6283,6 +6284,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility canvas.translate(-mScrollX, -mScrollY); mPrivateFlags |= DRAWN; + mPrivateFlags |= DRAWING_CACHE_VALID; // Fast path for layouts with no backgrounds if ((mPrivateFlags & SKIP_DRAW) == SKIP_DRAW) { @@ -6301,7 +6303,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility // Restore the cached Canvas for our siblings attachInfo.mCanvas = canvas; } - mPrivateFlags |= DRAWING_CACHE_VALID; } } diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java index 1496f1bf4daf..e94f485f1f3e 100644 --- a/core/java/android/webkit/BrowserFrame.java +++ b/core/java/android/webkit/BrowserFrame.java @@ -546,6 +546,8 @@ class BrowserFrame extends Handler { byte[] postData, long postDataIdentifier, int cacheMode, + boolean mainResource, + boolean userGesture, boolean synchronous) { PerfChecker checker = new PerfChecker(); @@ -612,13 +614,14 @@ class BrowserFrame extends Handler { if (DebugFlags.BROWSER_FRAME) { Log.v(LOGTAG, "startLoadingResource: url=" + url + ", method=" + method + ", postData=" + postData + ", isMainFramePage=" - + isMainFramePage); + + isMainFramePage + ", mainResource=" + mainResource + + ", userGesture=" + userGesture); } // Create a LoadListener LoadListener loadListener = LoadListener.getLoadListener(mContext, this, url, loaderHandle, synchronous, isMainFramePage, - postDataIdentifier); + mainResource, userGesture, postDataIdentifier); mCallbackProxy.onLoadResource(url); diff --git a/core/java/android/webkit/LoadListener.java b/core/java/android/webkit/LoadListener.java index 938df9583dad..863ab8c2592f 100644 --- a/core/java/android/webkit/LoadListener.java +++ b/core/java/android/webkit/LoadListener.java @@ -16,9 +16,14 @@ package android.webkit; +import android.content.ActivityNotFoundException; import android.content.Context; -import android.net.WebAddress; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; import android.net.ParseException; +import android.net.Uri; +import android.net.WebAddress; import android.net.http.EventHandler; import android.net.http.Headers; import android.net.http.HttpAuthHeader; @@ -117,6 +122,8 @@ class LoadListener extends Handler implements EventHandler { // Does this loader correspond to the main-frame top-level page? private boolean mIsMainPageLoader; + private final boolean mIsMainResourceLoader; + private final boolean mUserGesture; private Headers mHeaders; @@ -126,11 +133,12 @@ class LoadListener extends Handler implements EventHandler { public static LoadListener getLoadListener(Context context, BrowserFrame frame, String url, int nativeLoader, - boolean synchronous, boolean isMainPageLoader, long postIdentifier) { + boolean synchronous, boolean isMainPageLoader, + boolean isMainResource, boolean userGesture, long postIdentifier) { sNativeLoaderCount += 1; return new LoadListener(context, frame, url, nativeLoader, synchronous, - isMainPageLoader, postIdentifier); + isMainPageLoader, isMainResource, userGesture, postIdentifier); } public static int getNativeLoaderCount() { @@ -139,7 +147,7 @@ class LoadListener extends Handler implements EventHandler { LoadListener(Context context, BrowserFrame frame, String url, int nativeLoader, boolean synchronous, boolean isMainPageLoader, - long postIdentifier) { + boolean isMainResource, boolean userGesture, long postIdentifier) { if (DebugFlags.LOAD_LISTENER) { Log.v(LOGTAG, "LoadListener constructor url=" + url); } @@ -152,6 +160,8 @@ class LoadListener extends Handler implements EventHandler { mMessageQueue = new Vector<Message>(); } mIsMainPageLoader = isMainPageLoader; + mIsMainResourceLoader = isMainResource; + mUserGesture = userGesture; mPostIdentifier = postIdentifier; } @@ -294,6 +304,13 @@ class LoadListener extends Handler implements EventHandler { sendMessageInternal(obtainMessage(MSG_CONTENT_HEADERS, headers)); } + // This is the same regex that DOMImplementation uses to check for xml + // content. Use this to check if another Activity wants to handle the + // content before giving it to webkit. + private static final String XML_MIME_TYPE = + "^[\\w_\\-+~!$\\^{}|.%'`#&*]+/" + + "[\\w_\\-+~!$\\^{}|.%'`#&*]+\\+xml$"; + // Does the header parsing work on the WebCore thread. private void handleHeaders(Headers headers) { if (mCancelled) return; @@ -352,6 +369,25 @@ class LoadListener extends Handler implements EventHandler { than the headers that are returned from the server. */ guessMimeType(); } + // At this point, mMimeType has been set to non-null. + if (mIsMainPageLoader && mIsMainResourceLoader && mUserGesture && + Pattern.matches(XML_MIME_TYPE, mMimeType)) { + Intent i = new Intent(Intent.ACTION_VIEW); + i.setDataAndType(Uri.parse(url()), mMimeType); + ResolveInfo info = mContext.getPackageManager().resolveActivity(i, + PackageManager.MATCH_DEFAULT_ONLY); + if (info != null) { + // someone (other than the current activity) knows how to + // handle this mime type. + try { + mContext.startActivity(i); + mBrowserFrame.stopLoading(); + return; + } catch (ActivityNotFoundException ex) { + // continue loading internally. + } + } + } // is it an authentication request? boolean mustAuthenticate = (mStatusCode == HTTP_AUTH || |