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

Commit 4f60f81b authored by RoboErik's avatar RoboErik Committed by Android (Google) Code Review
Browse files

Merge "Possible fix for dead handler in Music button event sending" into lmp-dev

parents ff4f6c88 9ff7dda9
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -191,11 +191,8 @@ public final class MediaSession {
                return;
            }
            if (mCallback != null) {
                if (mCallback.mCallback == callback) {
                    Log.w(TAG, "Tried to set same callback, ignoring");
                    return;
                }
                // We're changing callbacks, clear the session from the old one.
                // We're updating the callback, clear the session from the old
                // one.
                mCallback.mCallback.mSession = null;
            }
            if (handler == null) {
+1 −4
Original line number Diff line number Diff line
@@ -467,10 +467,7 @@ public class MediaSessionLegacyHelper {
                mSessions.remove(mPi);
            } else if (mCb == null) {
                mCb = new SessionCallback();
                Handler handler = null;
                if (Looper.myLooper() == null) {
                    handler = new Handler(Looper.getMainLooper());
                }
                Handler handler = new Handler(Looper.getMainLooper());
                mSession.setCallback(mCb, handler);
            }
        }