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

Commit b21e0c5b authored by Shai Barack's avatar Shai Barack
Browse files

Prepare for removing app access to some MessageQueue internals

MessageQueue's mMessages and next() are used by reflection
in some tests. There is now a public alternative.

Update the @UnsupportedAppUsage annotation to note our
intention to remove app access.
Reference TestLooperManager as the alternative.

go/new-mq-appcompat

Bug: 379472827
Flag: EXEMPT Javadoc
Change-Id: I1bf8d54b8f3eafc375da3b198c2c661bf5226fb4
parent 2cd23de9
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -76,8 +76,13 @@ public final class MessageQueue {
    @SuppressWarnings("unused")
    private long mPtr; // used by native code

    @UnsupportedAppUsage
    @UnsupportedAppUsage(
            maxTargetSdk = Build.VERSION_CODES.BAKLAVA,
            publicAlternatives =
                    "To manipulate the queue in Instrumentation tests, use {@link"
                        + " android.os.TestLooperManager}")
    Message mMessages;

    private Message mLast;
    @UnsupportedAppUsage
    private final ArrayList<IdleHandler> mIdleHandlers = new ArrayList<IdleHandler>();
@@ -995,7 +1000,11 @@ public final class MessageQueue {
        }
    }

    @UnsupportedAppUsage
    @UnsupportedAppUsage(
            maxTargetSdk = Build.VERSION_CODES.BAKLAVA,
            publicAlternatives =
                    "To manipulate the queue in Instrumentation tests, use {@link"
                        + " android.os.TestLooperManager}")
    Message next() {
        if (mUseConcurrent) {
            return nextConcurrent();