Fix parcel recycling when no response from bridge

In case that there is no response from bridge, a second try of sending
binder will cause the (unowned) parcels to be recycled twice.
This commit is contained in:
JingMatrix 2024-11-23 23:12:37 +01:00
parent 1b98e55cfc
commit 0a2f26fef9
1 changed files with 2 additions and 2 deletions

View File

@ -126,11 +126,11 @@ public class BridgeService {
return;
}
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
boolean res = false;
// try at most three times
for (int i = 0; i < 3; i++) {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
try {
data.writeInterfaceToken(DESCRIPTOR);
data.writeInt(ACTION.ACTION_SEND_BINDER.ordinal());