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

Commit 4d63c3ee authored by Felipe Leme's avatar Felipe Leme
Browse files

Removed CloseGuard check from ContentCaptureSession.

It's crashing some apps using fragments.

Test: atest CtsContentCaptureServiceTestCases
Bug: 123343114
Fixes: 123346127

Change-Id: Ieeb27fbe553584c3e9ce298d5accade2e8fb2495
parent 99eff853
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -34,8 +34,6 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.Preconditions;

import dalvik.system.CloseGuard;

import java.io.PrintWriter;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -148,9 +146,6 @@ public abstract class ContentCaptureSession implements AutoCloseable {
    @Retention(RetentionPolicy.SOURCE)
    @interface FlushReason{}


    private final CloseGuard mCloseGuard = CloseGuard.get();

    private final Object mLock = new Object();

    /**
@@ -185,7 +180,6 @@ public abstract class ContentCaptureSession implements AutoCloseable {
    @VisibleForTesting
    public ContentCaptureSession(@NonNull String id) {
        mId = Preconditions.checkNotNull(id);
        mCloseGuard.open("destroy");
    }

    /** @hide */
@@ -251,8 +245,6 @@ public abstract class ContentCaptureSession implements AutoCloseable {
            }
            mDestroyed = true;

            mCloseGuard.close();

            // TODO(b/111276913): check state (for example, how to handle if it's waiting for remote
            // id) and send it to the cache of batched commands
            if (VERBOSE) {
@@ -288,18 +280,6 @@ public abstract class ContentCaptureSession implements AutoCloseable {
        destroy();
    }

    @Override
    protected void finalize() throws Throwable {
        try {
            if (mCloseGuard != null) {
                mCloseGuard.warnIfOpen();
            }
            destroy();
        } finally {
            super.finalize();
        }
    }

    /**
     * Notifies the Content Capture Service that a node has been added to the view structure.
     *