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

Commit 5687f159 authored by David Duarte's avatar David Duarte
Browse files

ProfileService: Change `start` return to void

All implementations of ProfileService#start always return true.

So the return is changed from boolean to void to be able to remove
all checks of ProfileService#start's return value and simplify
the callers.

Bug: 319112725
Test: m Bluetooth BluetoothInstrumentationTests
Flag: Exempt, mechanical refactor
Change-Id: Icffc4065bdd8ff680804ccb934cee0c22dcb3011
parent 7ba1bfbe
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ public class A2dpService extends ProfileService {
    }

    @Override
    protected boolean start() {
    protected void start() {
        Log.i(TAG, "start()");
        if (sA2dpService != null) {
            throw new IllegalStateException("start() called twice");
@@ -204,8 +204,6 @@ public class A2dpService extends ProfileService {

        // Step 9: Clear active device
        removeActiveDevice(false);

        return true;
    }

    @Override
+1 −2
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ public class A2dpSinkService extends ProfileService {
    }

    @Override
    protected boolean start() {
    protected void start() {
        mAdapterService =
                requireNonNull(
                        AdapterService.getAdapterService(),
@@ -110,7 +110,6 @@ public class A2dpSinkService extends ProfileService {
        }

        setA2dpSinkService(this);
        return true;
    }

    @Override
+1 −2
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ public class AvrcpTargetService extends ProfileService {
    }

    @Override
    protected boolean start() {
    protected void start() {
        if (sInstance != null) {
            throw new IllegalStateException("start() called twice");
        }
@@ -241,7 +241,6 @@ public class AvrcpTargetService extends ProfileService {

        // Only allow the service to be used once it is initialized
        sInstance = this;
        return true;
    }

    @Override
+1 −2
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ public class AvrcpControllerService extends ProfileService {
    }

    @Override
    protected synchronized boolean start() {
    protected synchronized void start() {
        mNativeInterface.init(this);
        setComponentAvailable(ON_ERROR_SETTINGS_ACTIVITY, true);
        mAdapterService = AdapterService.getAdapterService();
@@ -166,7 +166,6 @@ public class AvrcpControllerService extends ProfileService {
        Intent startIntent = new Intent(this, BluetoothMediaBrowserService.class);
        startService(startIntent);
        setActiveDevice(null);
        return true;
    }

    @Override
+1 −3
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ public class BatteryService extends ProfileService {
    }

    @Override
    protected boolean start() {
    protected void start() {
        if (DBG) {
            Log.d(TAG, "start()");
        }
@@ -99,8 +99,6 @@ public class BatteryService extends ProfileService {
        mStateMachinesThread.start();

        setBatteryService(this);

        return true;
    }

    @Override
Loading