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

Commit ecb8ebc8 authored by Yao Chen's avatar Yao Chen Committed by Android Git Automerger
Browse files

am 000dd0f8: am 86d77815: Merge "Check the return value of bindService, and...

am 000dd0f8: am 86d77815: Merge "Check the return value of bindService, and notify media browser client onConnectionFailed if it returns false." into lmp-dev

* commit '000dd0f8887ec32725cc8e9b44a8fe79543daf0d':
  Check the return value of bindService, and notify media browser client onConnectionFailed if it returns false.
parents 65757382 d611fc10
Loading
Loading
Loading
Loading
+14 −9
Original line number Original line Diff line number Diff line
@@ -141,11 +141,16 @@ public final class MediaBrowser {


        final ServiceConnection thisConnection = mServiceConnection = new MediaServiceConnection();
        final ServiceConnection thisConnection = mServiceConnection = new MediaServiceConnection();


        boolean bound = false;
        try {
        try {
            mContext.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE);
            if (mContext.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE)) {
                bound = true;
            }
        } catch (Exception ex) {
        } catch (Exception ex) {
            Log.e(TAG, "Failed binding to service " + mServiceComponent);
            Log.e(TAG, "Failed binding to service " + mServiceComponent);
        }


        if (!bound) {
            // Tell them that it didn't work.  We are already on the main thread,
            // Tell them that it didn't work.  We are already on the main thread,
            // but we don't want to do callbacks inside of connect().  So post it,
            // but we don't want to do callbacks inside of connect().  So post it,
            // and then check that we are on the same ServiceConnection.  We know
            // and then check that we are on the same ServiceConnection.  We know