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

Commit c8955e07 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Tag some "new Binder()" instances to detect leaks." into sc-dev

parents c9564dd9 79b834d4
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);
    }

    /**
+5 −3
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ import java.util.Set;
 */
@Immutable
public final class AttributionSource implements Parcelable {
    private static final String DESCRIPTOR = "android.content.AttributionSource";

    private final @NonNull AttributionSourceState mAttributionSourceState;

    private @Nullable AttributionSource mNextCached;
@@ -95,7 +97,7 @@ public final class AttributionSource implements Parcelable {
    @TestApi
    public AttributionSource(int uid, @Nullable String packageName,
            @Nullable String attributionTag) {
        this(uid, packageName, attributionTag, new Binder());
        this(uid, packageName, attributionTag, new Binder(DESCRIPTOR));
    }

    /** @hide */
@@ -130,7 +132,7 @@ public final class AttributionSource implements Parcelable {

    AttributionSource(int uid, @Nullable String packageName, @Nullable String attributionTag,
            @Nullable String[] renouncedPermissions, @Nullable AttributionSource next) {
        this(uid, packageName, attributionTag, new Binder(), renouncedPermissions, next);
        this(uid, packageName, attributionTag, new Binder(DESCRIPTOR), renouncedPermissions, next);
    }

    AttributionSource(int uid, @Nullable String packageName, @Nullable String attributionTag,
@@ -541,7 +543,7 @@ public final class AttributionSource implements Parcelable {
            if ((mBuilderFieldsSet & 0x10) == 0) {
                mAttributionSourceState.next = null;
            }
            mAttributionSourceState.token = new Binder();
            mAttributionSourceState.token = new Binder(DESCRIPTOR);
            if (mAttributionSourceState.next == null) {
                // The NDK aidl backend doesn't support null parcelable arrays.
                mAttributionSourceState.next = new AttributionSourceState[0];