Merge "Fix android.util.CloseGuard sample usage"

am: 7381525076

Change-Id: I4e69d9638ca69be5896bfeb0c3d950d340294cb5
This commit is contained in:
David Su
2019-12-18 10:26:02 -08:00
committed by android-build-merger

View File

@@ -38,6 +38,11 @@ import android.annotation.NonNull;
* public void cleanup() {
* guard.close();
* ...;
* if (Build.VERSION.SDK_INT >= 28) {
* Reference.reachabilityFence(this);
* }
* // For full correctness in the absence of a close() call, other methods may also need
* // reachabilityFence() calls.
* }
*
* protected void finalize() throws Throwable {
@@ -75,7 +80,9 @@ import android.annotation.NonNull;
* public void cleanup() {
* guard.close();
* ...;
* Reference.reachabilityFence(this);
* if (Build.VERSION.SDK_INT >= 28) {
* Reference.reachabilityFence(this);
* }
* // For full correctness in the absence of a close() call, other methods may also need
* // reachabilityFence() calls.
* }