Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0def143e authored by David Su's avatar David Su
Browse files

Fix android.util.CloseGuard sample usage

Updated first sample with `Reference.reachabilityFence(this)`
to be consistent with the second sample.

Bug: 145831809
Test: none
Change-Id: I8c625de4f36a8cd52a3825021ff631db62f04662
parent 0c472adb
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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();
 *          ...;
 *          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.
 *       }