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

Commit 5b0d6bb6 authored by David Duarte's avatar David Duarte Committed by Automerger Merge Worker
Browse files

Merge "ProfileService: Inline do{Start,Stop}" into main am: 73cc28d6

parents 7457d779 73cc28d6
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -148,7 +148,7 @@ public class A2dpService extends ProfileService {
    }
    }


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


    @Override
    @Override
    protected void stop() {
    public void stop() {
        Log.i(TAG, "stop()");
        Log.i(TAG, "stop()");
        if (sA2dpService == null) {
        if (sA2dpService == null) {
            Log.w(TAG, "stop() called before start()");
            Log.w(TAG, "stop() called before start()");
@@ -259,7 +259,7 @@ public class A2dpService extends ProfileService {
    }
    }


    @Override
    @Override
    protected void cleanup() {
    public void cleanup() {
        Log.i(TAG, "cleanup()");
        Log.i(TAG, "cleanup()");
    }
    }


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


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


    @Override
    @Override
    protected void stop() {
    public void stop() {
        setA2dpSinkService(null);
        setA2dpSinkService(null);
        mNativeInterface.cleanup();
        mNativeInterface.cleanup();
        for (A2dpSinkStateMachine stateMachine : mDeviceStateMap.values()) {
        for (A2dpSinkStateMachine stateMachine : mDeviceStateMap.values()) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -188,7 +188,7 @@ public class AvrcpTargetService extends ProfileService {
    }
    }


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


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


        if (sInstance == null) {
        if (sInstance == null) {
+2 −2
Original line number Original line Diff line number Diff line
@@ -150,7 +150,7 @@ public class AvrcpControllerService extends ProfileService {
    }
    }


    @Override
    @Override
    protected synchronized void start() {
    public synchronized void start() {
        mNativeInterface.init(this);
        mNativeInterface.init(this);
        setComponentAvailable(ON_ERROR_SETTINGS_ACTIVITY, true);
        setComponentAvailable(ON_ERROR_SETTINGS_ACTIVITY, true);
        mAdapterService = AdapterService.getAdapterService();
        mAdapterService = AdapterService.getAdapterService();
@@ -169,7 +169,7 @@ public class AvrcpControllerService extends ProfileService {
    }
    }


    @Override
    @Override
    protected synchronized void stop() {
    public synchronized void stop() {
        setActiveDevice(null);
        setActiveDevice(null);
        Intent stopIntent = new Intent(this, BluetoothMediaBrowserService.class);
        Intent stopIntent = new Intent(this, BluetoothMediaBrowserService.class);
        stopService(stopIntent);
        stopService(stopIntent);
+3 −3
Original line number Original line Diff line number Diff line
@@ -80,7 +80,7 @@ public class BatteryService extends ProfileService {
    }
    }


    @Override
    @Override
    protected void start() {
    public void start() {
        if (DBG) {
        if (DBG) {
            Log.d(TAG, "start()");
            Log.d(TAG, "start()");
        }
        }
@@ -102,7 +102,7 @@ public class BatteryService extends ProfileService {
    }
    }


    @Override
    @Override
    protected void stop() {
    public void stop() {
        if (DBG) {
        if (DBG) {
            Log.d(TAG, "stop()");
            Log.d(TAG, "stop()");
        }
        }
@@ -143,7 +143,7 @@ public class BatteryService extends ProfileService {
    }
    }


    @Override
    @Override
    protected void cleanup() {
    public void cleanup() {
        if (DBG) {
        if (DBG) {
            Log.d(TAG, "cleanup()");
            Log.d(TAG, "cleanup()");
        }
        }
Loading