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

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

Merge changes I617ebcc4,I43cd09fe,I71276483,Ie9a66d1e into main

* changes:
  MapClientServiceTest: Pass Looper in constructor
  BluetoothInstrumentationTests: Construct services
  BluetoothMapService: Move mState initialization to declaration
  SapService: Move mState initialization to declaration
parents 65acaf90 8dc32ac7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -133,10 +133,9 @@ public class A2dpService extends ProfileService {

    @VisibleForTesting
    A2dpService(Context ctx, A2dpNativeInterface nativeInterface, FeatureFlags featureFlags) {
        attachBaseContext(ctx);
        super(ctx);
        mNativeInterface = requireNonNull(nativeInterface);
        mFeatureFlags = featureFlags;
        onCreate();
    }

    public static boolean isEnabled() {
+1 −2
Original line number Diff line number Diff line
@@ -81,10 +81,9 @@ public class A2dpSinkService extends ProfileService {

    @VisibleForTesting
    A2dpSinkService(Context ctx, A2dpSinkNativeInterface nativeInterface, Looper looper) {
        attachBaseContext(ctx);
        super(ctx);
        mNativeInterface = requireNonNull(nativeInterface);
        mLooper = looper;
        onCreate();
    }

    public static boolean isEnabled() {
+7 −0
Original line number Diff line number Diff line
@@ -104,6 +104,13 @@ public class AvrcpTargetService extends ProfileService {

    private static AvrcpTargetService sInstance = null;

    AvrcpTargetService() {}

    @VisibleForTesting
    AvrcpTargetService(Context ctx) {
        super(ctx);
    }

    public static boolean isEnabled() {
        return BluetoothProperties.isProfileAvrcpTargetEnabled().orElse(false);
    }
+2 −3
Original line number Diff line number Diff line
@@ -139,10 +139,9 @@ public class AvrcpControllerService extends ProfileService {
    }

    @VisibleForTesting
    AvrcpControllerService(Context ctx, AvrcpControllerNativeInterface nativeInterface) {
        attachBaseContext(ctx);
    public AvrcpControllerService(Context ctx, AvrcpControllerNativeInterface nativeInterface) {
        super(ctx);
        mNativeInterface = requireNonNull(nativeInterface);
        onCreate();
    }

    public static boolean isEnabled() {
+8 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothUuid;
import android.bluetooth.IBluetoothBattery;
import android.content.AttributionSource;
import android.content.Context;
import android.os.HandlerThread;
import android.os.Handler;
import android.os.Looper;
@@ -65,6 +66,13 @@ public class BatteryService extends ProfileService {
    private Handler mHandler;
    private final Map<BluetoothDevice, BatteryStateMachine> mStateMachines = new HashMap<>();

    BatteryService() {}

    @VisibleForTesting
    BatteryService(Context ctx) {
        super(ctx);
    }

    public static boolean isEnabled() {
        return BluetoothProperties.isProfileBasClientEnabled().orElse(false);
    }
Loading