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

Commit 15aa546a authored by Ryan Lin's avatar Ryan Lin Committed by Android (Google) Code Review
Browse files

Merge "Add Bluetooth callback for device connection state changed" into pi-dev

parents 9959b366 44de3a07
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -94,6 +94,11 @@ public class A2dpProfile implements LocalBluetoothProfile {
        return mIsProfileReady;
    }

    @Override
    public int getProfileId() {
        return BluetoothProfile.A2DP;
    }

    A2dpProfile(Context context, LocalBluetoothAdapter adapter,
            CachedBluetoothDeviceManager deviceManager,
            LocalBluetoothProfileManager profileManager) {
+5 −0
Original line number Diff line number Diff line
@@ -85,6 +85,11 @@ final class A2dpSinkProfile implements LocalBluetoothProfile {
        return mIsProfileReady;
    }

    @Override
    public int getProfileId() {
        return BluetoothProfile.A2DP_SINK;
    }

    A2dpSinkProfile(Context context, LocalBluetoothAdapter adapter,
            CachedBluetoothDeviceManager deviceManager,
            LocalBluetoothProfileManager profileManager) {
+3 −0
Original line number Diff line number Diff line
@@ -30,4 +30,7 @@ public interface BluetoothCallback {
    void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state);
    void onActiveDeviceChanged(CachedBluetoothDevice activeDevice, int bluetoothProfile);
    void onAudioModeChanged();
    default void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice,
            int state, int bluetoothProfile) {
    }
}
+9 −0
Original line number Diff line number Diff line
@@ -497,4 +497,13 @@ public class BluetoothEventManager {
            }
        }
    }

    void dispatchProfileConnectionStateChanged(CachedBluetoothDevice device, int state,
            int bluetoothProfile) {
        synchronized (mCallbacks) {
            for (BluetoothCallback callback : mCallbacks) {
                callback.onProfileConnectionStateChanged(device, state, bluetoothProfile);
            }
        }
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -92,6 +92,11 @@ public class HeadsetProfile implements LocalBluetoothProfile {
        return mIsProfileReady;
    }

    @Override
    public int getProfileId() {
        return BluetoothProfile.HEADSET;
    }

    HeadsetProfile(Context context, LocalBluetoothAdapter adapter,
            CachedBluetoothDeviceManager deviceManager,
            LocalBluetoothProfileManager profileManager) {
Loading