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
This commit is contained in:
@@ -2610,16 +2610,6 @@ public final class SurfaceControl implements Parcelable {
|
||||
= sRegistry.registerNativeAllocation(this, mNativeObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a transaction object that wraps a native peer.
|
||||
* @hide
|
||||
*/
|
||||
Transaction(long nativeObject) {
|
||||
mNativeObject = nativeObject;
|
||||
mFreeNativeResources =
|
||||
sRegistry.registerNativeAllocation(this, mNativeObject);
|
||||
}
|
||||
|
||||
private Transaction(Parcel in) {
|
||||
readFromParcel(in);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user