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

Commit 89a48677 authored by Pulkit Bhuwalka's avatar Pulkit Bhuwalka Committed by android-build-merger
Browse files

Get Bluetooth Class of Device

am: f5d79dd6

Change-Id: I116fd9e1e74f10d8b51d41a058982add301c289e
parents babe6692 f5d79dd6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ interface IBluetooth
    ParcelUuid[] getUuids();
    boolean setName(in String name);
    String getName();
    BluetoothClass getBluetoothClass();
    boolean setBluetoothClass(in BluetoothClass bluetoothClass);

    int getScanMode();
+1 −1
Original line number Diff line number Diff line
@@ -901,7 +901,7 @@ bt_status_t btif_get_adapter_property(bt_property_type_t type) {

  /* Allow get_adapter_property only for BDADDR and BDNAME if BT is disabled */
  if (!btif_is_enabled() && (type != BT_PROPERTY_BDADDR) &&
      (type != BT_PROPERTY_BDNAME))
      (type != BT_PROPERTY_BDNAME) && (type != BT_PROPERTY_CLASS_OF_DEVICE))
    return BT_STATUS_NOT_READY;

  req.read_req.bd_addr = RawAddress::kEmpty;
+6 −0
Original line number Diff line number Diff line
@@ -2418,6 +2418,12 @@ bt_status_t btif_dm_get_adapter_property(bt_property_t* prop) {
      prop->len = sizeof(uint32_t);
    } break;

    case BT_PROPERTY_CLASS_OF_DEVICE: {
      DEV_CLASS dev_class = BTA_DM_COD;
      memcpy(prop->val, dev_class, sizeof(DEV_CLASS));
      prop->len = sizeof(DEV_CLASS);
    } break;

    default:
      prop->len = 0;
      return BT_STATUS_FAIL;