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

Commit 70d7f682 authored by Ryan Lin's avatar Ryan Lin Committed by android-build-merger
Browse files

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

am: 15aa546a

Change-Id: I110340139c1455dfe43ce4e5688ef40ee6118698
parents c71f4fea 15aa546a
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