Handle onBindingDied in ODI services correctly
Note: this is a fix targeting only ODI related impls of ServiceConnector. The actual fix for ServiceConnector as whole is to made in I990f5139e40df2590b767c48bb4768ec777d49a5 which will be checked in as a long term solution under b/418214801 - As detailed in b/415190060#comment22, the binderDied() and onBindingDied() implementation was marking mService=null, leading to the underlying ServiceConnection not calling unbindService, this change fixes that behavior for onBindingDied case. - To avoid race between binderThread and mHandlerThread serving ServiceConnection callbacks, we ensure all work in `binderDied()` callback is also scheduled on the mHandlerThread. - Also, since whenever onBindingDied would be invoked, we would also have an associated binderDied death-receipt, we propagate ServiceLifecycleCallback#onBinderDied incase of binderDied() only. This avoids duplicate signals to clients. Bug: 415190060 Test: tested behavior locally Flag: EXEMPT bugfix Change-Id: If1730d697d4b6ea96f1e45af03dbe22a95733b9a
Loading
Please register or sign in to comment