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

Commit 8e5c9694 authored by William Escande's avatar William Escande
Browse files

ErrorProne: Enforce & fix FutureReturnValueIgnored

See https://errorprone.info/bugpattern/FutureReturnValueIgnored

Bug: 344658662
Test: m BluetoothInstrumentationTests
Flag: Exempt Build and test only
Change-Id: If9eb0657831044bc9e30a6328b46504f227eabd7
parent 287fe9d8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ java_defaults {
            "-Xep:CatchFail:ERROR",
            "-Xep:ClassCanBeStatic:ERROR",
            "-Xep:EmptyCatch:ERROR",
            "-Xep:FutureReturnValueIgnored:ERROR",
            "-Xep:InlineMeInliner:ERROR",
            "-Xep:InvalidBlockTag:ERROR",
            "-Xep:InvalidInlineTag:ERROR",
+18 −4
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ import org.mockito.junit.MockitoRule;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;

@MediumTest
@RunWith(AndroidJUnit4.class)
@@ -1176,7 +1177,10 @@ public class AudioRoutingManagerTest {
        if (device == null) {
            mAudioRoutingManager.removeActiveDevice(BluetoothProfile.A2DP, false);
        } else {
            CompletableFuture<Boolean> future =
                    mAudioRoutingManager.activateDeviceProfile(device, BluetoothProfile.A2DP);
            mTestLooper.dispatchAll();
            future.join();
        }
    }

@@ -1225,7 +1229,10 @@ public class AudioRoutingManagerTest {
        if (device == null) {
            mAudioRoutingManager.removeActiveDevice(BluetoothProfile.HEADSET, false);
        } else {
            CompletableFuture<Boolean> future =
                    mAudioRoutingManager.activateDeviceProfile(device, BluetoothProfile.HEADSET);
            mTestLooper.dispatchAll();
            future.join();
        }
    }

@@ -1268,7 +1275,11 @@ public class AudioRoutingManagerTest {
        if (device == null) {
            mAudioRoutingManager.removeActiveDevice(BluetoothProfile.HEARING_AID, false);
        } else {
            mAudioRoutingManager.activateDeviceProfile(device, BluetoothProfile.HEARING_AID);
            CompletableFuture<Boolean> future =
                    mAudioRoutingManager.activateDeviceProfile(
                            device, BluetoothProfile.HEARING_AID);
            mTestLooper.dispatchAll();
            future.join();
        }
    }

@@ -1309,7 +1320,10 @@ public class AudioRoutingManagerTest {
        if (device == null) {
            mAudioRoutingManager.removeActiveDevice(BluetoothProfile.LE_AUDIO, false);
        } else {
            CompletableFuture<Boolean> future =
                    mAudioRoutingManager.activateDeviceProfile(device, BluetoothProfile.LE_AUDIO);
            mTestLooper.dispatchAll();
            future.join();
        }
    }

+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ java_sdk_library {
            "-Xep:CatchFail:ERROR",
            "-Xep:ClassCanBeStatic:ERROR",
            "-Xep:EmptyCatch:ERROR",
            "-Xep:FutureReturnValueIgnored:ERROR",
            "-Xep:InlineMeInliner:ERROR",
            "-Xep:InvalidBlockTag:ERROR",
            "-Xep:InvalidInlineTag:ERROR",
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ java_defaults {
            "-Xep:ClassCanBeStatic:ERROR",
            "-Xep:EmptyCatch:ERROR",
            "-Xep:EqualsIncompatibleType:ERROR",
            "-Xep:FutureReturnValueIgnored:ERROR",
            "-Xep:InlineMeInliner:ERROR",
            "-Xep:InvalidBlockTag:ERROR",
            "-Xep:InvalidInlineTag:ERROR",