Remove ApkAssets access in finalizer

ResourcesProvider#finalize called ApkAssets#close. ApkAssets#close is
called during ApkAssets#finalize. If a ResourcesProvider and its
corresponding ApkAssets are finalized concurrently, there may be a
chance that the ApkAsset could be finalized first and then
ResourcesProvider calls ApkAssets#close on the object that has already
been finalized.

This may not fix the bug, but there is no reason to close the ApkAsset
during finalization of the ResourcesProvider.

Bug: 159041693
Test: none
Change-Id: I317ca982df2e11a18ccd6c95c74565dbac417bd6
This commit is contained in:
Ryan Mitchell
2021-03-31 08:49:24 -07:00
parent b50914c524
commit 9ff600f60a

View File

@@ -284,11 +284,6 @@ public class ResourcesProvider implements AutoCloseable, Closeable {
Log.w(TAG, "ResourcesProvider " + this + " finalized with non-zero refs: "
+ mOpenCount);
}
if (mOpen) {
mOpen = false;
mApkAssets.close();
}
}
}
}