From 761e81f6a853cb0753a64ff3daf675793d5faa9c Mon Sep 17 00:00:00 2001 From: Sanguk Jeon Date: Wed, 2 Sep 2020 19:15:00 +0900 Subject: [PATCH] Ensure that binding state is false when handling dead binder When a binding is disconnected, it is expected that binderDied() is called after onBindingDied(). But, there exists a corner case where the order is reversed. In this case, binderDied() cancels the scheduling of MSG_UNBIND message, which blocks the chance of changing mBinding value as false. As a results, mBinding value remains as true even though the binding is disconnected. This would make the service as unresponsive when a client tries reconnecting to the service. This change ensures that mBinding becomes false even though binderDied() is called before onBindingDied(). Bug: b/162753393 Test: compile & verify basic functions working Change-Id: I66c5b130674a4355123fbac27f574d0d081e7b63 --- core/java/com/android/internal/infra/AbstractRemoteService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/java/com/android/internal/infra/AbstractRemoteService.java b/core/java/com/android/internal/infra/AbstractRemoteService.java index b2852eaeef2ad..722e5c102fcfd 100644 --- a/core/java/com/android/internal/infra/AbstractRemoteService.java +++ b/core/java/com/android/internal/infra/AbstractRemoteService.java @@ -225,6 +225,7 @@ public abstract class AbstractRemoteService