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

Commit 7300c9f3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Finalize BulkCursorNative asynchronously" into main

parents a7c041ab 1739413a
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -212,9 +212,16 @@ final class BulkCursorProxy implements IBulkCursor {
        Parcel reply = Parcel.obtain();
        try {
            data.writeInterfaceToken(IBulkCursor.descriptor);

            mRemote.transact(CLOSE_TRANSACTION, data, reply, 0);
            // If close() is being called from the finalizer thread, do not wait for a reply from
            // the remote side.
            final boolean fromFinalizer =
                    android.database.sqlite.Flags.onewayFinalizerClose()
                    && "FinalizerDaemon".equals(Thread.currentThread().getName());
            mRemote.transact(CLOSE_TRANSACTION, data, reply,
                    fromFinalizer ? IBinder.FLAG_ONEWAY: 0);
            if (!fromFinalizer) {
                DatabaseUtils.readExceptionFromParcel(reply);
            }
        } finally {
            data.recycle();
            reply.recycle();
@@ -282,4 +289,3 @@ final class BulkCursorProxy implements IBulkCursor {
        }
    }
}
+7 −0
Original line number Diff line number Diff line
package: "android.database.sqlite"
container: "system"

flag {
     name: "oneway_finalizer_close"
     namespace: "system_performance"
     description: "Make BuildCursorNative.close oneway if in the the finalizer"
     bug: "368221351"
}

flag {
     name: "sqlite_apis_35"
     is_exported: true