Merge "Fix potential ASurfaceTransactionCallback leaks" into sc-dev

This commit is contained in:
Huihong Luo
2021-06-17 16:32:06 +00:00
committed by Android (Google) Code Review
2 changed files with 34 additions and 4 deletions

View File

@@ -753,8 +753,12 @@ public class HardwareRenderer {
nCancelLayerUpdate(mNativeProxy, layer.getDeferredLayerUpdater());
}
private ASurfaceTransactionCallback mASurfaceTransactionCallback;
/** @hide */
public void setASurfaceTransactionCallback(ASurfaceTransactionCallback callback) {
// ensure callback is kept alive on the java side since weak ref is used in native code
mASurfaceTransactionCallback = callback;
nSetASurfaceTransactionCallback(mNativeProxy, callback);
}