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

Commit b0af4d4f authored by Sangyun Yun's avatar Sangyun Yun Committed by Android (Google) Code Review
Browse files

Merge "Throw RuntimeException when looper is not prepared for deprecated API" into main

parents 57186e91 9ccc9144
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1508,8 +1508,14 @@ public class SubscriptionManager {
    public void addOnSubscriptionsChangedListener(OnSubscriptionsChangedListener listener) {
        if (listener == null) return;

        addOnSubscriptionsChangedListener(
                new HandlerExecutor(new Handler(listener.getCreatorLooper())), listener);
        Looper looper = listener.getCreatorLooper();
        if (looper == null) {
            throw new RuntimeException(
                    "Can't create handler inside thread " + Thread.currentThread()
                    + " that has not called Looper.prepare()");
        }

        addOnSubscriptionsChangedListener(new HandlerExecutor(new Handler(looper)), listener);
    }

    /**