Fix remaining createScreenshot references
Fixed references to createScreenshot method which was returning a null
bitmap. createScreenshot method was implemented using the older
getViewportBitmap synchronous API which was deprecated. WebView exposes
an asynchronous method getContentBitmapAsync to retrieve a bitmap of the
current view. Modified calls to use the getContentBitmapAsync API.
This also fixes the issue seen where an async task was fired in a loop
to retrieve the bitmap resulting in wasted CPU cycles.
Change-Id: Ic6d8385d41d90c58fdffcebcbca7ebd68381530f
diff --git a/src/com/android/browser/SnapshotTab.java b/src/com/android/browser/SnapshotTab.java
index e403dbc..7f87cf2 100644
--- a/src/com/android/browser/SnapshotTab.java
+++ b/src/com/android/browser/SnapshotTab.java
@@ -20,6 +20,7 @@
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
+import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.AsyncTask;
@@ -103,9 +104,9 @@
}
@Override
- public ContentValues createSnapshotValues() {
+ public ContentValues createSnapshotValues(Bitmap bm) {
if (mIsLive) {
- return super.createSnapshotValues();
+ return super.createSnapshotValues(bm);
}
return null;
}