diff options
| author | 2021-04-13 12:58:51 -0400 | |
|---|---|---|
| committer | 2021-04-13 12:58:51 -0400 | |
| commit | 7db8da8a1ecd3a6460ab1d73b7ed8e647acf6651 (patch) | |
| tree | 0b23a02c2c617002465a7c74315e03996896de07 | |
| parent | ae4d48ebec8b873d59ef70ccea13de0ebceb7354 (diff) | |
Remove CloseGuard from DisplayEventReceiver
Majority usage of DisplayEventReceiver is with Choreographer, which
is a thread-local. As such, it cannot have dispose() called on it
easily and dispose is also @hide. Since apps can't do anything
about this, and aren't really supposed to, remove the CloseGuard
as it just generates false-positive errors for 3p devs.
Fixes: 154358085
Test: none
Change-Id: I5e9e5324644967897f2b37a19f4fb1485b8ae5bb
| -rw-r--r-- | core/java/android/view/DisplayEventReceiver.java | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/core/java/android/view/DisplayEventReceiver.java b/core/java/android/view/DisplayEventReceiver.java index e6cd25275ca2..f69528472728 100644 --- a/core/java/android/view/DisplayEventReceiver.java +++ b/core/java/android/view/DisplayEventReceiver.java @@ -26,7 +26,6 @@ import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import dalvik.annotation.optimization.FastNative; -import dalvik.system.CloseGuard; import java.lang.ref.WeakReference; @@ -73,8 +72,6 @@ public abstract class DisplayEventReceiver { private static final String TAG = "DisplayEventReceiver"; - private final CloseGuard mCloseGuard = CloseGuard.get(); - @UnsupportedAppUsage private long mReceiverPtr; @@ -114,8 +111,6 @@ public abstract class DisplayEventReceiver { mMessageQueue = looper.getQueue(); mReceiverPtr = nativeInit(new WeakReference<DisplayEventReceiver>(this), mMessageQueue, vsyncSource, eventRegistration); - - mCloseGuard.open("dispose"); } @Override @@ -135,13 +130,6 @@ public abstract class DisplayEventReceiver { } private void dispose(boolean finalized) { - if (mCloseGuard != null) { - if (finalized) { - mCloseGuard.warnIfOpen(); - } - mCloseGuard.close(); - } - if (mReceiverPtr != 0) { nativeDispose(mReceiverPtr); mReceiverPtr = 0; |