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

Commit 0d3315a3 authored by Sungsoo Lim's avatar Sungsoo Lim
Browse files

MediaBrowser: Make forceCloseConnection() be called in the same thread

Bug: 26508006
Change-Id: I465aca6f9b9acf2cf30c2f324dc91fea1301baad
parent 81a713b0
Loading
Loading
Loading
Loading
+18 −14
Original line number Diff line number Diff line
@@ -212,6 +212,9 @@ public final class MediaBrowser {
        // It's ok to call this any state, because allowing this lets apps not have
        // to check isConnected() unnecessarily. They won't appreciate the extra
        // assertions for this. We do everything we can here to go back to a sane state.
        mHandler.post(new Runnable() {
            @Override
            public void run() {
                if (mServiceCallbacks != null) {
                    try {
                        mServiceBinder.disconnect(mServiceCallbacks);
@@ -222,12 +225,13 @@ public final class MediaBrowser {
                    }
                }
                forceCloseConnection();

                if (DBG) {
                    Log.d(TAG, "disconnect...");
                    dump();
                }
            }
        });
    }

    /**
     * Null out the variables and unbind from the service. This doesn't include