diff options
| author | Romain Guy <romainguy@google.com> | 2011-01-27 15:43:03 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-27 15:43:03 -0800 |
| commit | 01a5812902668d0dbba51cd0efe22bfba3711230 (patch) | |
| tree | 75a62df696da0831550ecf36d82759e4f5080d59 | |
| parent | f454cee04456acf74871b02033e6972f71919e55 (diff) | |
| parent | 0250bc2faca14a332155b9111e0ee5dfc8493d6a (diff) | |
| download | frameworks_base-01a5812902668d0dbba51cd0efe22bfba3711230.zip frameworks_base-01a5812902668d0dbba51cd0efe22bfba3711230.tar.gz frameworks_base-01a5812902668d0dbba51cd0efe22bfba3711230.tar.bz2 | |
am 0250bc2f: Merge "Catch exception when ViewRoot\'s surface is not valid. Bug #3399426" into honeycomb
* commit '0250bc2faca14a332155b9111e0ee5dfc8493d6a':
Catch exception when ViewRoot's surface is not valid. Bug #3399426
| -rw-r--r-- | core/java/android/view/ViewRoot.java | 1 | ||||
| -rw-r--r-- | core/jni/android_view_Surface.cpp | 4 |
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; |
