summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-01-27 15:41:08 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-01-27 15:41:08 -0800
commit0250bc2faca14a332155b9111e0ee5dfc8493d6a (patch)
tree98333a2c01e0bf519c6a5566efaacb9e19488ae3
parent8f9fb94741b5032c8774f87130133ef14d9af4e2 (diff)
parentfea12b87f2988f20ea87314c4a1b47e1a0f4d95e (diff)
downloadframeworks_base-0250bc2faca14a332155b9111e0ee5dfc8493d6a.zip
frameworks_base-0250bc2faca14a332155b9111e0ee5dfc8493d6a.tar.gz
frameworks_base-0250bc2faca14a332155b9111e0ee5dfc8493d6a.tar.bz2
Merge "Catch exception when ViewRoot's surface is not valid. Bug #3399426" into honeycomb
-rw-r--r--core/java/android/view/ViewRoot.java1
-rw-r--r--core/jni/android_view_Surface.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index 41fc6c6..b21af41 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -1537,6 +1537,7 @@ public final class ViewRoot extends Handler implements ViewParent,
int top = dirty.top;
int right = dirty.right;
int bottom = dirty.bottom;
+
canvas = surface.lockCanvas(dirty);
if (left != dirty.left || top != dirty.top || right != dirty.right ||
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index e4af33f..aa9c107 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -296,8 +296,10 @@ static inline SkBitmap::Config convertPixelFormat(PixelFormat format)
static jobject Surface_lockCanvas(JNIEnv* env, jobject clazz, jobject dirtyRect)
{
const sp<Surface>& surface(getSurface(env, clazz));
- if (!Surface::isValid(surface))
+ if (!Surface::isValid(surface)) {
+ doThrow(env, "java/lang/IllegalArgumentException", NULL);
return 0;
+ }
// get dirty region
Region dirtyRegion;