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

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

Merge changes I1becd298,I7e580b42 into main

* changes:
  BluetoothProfileConnector: Remove mProfileName
  Make BluetoothProfileConnector final
parents 1a1d0e37 0791c59e
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.AttributionSource;
import android.content.Context;
import android.os.Build;
import android.os.IBinder;
import android.os.ParcelUuid;
import android.os.RemoteException;
import android.util.Log;
@@ -271,14 +270,9 @@ public final class BluetoothA2dp implements BluetoothProfile {

    private final BluetoothAdapter mAdapter;
    private final AttributionSource mAttributionSource;
    private final BluetoothProfileConnector<IBluetoothA2dp> mProfileConnector =
            new BluetoothProfileConnector(this, BluetoothProfile.A2DP, "BluetoothA2dp",
                    IBluetoothA2dp.class.getName()) {
                @Override
                public IBluetoothA2dp getServiceInterface(IBinder service) {
                    return IBluetoothA2dp.Stub.asInterface(service);
                }
    };
    private final BluetoothProfileConnector mProfileConnector =
            new BluetoothProfileConnector(
                    this, BluetoothProfile.A2DP, IBluetoothA2dp.class.getName());

    /**
     * Create a BluetoothA2dp proxy object for interacting with the local
@@ -301,7 +295,7 @@ public final class BluetoothA2dp implements BluetoothProfile {
    }

    private IBluetoothA2dp getService() {
        return mProfileConnector.getService();
        return IBluetoothA2dp.Stub.asInterface(mProfileConnector.getService());
    }

    @Override
+4 −10
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.AttributionSource;
import android.content.Context;
import android.os.Build;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;

@@ -85,14 +84,9 @@ public final class BluetoothA2dpSink implements BluetoothProfile {

    private final BluetoothAdapter mAdapter;
    private final AttributionSource mAttributionSource;
    private final BluetoothProfileConnector<IBluetoothA2dpSink> mProfileConnector =
            new BluetoothProfileConnector(this, BluetoothProfile.A2DP_SINK,
                    "BluetoothA2dpSink", IBluetoothA2dpSink.class.getName()) {
                @Override
                public IBluetoothA2dpSink getServiceInterface(IBinder service) {
                    return IBluetoothA2dpSink.Stub.asInterface(service);
                }
    };
    private final BluetoothProfileConnector mProfileConnector =
            new BluetoothProfileConnector(
                    this, BluetoothProfile.A2DP_SINK, IBluetoothA2dpSink.class.getName());

    /**
     * Create a BluetoothA2dp proxy object for interacting with the local
@@ -112,7 +106,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile {
    }

    private IBluetoothA2dpSink getService() {
        return mProfileConnector.getService();
        return IBluetoothA2dpSink.Stub.asInterface(mProfileConnector.getService());
    }

    @Override
+6 −10
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.bluetooth.annotations.RequiresBluetoothConnectPermission;
import android.bluetooth.annotations.RequiresLegacyBluetoothPermission;
import android.content.AttributionSource;
import android.content.Context;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;

@@ -92,14 +91,11 @@ public final class BluetoothAvrcpController implements BluetoothProfile {

    private final BluetoothAdapter mAdapter;
    private final AttributionSource mAttributionSource;
    private final BluetoothProfileConnector<IBluetoothAvrcpController> mProfileConnector =
            new BluetoothProfileConnector(this, BluetoothProfile.AVRCP_CONTROLLER,
                    "BluetoothAvrcpController", IBluetoothAvrcpController.class.getName()) {
                @Override
                public IBluetoothAvrcpController getServiceInterface(IBinder service) {
                    return IBluetoothAvrcpController.Stub.asInterface(service);
                }
    };
    private final BluetoothProfileConnector mProfileConnector =
            new BluetoothProfileConnector(
                    this,
                    BluetoothProfile.AVRCP_CONTROLLER,
                    IBluetoothAvrcpController.class.getName());

    /**
     * Create a BluetoothAvrcpController proxy object for interacting with the local
@@ -119,7 +115,7 @@ public final class BluetoothAvrcpController implements BluetoothProfile {
    }

    private IBluetoothAvrcpController getService() {
        return mProfileConnector.getService();
        return IBluetoothAvrcpController.Stub.asInterface(mProfileConnector.getService());
    }

    @Override
+6 −10
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.content.AttributionSource;
import android.content.Context;
import android.os.IBinder;
import android.os.ParcelUuid;
import android.os.RemoteException;
import android.util.CloseGuard;
@@ -207,14 +206,11 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto

    private final BluetoothAdapter mAdapter;
    private final AttributionSource mAttributionSource;
    private final BluetoothProfileConnector<IBluetoothCsipSetCoordinator> mProfileConnector =
            new BluetoothProfileConnector(this, BluetoothProfile.CSIP_SET_COORDINATOR, TAG,
                    IBluetoothCsipSetCoordinator.class.getName()) {
                @Override
                public IBluetoothCsipSetCoordinator getServiceInterface(IBinder service) {
                    return IBluetoothCsipSetCoordinator.Stub.asInterface(service);
                }
            };
    private final BluetoothProfileConnector mProfileConnector =
            new BluetoothProfileConnector(
                    this,
                    BluetoothProfile.CSIP_SET_COORDINATOR,
                    IBluetoothCsipSetCoordinator.class.getName());

    /**
     * Create a BluetoothCsipSetCoordinator proxy object for interacting with the local
@@ -246,7 +242,7 @@ public final class BluetoothCsipSetCoordinator implements BluetoothProfile, Auto
    }

    private IBluetoothCsipSetCoordinator getService() {
        return mProfileConnector.getService();
        return IBluetoothCsipSetCoordinator.Stub.asInterface(mProfileConnector.getService());
    }

    /**
+4 −11
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import android.annotation.SystemApi;
import android.bluetooth.annotations.RequiresBluetoothConnectPermission;
import android.content.AttributionSource;
import android.content.Context;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.CloseGuard;
import android.util.Log;
@@ -506,15 +505,9 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable

    private final BluetoothAdapter mAdapter;
    private final AttributionSource mAttributionSource;
    private final BluetoothProfileConnector<IBluetoothHapClient> mProfileConnector =
            new BluetoothProfileConnector(this, BluetoothProfile.HAP_CLIENT, "BluetoothHapClient",
                    IBluetoothHapClient.class.getName()) {
                @Override
                public IBluetoothHapClient getServiceInterface(IBinder service) {
                    return IBluetoothHapClient.Stub.asInterface(service);
                }
            };

    private final BluetoothProfileConnector mProfileConnector =
            new BluetoothProfileConnector(
                    this, BluetoothProfile.HAP_CLIENT, IBluetoothHapClient.class.getName());

    /**
     * Create a BluetoothHapClient proxy object for interacting with the local
@@ -548,7 +541,7 @@ public final class BluetoothHapClient implements BluetoothProfile, AutoCloseable
    }

    private IBluetoothHapClient getService() {
        return mProfileConnector.getService();
        return IBluetoothHapClient.Stub.asInterface(mProfileConnector.getService());
    }

    /**
Loading