diff options
| -rw-r--r-- | core/java/android/webkit/LoadListener.java | 3 | ||||
| -rw-r--r-- | core/java/android/webkit/WebView.java | 11 | ||||
| -rw-r--r-- | core/jni/android_net_TrafficStats.cpp | 8 |
3 files changed, 18 insertions, 4 deletions
diff --git a/core/java/android/webkit/LoadListener.java b/core/java/android/webkit/LoadListener.java index 1130e950780e..12b8c74dd371 100644 --- a/core/java/android/webkit/LoadListener.java +++ b/core/java/android/webkit/LoadListener.java @@ -380,7 +380,8 @@ class LoadListener extends Handler implements EventHandler { } // At this point, mMimeType has been set to non-null. if (mIsMainPageLoader && mIsMainResourceLoader && mUserGesture && - Pattern.matches(XML_MIME_TYPE, mMimeType)) { + Pattern.matches(XML_MIME_TYPE, mMimeType) && + !mMimeType.equalsIgnoreCase("application/xhtml+xml")) { Intent i = new Intent(Intent.ACTION_VIEW); i.setDataAndType(Uri.parse(url()), mMimeType); ResolveInfo info = mContext.getPackageManager().resolveActivity(i, diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 61ff86cafd10..bbe52a345553 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -475,6 +475,7 @@ public class WebView extends AbsoluteLayout private static final int MOTIONLESS_FALSE = 0; private static final int MOTIONLESS_PENDING = 1; private static final int MOTIONLESS_TRUE = 2; + private static final int MOTIONLESS_IGNORE = 3; private int mHeldMotionless; // whether support multi-touch @@ -4923,9 +4924,6 @@ public class WebView extends AbsoluteLayout case TOUCH_DRAG_MODE: mPrivateHandler.removeMessages(DRAG_HELD_MOTIONLESS); mPrivateHandler.removeMessages(AWAKEN_SCROLL_BARS); - mHeldMotionless = MOTIONLESS_TRUE; - // redraw in high-quality, as we're done dragging - invalidate(); // if the user waits a while w/o moving before the // up, we don't want to do a fling if (eventTime - mLastTouchTime <= MIN_FLING_TIME) { @@ -4937,9 +4935,16 @@ public class WebView extends AbsoluteLayout + mDeferTouchProcess); } mVelocityTracker.addMovement(ev); + // set to MOTIONLESS_IGNORE so that it won't keep + // removing and sending message in + // drawCoreAndCursorRing() + mHeldMotionless = MOTIONLESS_IGNORE; doFling(); break; } + // redraw in high-quality, as we're done dragging + mHeldMotionless = MOTIONLESS_TRUE; + invalidate(); // fall through case TOUCH_DRAG_START_MODE: // TOUCH_DRAG_START_MODE should not happen for the real diff --git a/core/jni/android_net_TrafficStats.cpp b/core/jni/android_net_TrafficStats.cpp index db8fdf2d4b56..ff46bdd2ba39 100644 --- a/core/jni/android_net_TrafficStats.cpp +++ b/core/jni/android_net_TrafficStats.cpp @@ -32,6 +32,7 @@ namespace android { // Returns an ASCII decimal number read from the specified file, -1 on error. static jlong readNumber(char const* filename) { +#ifdef HAVE_ANDROID_OS char buf[80]; int fd = open(filename, O_RDONLY); if (fd < 0) { @@ -49,6 +50,9 @@ static jlong readNumber(char const* filename) { close(fd); buf[len] = '\0'; return atoll(buf); +#else // Simulator + return -1; +#endif } // Return the number from the first file which exists and contains data @@ -60,6 +64,7 @@ static jlong tryBoth(char const* a, char const* b) { // Returns the sum of numbers from the specified path under /sys/class/net/*, // -1 if no such file exists. static jlong readTotal(char const* suffix) { +#ifdef HAVE_ANDROID_OS char filename[PATH_MAX] = "/sys/class/net/"; DIR *dir = opendir(filename); if (dir == NULL) { @@ -81,6 +86,9 @@ static jlong readTotal(char const* suffix) { closedir(dir); return total; +#else // Simulator + return -1; +#endif } // Mobile stats get accessed a lot more often than total stats. |