Merge "Catch unbinding errors" into oc-mr1-dev

This commit is contained in:
TreeHugger Robot
2018-06-21 21:00:27 +00:00
committed by Android (Google) Code Review

View File

@@ -906,7 +906,11 @@ abstract public class ManagedServices {
Slog.w(TAG, getCaption() + " binding died: " + name); Slog.w(TAG, getCaption() + " binding died: " + name);
synchronized (mMutex) { synchronized (mMutex) {
mServicesBinding.remove(servicesBindingTag); mServicesBinding.remove(servicesBindingTag);
mContext.unbindService(this); try {
mContext.unbindService(this);
} catch (IllegalArgumentException e) {
Slog.e(TAG, "failed to unbind " + name, e);
}
if (!mServicesRebinding.contains(servicesBindingTag)) { if (!mServicesRebinding.contains(servicesBindingTag)) {
mServicesRebinding.add(servicesBindingTag); mServicesRebinding.add(servicesBindingTag);
mHandler.postDelayed(new Runnable() { mHandler.postDelayed(new Runnable() {