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

Commit 2166933f authored by Insun Kang's avatar Insun Kang
Browse files

Resolve hidden API usage of Handler constructor

Previous code uses hidden constructor of Handler to set its messages
to be asynchronous. This replaces it with Message#setAsynchronous(),
which is public.

Bug: 122047488
Test: build
Change-Id: I06a958d1bea1c3c0f104c4380fce6084f8e7bad9
parent 3f215a1d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1154,7 +1154,7 @@ public final class MediaController {
        private boolean mRegistered = false;

        public MessageHandler(Looper looper, MediaController.Callback cb) {
            super(looper, null, true);
            super(looper);
            mCallback = cb;
        }

@@ -1193,6 +1193,7 @@ public final class MediaController {

        public void post(int what, Object obj, Bundle data) {
            Message msg = obtainMessage(what, obj);
            msg.setAsynchronous(true);
            msg.setData(data);
            msg.sendToTarget();
        }
+2 −1
Original line number Diff line number Diff line
@@ -1453,7 +1453,7 @@ public final class MediaSession {
        private RemoteUserInfo mCurrentControllerInfo;

        public CallbackMessageHandler(Looper looper, MediaSession.Callback callback) {
            super(looper, null, true);
            super(looper);
            mCallback = callback;
            mCallback.mHandler = this;
        }
@@ -1461,6 +1461,7 @@ public final class MediaSession {
        public void post(RemoteUserInfo caller, int what, Object obj, Bundle data, long delayMs) {
            Pair<RemoteUserInfo, Object> objWithCaller = Pair.create(caller, obj);
            Message msg = obtainMessage(what, objWithCaller);
            msg.setAsynchronous(true);
            msg.setData(data);
            if (delayMs > 0) {
                sendMessageDelayed(msg, delayMs);