Loading sysprop/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ sysprop_library { "avrcp.sysprop", "ble.sysprop", "bta.sysprop", "device_id.sysprop", "hfp.sysprop", ], property_owner: "Platform", Loading sysprop/device_id.sysprop 0 → 100644 +26 −0 Original line number Diff line number Diff line module: "android.sysprop.bluetooth.DeviceIDProperties" owner: Platform prop { api_name: "vendor_id" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.device_id.vendor_id" } prop { api_name: "vendor_id_source" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.device_id.vendor_id_source" } prop { api_name: "product_id" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.device_id.product_id" } sysprop/exported_include/android_bluetooth_sysprop.h +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <avrcp.sysprop.h> #include <ble.sysprop.h> #include <bta.sysprop.h> #include <device_id.sysprop.h> #include <hfp.sysprop.h> #define GET_SYSPROP(namespace, prop, default) \ Loading system/btif/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,7 @@ cc_library_static { "libbt-platform-protos-lite", "libbt-stack-core", "libbt_shim_bridge", "libcom.android.sysprop.bluetooth.wrapped", "libflatbuffers-cpp", "libstatslog_bt", ], Loading system/btif/src/btif_core.cc +21 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ #define LOG_TAG "bt_btif_core" #include <android_bluetooth_flags.h> #include <android_bluetooth_sysprop.h> #include <base/at_exit.h> #include <base/functional/bind.h> #include <base/logging.h> Loading Loading @@ -216,8 +218,25 @@ void btif_enable_bluetooth_evt() { GetInterfaceToProfiles()->onBluetoothEnabled(); /* load did configuration */ if (!IS_FLAG_ENABLED(load_did_config_from_sysprops)) { bte_load_did_conf(BTE_DID_CONF_FILE); } else { tSDP_DI_RECORD record = { .vendor = uint16_t( GET_SYSPROP(DeviceIDProperties, vendor_id, LMP_COMPID_GOOGLE)), .vendor_id_source = uint16_t(GET_SYSPROP( DeviceIDProperties, vendor_id_source, DI_VENDOR_ID_SOURCE_BTSIG)), .product = uint16_t(GET_SYSPROP(DeviceIDProperties, product_id, 0)), .primary_record = true, }; uint32_t record_handle; tBTA_STATUS status = BTA_DmSetLocalDiRecord(&record, &record_handle); if (status != BTA_SUCCESS) { log::error("unable to set device ID record error {}.", bta_status_text(status)); } } btif_dm_load_local_oob(); Loading Loading
sysprop/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ sysprop_library { "avrcp.sysprop", "ble.sysprop", "bta.sysprop", "device_id.sysprop", "hfp.sysprop", ], property_owner: "Platform", Loading
sysprop/device_id.sysprop 0 → 100644 +26 −0 Original line number Diff line number Diff line module: "android.sysprop.bluetooth.DeviceIDProperties" owner: Platform prop { api_name: "vendor_id" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.device_id.vendor_id" } prop { api_name: "vendor_id_source" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.device_id.vendor_id_source" } prop { api_name: "product_id" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.device_id.product_id" }
sysprop/exported_include/android_bluetooth_sysprop.h +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <avrcp.sysprop.h> #include <ble.sysprop.h> #include <bta.sysprop.h> #include <device_id.sysprop.h> #include <hfp.sysprop.h> #define GET_SYSPROP(namespace, prop, default) \ Loading
system/btif/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,7 @@ cc_library_static { "libbt-platform-protos-lite", "libbt-stack-core", "libbt_shim_bridge", "libcom.android.sysprop.bluetooth.wrapped", "libflatbuffers-cpp", "libstatslog_bt", ], Loading
system/btif/src/btif_core.cc +21 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ #define LOG_TAG "bt_btif_core" #include <android_bluetooth_flags.h> #include <android_bluetooth_sysprop.h> #include <base/at_exit.h> #include <base/functional/bind.h> #include <base/logging.h> Loading Loading @@ -216,8 +218,25 @@ void btif_enable_bluetooth_evt() { GetInterfaceToProfiles()->onBluetoothEnabled(); /* load did configuration */ if (!IS_FLAG_ENABLED(load_did_config_from_sysprops)) { bte_load_did_conf(BTE_DID_CONF_FILE); } else { tSDP_DI_RECORD record = { .vendor = uint16_t( GET_SYSPROP(DeviceIDProperties, vendor_id, LMP_COMPID_GOOGLE)), .vendor_id_source = uint16_t(GET_SYSPROP( DeviceIDProperties, vendor_id_source, DI_VENDOR_ID_SOURCE_BTSIG)), .product = uint16_t(GET_SYSPROP(DeviceIDProperties, product_id, 0)), .primary_record = true, }; uint32_t record_handle; tBTA_STATUS status = BTA_DmSetLocalDiRecord(&record, &record_handle); if (status != BTA_SUCCESS) { log::error("unable to set device ID record error {}.", bta_status_text(status)); } } btif_dm_load_local_oob(); Loading