Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6106c360 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Tag some "new Binder()" instances to detect leaks.

We've seen evidence of a Binder leak, and our hunch is that it's
caused by one of these anonymous "new Binder()" sites.  Adding
descriptors will help us identify the leak cause.

Bug: 192415943
Test: atest BluetoothInstrumentationTests
Change-Id: I30cd15f084cf50f67edd833b27b853c4b22e1db1
parent 2cae3b9c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -120,6 +120,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 */
public final class BluetoothAdapter {
    private static final String TAG = "BluetoothAdapter";
    private static final String DESCRIPTOR = "android.bluetooth.BluetoothAdapter";
    private static final boolean DBG = true;
    private static final boolean VDBG = false;

@@ -805,7 +806,7 @@ public final class BluetoothAdapter {
        mManagerService = Objects.requireNonNull(managerService);
        mAttributionSource = Objects.requireNonNull(attributionSource);
        mLeScanClients = new HashMap<LeScanCallback, ScanCallback>();
        mToken = new Binder();
        mToken = new Binder(DESCRIPTOR);
    }

    /**