Only unbind if bind() returned success
ServiceConnection may become disconnected asynchonously for various
reasons so calling unbind() on a disconnected SC is actually handled
by the framework. What we don't want to do is call unbind() on a
service which we never successfully called bindService() on, so in this
CL we will track the client-side binding instead of the connection
status through callbacks. This is less racy and handles the root cause
of the exception.
(this is a CP of aosp/1231873)
Bug: 145661922
Test: manual
Change-Id: I72512f4da276ff5fa1bee2254b42fb938d3a0b20
Merged-In: I72512f4da276ff5fa1bee2254b42fb938d3a0b20
1 file changed