fix restore capture bug
Bug: 5101265
Not totally sure why this happens;
we keep the crash happening so but add some error log
line which will help us track down the cause of this
Change-Id: I409f8bd20b25a8411ab5e2592903efafd96a2432
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index a4bcc99..cd209ed 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -2041,7 +2041,12 @@
if (mCapture == null) {
return;
}
- mCapture.copyPixelsFromBuffer(ByteBuffer.wrap(blob));
+ ByteBuffer buffer = ByteBuffer.wrap(blob);
+ if (buffer.capacity() != blob.length) {
+ Log.e(LOGTAG, "Load capture has mismatched sizes: "
+ + buffer.capacity() + " vs " + blob.length);
+ }
+ mCapture.copyPixelsFromBuffer(buffer);
}
}