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

Commit 2a1b07f1 authored by Santiago Seifert's avatar Santiago Seifert
Browse files

Simplify looper selection when instantiating MediaSession

This change essentially replaces new Handler().getLooper() with
Looper.myLooper().

Bug: 205124386
Change-Id: If2d9664d6844cf4fa2cb97b3724854db506985a3
Test: Presubmit.
parent 14fed442
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -244,12 +244,9 @@ public final class MediaSession {
                mCallback = null;
                return;
            }
            if (handler == null) {
                handler = new Handler();
            }
            Looper looper = handler != null ? handler.getLooper() : Looper.myLooper();
            callback.mSession = this;
            CallbackMessageHandler msgHandler = new CallbackMessageHandler(handler.getLooper(),
                    callback);
            CallbackMessageHandler msgHandler = new CallbackMessageHandler(looper, callback);
            mCallback = msgHandler;
        }
    }