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

Commit eb298dfa authored by Lifu Tang's avatar Lifu Tang
Browse files

Clear the IBinder before calling unbindService

The IBinder becomes invalid when unbindService() is called. Clear the
reference to it to prevent the caller from accessing an already closed
Binder.

Bug: 69008332
Test: build and run on a device manually
Change-Id: Id3340ac2799afaa1ea131f116b803de029161172
parent 70164985
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -282,6 +282,7 @@ public class ServiceWatcher implements ServiceConnection {
        mBoundUserId = UserHandle.USER_NULL;
        if (component != null) {
            if (D) Log.d(mTag, "unbinding " + component);
            mBoundService = null;
            mContext.unbindService(this);
        }
    }