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

Commit dc5ba2f4 authored by Himanshu Rawat's avatar Himanshu Rawat
Browse files

HidHost: Initialize HID DB version

Garbage value would get used if the HID DB version was not found

Test: mmm com.android.btservices
Bug: 332600034
Bug: 320762367
Change-Id: I574f334611d7a020278f1e6bb066dc9cb6224a0e
parent 38d2d4a5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -339,7 +339,7 @@ bt_status_t btif_storage_remove_hid_info(const tAclLinkSpec& link_spec) {
  btif_config_remove(bdstr, BTIF_STORAGE_KEY_HID_RECONNECT_ALLOWED);

  if (IS_FLAG_ENABLED(allow_switching_hid_and_hogp)) {
    int db_version;
    int db_version = 0;
    btif_config_get_int(bdstr, BTIF_STORAGE_KEY_HID_DB_VERSION, &db_version);
    if (db_version == STORAGE_HID_DB_VERSION) {
      btif_config_remove(bdstr, BTIF_STORAGE_KEY_HOGP_ATTR_MASK);
@@ -350,9 +350,9 @@ bt_status_t btif_storage_remove_hid_info(const tAclLinkSpec& link_spec) {
      btif_config_remove(bdstr, BTIF_STORAGE_KEY_HOGP_VERSION);
      btif_config_remove(bdstr, BTIF_STORAGE_KEY_HOGP_COUNTRY_CODE);
      btif_config_remove(bdstr, BTIF_STORAGE_KEY_HOGP_DESCRIPTOR);
      btif_config_remove(bdstr, BTIF_STORAGE_KEY_HID_DB_VERSION);
      btif_config_remove(bdstr, BTIF_STORAGE_KEY_HOGP_RECONNECT_ALLOWED);
    }
    btif_config_remove(bdstr, BTIF_STORAGE_KEY_HID_DB_VERSION);
  }
  return BT_STATUS_SUCCESS;
}