[core] Fix resend when system server dies while sending (#1089)

This commit is contained in:
LoveSy 2021-09-09 21:09:34 +08:00 committed by GitHub
parent 8ea11021d8
commit 8641aab22c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -139,7 +139,8 @@ public class BridgeService {
bridgeService.linkToDeath(bridgeRecipient, 0);
} catch (Throwable e) {
Log.w(TAG, "linkToDeath " + Log.getStackTraceString(e));
sendToBridge(binder, false);
var snapshot = bridgeService;
sendToBridge(binder, snapshot == null || !snapshot.isBinderAlive());
return;
}
@ -158,6 +159,9 @@ public class BridgeService {
reply.readException();
} catch (Throwable e) {
Log.e(TAG, "send binder " + Log.getStackTraceString(e));
var snapshot = bridgeService;
sendToBridge(binder, snapshot == null || !snapshot.isBinderAlive());
return;
} finally {
data.recycle();
reply.recycle();