summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-29 16:52:19 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-29 16:52:19 -0400
commit380ac10b1c694f791fa75b6f29493954b2596bd8 (patch)
treea035a22f3e8104fa1f3a3538c45f8027cb7fc6ba
parent49a33f8ca0ad04c57362edaf0692e9e3bffa1177 (diff)
parent4580057e772b60433272af5cd691825748892693 (diff)
downloadpackages_apps_Browser-380ac10b1c694f791fa75b6f29493954b2596bd8.zip
packages_apps_Browser-380ac10b1c694f791fa75b6f29493954b2596bd8.tar.gz
packages_apps_Browser-380ac10b1c694f791fa75b6f29493954b2596bd8.tar.bz2
Merge change Id9898b22 into eclair
* changes: Check to make sure the captured picture is non null before using.
-rw-r--r--src/com/android/browser/BrowserActivity.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 15f986e..d0ebc8b 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -2420,6 +2420,10 @@ public class BrowserActivity extends Activity
final ByteArrayOutputStream os
= new ByteArrayOutputStream();
Bitmap bm = createScreenshot(view);
+ if (bm == null) {
+ c.close();
+ return;
+ }
bm.compress(Bitmap.CompressFormat.PNG, 100, os);
values = new ContentValues();
values.put(Browser.BookmarkColumns.THUMBNAIL,
@@ -2470,6 +2474,9 @@ public class BrowserActivity extends Activity
private Bitmap createScreenshot(WebView view) {
Picture thumbnail = view.capturePicture();
+ if (thumbnail == null) {
+ return null;
+ }
Bitmap bm = Bitmap.createBitmap(getDesiredThumbnailWidth(this),
getDesiredThumbnailHeight(this), Bitmap.Config.ARGB_4444);
Canvas canvas = new Canvas(bm);