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

Commit dd40a4e5 authored by David Duarte's avatar David Duarte Committed by Gerrit Code Review
Browse files

Merge changes I6df75628,Icffc4065 into main

* changes:
  ProfileService: Change `stop` return to void
  ProfileService: Change `start` return to void
parents e205c8e6 70575ab3
Loading
Loading
Loading
Loading
+3 −7
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,16 +204,14 @@ public class A2dpService extends ProfileService {

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

        return true;
    }

    @Override
    protected boolean stop() {
    protected void stop() {
        Log.i(TAG, "stop()");
        if (sA2dpService == null) {
            Log.w(TAG, "stop() called before start()");
            return true;
            return;
        }

        // Step 9: Clear active device and stop playing audio
@@ -260,8 +258,6 @@ public class A2dpService extends ProfileService {
        // Step 1: Clear AdapterService, AudioManager
        mAudioManager = null;
        mAdapterService = null;

        return true;
    }

    @Override
+2 −4
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,11 +110,10 @@ public class A2dpSinkService extends ProfileService {
        }

        setA2dpSinkService(this);
        return true;
    }

    @Override
    protected boolean stop() {
    protected void stop() {
        setA2dpSinkService(null);
        mNativeInterface.cleanup();
        for (A2dpSinkStateMachine stateMachine : mDeviceStateMap.values()) {
@@ -127,7 +126,6 @@ public class A2dpSinkService extends ProfileService {
                mA2dpSinkStreamHandler = null;
            }
        }
        return true;
    }

    public static synchronized A2dpSinkService getA2dpSinkService() {
+3 −5
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,16 +241,15 @@ public class AvrcpTargetService extends ProfileService {

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

    @Override
    protected boolean stop() {
    protected void stop() {
        Log.i(TAG, "Stopping the AVRCP Target Service");

        if (sInstance == null) {
            Log.w(TAG, "stop() called before start()");
            return true;
            return;
        }

        if (mAvrcpCoverArtService != null) {
@@ -272,7 +271,6 @@ public class AvrcpTargetService extends ProfileService {
        mNativeInterface = null;
        mAudioManager = null;
        mReceiver = null;
        return true;
    }

    private void init() {
+2 −4
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,11 +166,10 @@ public class AvrcpControllerService extends ProfileService {
        Intent startIntent = new Intent(this, BluetoothMediaBrowserService.class);
        startService(startIntent);
        setActiveDevice(null);
        return true;
    }

    @Override
    protected synchronized boolean stop() {
    protected synchronized void stop() {
        setActiveDevice(null);
        Intent stopIntent = new Intent(this, BluetoothMediaBrowserService.class);
        stopService(stopIntent);
@@ -188,7 +187,6 @@ public class AvrcpControllerService extends ProfileService {
        }
        setComponentAvailable(ON_ERROR_SETTINGS_ACTIVITY, false);
        mNativeInterface.cleanup();
        return true;
    }

    public static AvrcpControllerService getAvrcpControllerService() {
+3 −7
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,18 +99,16 @@ public class BatteryService extends ProfileService {
        mStateMachinesThread.start();

        setBatteryService(this);

        return true;
    }

    @Override
    protected boolean stop() {
    protected void stop() {
        if (DBG) {
            Log.d(TAG, "stop()");
        }
        if (sBatteryService == null) {
            Log.w(TAG, "stop() called before start()");
            return true;
            return;
        }

        setBatteryService(null);
@@ -142,8 +140,6 @@ public class BatteryService extends ProfileService {
        }

        mAdapterService = null;

        return true;
    }

    @Override
Loading