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

Commit 40b98951 authored by Ganesh Ganapathi Batta's avatar Ganesh Ganapathi Batta Committed by Matthew Xie
Browse files

Initial version of BLE support for Bluedroid

The API classes are hidden for now. Will unhide after API console
approval.
Change-Id: I8283dd562fd6189fdd15c866ef2efb8bbdbc4109
parent 5c1f3030
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -1136,8 +1136,9 @@ public final class BluetoothAdapter {
    /**
     * Get the profile proxy object associated with the profile.
     *
     * <p>Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET} or
     * {@link BluetoothProfile#A2DP}. Clients must implements
     * <p>Profile can be one of {@link BluetoothProfile#HEALTH}, {@link BluetoothProfile#HEADSET},
     * {@link BluetoothProfile#A2DP}, {@link BluetoothProfile#GATT},
     * or {@link BluetoothProfile#GATT_SERVER}. Clients must implements
     * {@link BluetoothProfile.ServiceListener} to get notified of
     * the connection status and to get the proxy object.
     *
@@ -1166,6 +1167,12 @@ public final class BluetoothAdapter {
        } else if (profile == BluetoothProfile.HEALTH) {
            BluetoothHealth health = new BluetoothHealth(context, listener);
            return true;
        } else if (profile == BluetoothProfile.GATT) {
            BluetoothGatt gatt = new BluetoothGatt(context, listener);
            return true;
        } else if (profile == BluetoothProfile.GATT_SERVER) {
            BluetoothGattServer gattServer = new BluetoothGattServer(context, listener);
            return true;
        } else {
            return false;
        }
@@ -1206,6 +1213,14 @@ public final class BluetoothAdapter {
                BluetoothHealth health = (BluetoothHealth)proxy;
                health.close();
                break;
           case BluetoothProfile.GATT:
                BluetoothGatt gatt = (BluetoothGatt)proxy;
                gatt.close();
                break;
            case BluetoothProfile.GATT_SERVER:
                BluetoothGattServer gattServer = (BluetoothGattServer)proxy;
                gattServer.close();
                break;
        }
    }

Loading