summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewRootImpl.java
diff options
context:
space:
mode:
authorHuihong Luo <huisinro@google.com>2021-06-24 10:04:32 -0700
committerHuihong Luo <huisinro@google.com>2021-06-24 11:10:06 -0700
commit4df4151bc0b45208bb0318dca2f03b8ff036a1ce (patch)
treec863bde09315c25664e2a1b12d5b417b739a710f /core/java/android/view/ViewRootImpl.java
parentef1bb2c9fab128b2a9ee869f295b41954629b98f (diff)
Fix a crash caused by transaction
A native transaction passed from webview is sent back to native side, so java side does not manage the life cycle of the transaction. Bug: 191414767 Test: Play a video, switch to another app, wait for 10 seconds Change-Id: I013052c202b445438d6cb6497f5f9a2fc22a2b85
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
-rw-r--r--core/java/android/view/ViewRootImpl.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 210f10c10ad1..5a248af7a097 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1371,8 +1371,12 @@ public final class ViewRootImpl implements ViewParent,
HardwareRenderer.ASurfaceTransactionCallback callback = (nativeTransactionObj,
nativeSurfaceControlObj,
frameNr) -> {
- Transaction t = new Transaction(nativeTransactionObj);
- mergeWithNextTransaction(t, frameNr);
+ if (mBlastBufferQueue == null) {
+ return false;
+ } else {
+ mBlastBufferQueue.mergeWithNextTransaction(nativeTransactionObj, frameNr);
+ return true;
+ }
};
mAttachInfo.mThreadedRenderer.setASurfaceTransactionCallback(callback);
}