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

Commit 0eabe3dc authored by William Escande's avatar William Escande
Browse files

Errorprone: Finalize

Test: m Bluetooth
Bug: 344658662
Bug: 366307571
Flag: Exempt, enforce error in the futur
Change-Id: I76bef9346c4bad29e5e66002129cf538b590cd58
parent b3f7f5d9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -337,6 +337,7 @@ android_app {
            "-Xep:EmptyCatch:ERROR",
            "-Xep:EqualsGetClass:ERROR",
            "-Xep:FallThrough:ERROR",
            "-Xep:Finalize:ERROR",
            "-Xep:HidingField:ERROR",
            "-Xep:InlineMeInliner:ERROR",
            "-Xep:InvalidBlockTag:ERROR",
+0 −18
Original line number Diff line number Diff line
@@ -20,16 +20,6 @@ import android.util.Log;

public class AdapterApp extends Application {
    private static final String TAG = "BluetoothAdapterApp";
    // For Debugging only
    private static int sRefCount = 0;

    public AdapterApp() {
        super();
        synchronized (AdapterApp.class) {
            sRefCount++;
            Log.d(TAG, "REFCOUNT: Constructed " + this + " Instance Count = " + sRefCount);
        }
    }

    @Override
    public void onCreate() {
@@ -41,12 +31,4 @@ public class AdapterApp extends Application {
            Log.e(TAG, "Migration failure: ", e);
        }
    }

    @Override
    protected void finalize() {
        synchronized (AdapterApp.class) {
            sRefCount--;
            Log.d(TAG, "REFCOUNT: Finalized: " + this + ", Instance Count = " + sRefCount);
        }
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -301,6 +301,7 @@ public class BluetoothPbapCallLogComposer {
    }

    @Override
    @SuppressWarnings("Finalize") // TODO: b/366307571 remove override
    public void finalize() {
        if (!mTerminateIsCalled) {
            terminate();
+1 −0
Original line number Diff line number Diff line
@@ -213,6 +213,7 @@ public class BluetoothPbapSimVcardManager {
    }

    @Override
    @SuppressWarnings("Finalize") // TODO: b/366307571 remove override
    public void finalize() {
        if (!mTerminateIsCalled) {
            terminate();