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

Commit c96b611d authored by Rubin Xu's avatar Rubin Xu
Browse files

KeyChain: always unbind service

Context.unbindService() should always be called even if the
previous bindService() call returns false. Otherwise the service
might be left dangling.

Bug: 211582968
Test: None
Change-Id: Ic1705096254afa12993d8992303432896bfecd57
parent 80c4b33d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,7 @@ public final class KeyChain {
                    intent, keyChainServiceConnection, Context.BIND_AUTO_CREATE, user);
        }
        if (!bindSucceed) {
            context.unbindService(keyChainServiceConnection);
            throw new AssertionError("could not bind to KeyChainService");
        }
        countDownLatch.await();