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

Commit 39b90592 authored by Mark Fasheh's avatar Mark Fasheh Committed by Android (Google) Code Review
Browse files

Merge "Add isBlockedOnSyncBarrier() method to TestLooperManager" into main

parents 250dab24 ed7fe53c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34765,6 +34765,7 @@ package android.os {
    method public android.os.MessageQueue getMessageQueue();
    method public boolean hasMessages(android.os.Handler, Object, int);
    method public boolean hasMessages(android.os.Handler, Object, Runnable);
    method @FlaggedApi("android.os.message_queue_testability") public boolean isBlockedOnSyncBarrier();
    method public android.os.Message next();
    method @FlaggedApi("android.os.message_queue_testability") @Nullable public Long peekWhen();
    method @FlaggedApi("android.os.message_queue_testability") @Nullable public android.os.Message pop();
+12 −0
Original line number Diff line number Diff line
@@ -122,6 +122,18 @@ public class TestLooperManager {
        return mQueue.peekWhenForTest();
    }

    /**
     * Checks whether the Looper is currently blocked on a sync barrier.
     *
     * A Looper is blocked on a sync barrier if there is a Message in the Looper's
     * queue that is ready for execution but is behind a sync barrier
     */
    @FlaggedApi(Flags.FLAG_MESSAGE_QUEUE_TESTABILITY)
    public boolean isBlockedOnSyncBarrier() {
        checkReleased();
        return mQueue.isBlockedOnSyncBarrier();
    }

    /**
     * Releases the looper to continue standard looping and processing of messages, no further
     * interactions with TestLooperManager will be allowed after release() has been called.