summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/net/Uri.java3
-rw-r--r--core/java/android/os/Process.java18
-rw-r--r--core/java/android/webkit/WebView.java37
3 files changed, 58 insertions, 0 deletions
diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java
index eca4569..47faaba 100644
--- a/core/java/android/net/Uri.java
+++ b/core/java/android/net/Uri.java
@@ -1588,6 +1588,9 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
break;
}
final int equalsIndex = keyIndex + encodedKeyLength;
+ if (equalsIndex >= query.length()) {
+ break;
+ }
if (query.charAt(equalsIndex) != '=') {
encodedKeySearchIndex = equalsIndex + 1;
continue;
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 4887783..5640a06 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -747,6 +747,24 @@ public class Process {
*/
public static final native void sendSignal(int pid, int signal);
+ /**
+ * @hide
+ * Private impl for avoiding a log message... DO NOT USE without doing
+ * your own log, or the Android Illuminati will find you some night and
+ * beat you up.
+ */
+ public static final void killProcessQuiet(int pid) {
+ sendSignalQuiet(pid, SIGNAL_KILL);
+ }
+
+ /**
+ * @hide
+ * Private impl for avoiding a log message... DO NOT USE without doing
+ * your own log, or the Android Illuminati will find you some night and
+ * beat you up.
+ */
+ public static final native void sendSignalQuiet(int pid, int signal);
+
/** @hide */
public static final native long getFreeMemory();
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 6b316ce..f921caa 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -30,10 +30,12 @@ import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Interpolator;
+import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Picture;
import android.graphics.Point;
import android.graphics.Rect;
+import android.graphics.RectF;
import android.graphics.Region;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
@@ -1994,6 +1996,23 @@ public class WebView extends AbsoluteLayout
}
/**
+ * Given a x coordinate in view space, convert it to content space.
+ * Returns the result as a float.
+ */
+ private float viewToContentXf(int x) {
+ return x * mInvActualScale;
+ }
+
+ /**
+ * Given a y coordinate in view space, convert it to content space.
+ * Takes into account the height of the title bar if there is one
+ * embedded into the WebView. Returns the result as a float.
+ */
+ private float viewToContentYf(int y) {
+ return (y - getTitleHeight()) * mInvActualScale;
+ }
+
+ /**
* Given a distance in content space, convert it to view space. Note: this
* does not reflect translation, just scaling, so this should not be called
* with coordinates, but should be called for dimensions like width or
@@ -2230,6 +2249,24 @@ public class WebView extends AbsoluteLayout
r.bottom = Math.min(viewToContentY(r.bottom), mContentHeight);
}
+ // Sets r to be our visible rectangle in content coordinates. We use this
+ // method on the native side to compute the position of the fixed layers.
+ // Uses floating coordinates (necessary to correctly place elements when
+ // the scale factor is not 1)
+ private void calcOurContentVisibleRectF(RectF r) {
+ Rect ri = new Rect(0,0,0,0);
+ calcOurVisibleRect(ri);
+ // pin the rect to the bounds of the content
+ r.left = Math.max(viewToContentXf(ri.left), 0.0f);
+ // viewToContentY will remove the total height of the title bar. Add
+ // the visible height back in to account for the fact that if the title
+ // bar is partially visible, the part of the visible rect which is
+ // displaying our content is displaced by that amount.
+ r.top = Math.max(viewToContentYf(ri.top + getVisibleTitleHeight()), 0.0f);
+ r.right = Math.min(viewToContentXf(ri.right), (float)mContentWidth);
+ r.bottom = Math.min(viewToContentYf(ri.bottom), (float)mContentHeight);
+ }
+
static class ViewSizeData {
int mWidth;
int mHeight;