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

Commit 11822c79 authored by Daniel Kim's avatar Daniel Kim
Browse files

Revert "DCL is broken and should not be used."

This reverts commit ab0cbeff.

Reason for revert: Droidmonitor-triggered revert due to breakage
Bug: b/243389642

Change-Id: I2121840da7bba800d3a6fbe2228ce70c952d11e6
parent ab0cbeff
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -9,4 +9,3 @@ android.net.rtp.AudioGroup
android.net.rtp.AudioStream
android.net.rtp.RtpStream
java.util.concurrent.ThreadLocalRandom
com.android.internal.jank.InteractionJankMonitor$InstanceHolder
+10 −5
Original line number Diff line number Diff line
@@ -292,10 +292,7 @@ public class InteractionJankMonitor {
            UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__SHADE_CLEAR_ALL,
    };

    private static class InstanceHolder {
        public static final InteractionJankMonitor INSTANCE =
            new InteractionJankMonitor(new HandlerThread(DEFAULT_WORKER_NAME));
    }
    private static volatile InteractionJankMonitor sInstance;

    private final DeviceConfig.OnPropertiesChangedListener mPropertiesChangedListener =
            this::updateProperties;
@@ -387,7 +384,15 @@ public class InteractionJankMonitor {
     * @return instance of InteractionJankMonitor
     */
    public static InteractionJankMonitor getInstance() {
        return InstanceHolder.INSTANCE;
        // Use DCL here since this method might be invoked very often.
        if (sInstance == null) {
            synchronized (InteractionJankMonitor.class) {
                if (sInstance == null) {
                    sInstance = new InteractionJankMonitor(new HandlerThread(DEFAULT_WORKER_NAME));
                }
            }
        }
        return sInstance;
    }

    /**