Loading sysprop/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -7,6 +7,7 @@ sysprop_library { host_supported: true, host_supported: true, srcs: [ srcs: [ "avrcp.sysprop", "avrcp.sysprop", "bta.sysprop", ], ], property_owner: "Platform", property_owner: "Platform", api_packages: ["android.sysprop"], api_packages: ["android.sysprop"], Loading sysprop/bta.sysprop 0 → 100644 +12 −0 Original line number Original line Diff line number Diff line module: "android.sysprop.bluetooth.Bta" owner: Platform prop { api_name: "disable_delay" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.bta.disable_delay.millis" } system/bta/Android.bp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -174,6 +174,7 @@ cc_library_static { ], ], static_libs: [ static_libs: [ "lib-bt-packets", "lib-bt-packets", "libcom.android.sysprop.bluetooth", ], ], host_supported: true, host_supported: true, min_sdk_version: "Tiramisu" min_sdk_version: "Tiramisu" Loading Loading @@ -303,6 +304,7 @@ cc_test { "libbt-common", "libbt-common", "libbt-protos-lite", "libbt-protos-lite", "libbtcore", "libbtcore", "libcom.android.sysprop.bluetooth", "libflatbuffers-cpp", "libflatbuffers-cpp", "libgmock", "libgmock", ], ], Loading Loading @@ -939,6 +941,7 @@ cc_test { "libgmock", "libgmock", "libbt-common", "libbt-common", "libbt-protos-lite", "libbt-protos-lite", "libcom.android.sysprop.bluetooth", "libosi", // ADDED "libosi", // ADDED ], ], generated_headers: [ generated_headers: [ Loading system/bta/dm/bta_dm_act.cc +14 −9 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,9 @@ #define LOG_TAG "bt_bta_dm" #define LOG_TAG "bt_bta_dm" #include <base/logging.h> #include <base/logging.h> #ifdef OS_ANDROID #include <bta.sysprop.h> #endif #include <cstdint> #include <cstdint> Loading Loading @@ -172,16 +175,18 @@ static void bta_dm_ctrl_features_rd_cmpl_cback(tHCI_STATUS result); #define PROPERTY_PAGE_TIMEOUT "bluetooth.core.classic.page_timeout" #define PROPERTY_PAGE_TIMEOUT "bluetooth.core.classic.page_timeout" #endif #endif namespace { // Time to wait after receiving shutdown request to delay the actual shutdown // Time to wait after receiving shutdown request to delay the actual shutdown // process. This time may be zero which invokes immediate shutdown. // process. This time may be zero which invokes immediate shutdown. #ifndef BTA_DISABLE_DELAY static uint64_t get_DisableDelayTimerInMs() { constexpr uint64_t kDisableDelayTimerInMs = 0; #ifndef OS_ANDROID return 200; #else #else constexpr uint64_t kDisableDelayTimerInMs = static const uint64_t kDisableDelayTimerInMs = static_cast<uint64_t>(BTA_DISABLE_DELAY); android::sysprop::bluetooth::Bta::disable_delay().value_or(200); return kDisableDelayTimerInMs; #endif #endif } namespace { struct WaitForAllAclConnectionsToDrain { struct WaitForAllAclConnectionsToDrain { uint64_t time_to_wait_in_ms; uint64_t time_to_wait_in_ms; Loading Loading @@ -469,15 +474,15 @@ void bta_dm_disable() { if (BTM_GetNumAclLinks() == 0) { if (BTM_GetNumAclLinks() == 0) { // We can shut down faster if there are no ACL links // We can shut down faster if there are no ACL links switch (kDisableDelayTimerInMs) { switch (get_DisableDelayTimerInMs()) { case 0: case 0: LOG_DEBUG("Immediately disabling device manager"); LOG_DEBUG("Immediately disabling device manager"); bta_dm_disable_conn_down_timer_cback(nullptr); bta_dm_disable_conn_down_timer_cback(nullptr); break; break; default: default: LOG_DEBUG("Set timer to delay disable initiation:%lu ms", LOG_DEBUG("Set timer to delay disable initiation:%lu ms", static_cast<unsigned long>(kDisableDelayTimerInMs)); static_cast<unsigned long>(get_DisableDelayTimerInMs())); alarm_set_on_mloop(bta_dm_cb.disable_timer, kDisableDelayTimerInMs, alarm_set_on_mloop(bta_dm_cb.disable_timer, get_DisableDelayTimerInMs(), bta_dm_disable_conn_down_timer_cback, nullptr); bta_dm_disable_conn_down_timer_cback, nullptr); } } } else { } else { Loading system/btif/Android.bp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -544,6 +544,7 @@ cc_test { "lib-bt-packets", "lib-bt-packets", "lib-bt-packets-avrcp", "lib-bt-packets-avrcp", "lib-bt-packets-base", "lib-bt-packets-base", "libcom.android.sysprop.bluetooth", "libc++fs", "libc++fs", "libflatbuffers-cpp", "libflatbuffers-cpp", "libgmock", "libgmock", Loading Loading @@ -665,6 +666,7 @@ cc_test { "lib-bt-packets", "lib-bt-packets", "lib-bt-packets-avrcp", "lib-bt-packets-avrcp", "lib-bt-packets-base", "lib-bt-packets-base", "libcom.android.sysprop.bluetooth", "libc++fs", "libc++fs", "libflatbuffers-cpp", "libflatbuffers-cpp", "libgmock", "libgmock", Loading Loading
sysprop/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -7,6 +7,7 @@ sysprop_library { host_supported: true, host_supported: true, srcs: [ srcs: [ "avrcp.sysprop", "avrcp.sysprop", "bta.sysprop", ], ], property_owner: "Platform", property_owner: "Platform", api_packages: ["android.sysprop"], api_packages: ["android.sysprop"], Loading
sysprop/bta.sysprop 0 → 100644 +12 −0 Original line number Original line Diff line number Diff line module: "android.sysprop.bluetooth.Bta" owner: Platform prop { api_name: "disable_delay" type: Integer scope: Internal access: Readonly prop_name: "bluetooth.bta.disable_delay.millis" }
system/bta/Android.bp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -174,6 +174,7 @@ cc_library_static { ], ], static_libs: [ static_libs: [ "lib-bt-packets", "lib-bt-packets", "libcom.android.sysprop.bluetooth", ], ], host_supported: true, host_supported: true, min_sdk_version: "Tiramisu" min_sdk_version: "Tiramisu" Loading Loading @@ -303,6 +304,7 @@ cc_test { "libbt-common", "libbt-common", "libbt-protos-lite", "libbt-protos-lite", "libbtcore", "libbtcore", "libcom.android.sysprop.bluetooth", "libflatbuffers-cpp", "libflatbuffers-cpp", "libgmock", "libgmock", ], ], Loading Loading @@ -939,6 +941,7 @@ cc_test { "libgmock", "libgmock", "libbt-common", "libbt-common", "libbt-protos-lite", "libbt-protos-lite", "libcom.android.sysprop.bluetooth", "libosi", // ADDED "libosi", // ADDED ], ], generated_headers: [ generated_headers: [ Loading
system/bta/dm/bta_dm_act.cc +14 −9 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,9 @@ #define LOG_TAG "bt_bta_dm" #define LOG_TAG "bt_bta_dm" #include <base/logging.h> #include <base/logging.h> #ifdef OS_ANDROID #include <bta.sysprop.h> #endif #include <cstdint> #include <cstdint> Loading Loading @@ -172,16 +175,18 @@ static void bta_dm_ctrl_features_rd_cmpl_cback(tHCI_STATUS result); #define PROPERTY_PAGE_TIMEOUT "bluetooth.core.classic.page_timeout" #define PROPERTY_PAGE_TIMEOUT "bluetooth.core.classic.page_timeout" #endif #endif namespace { // Time to wait after receiving shutdown request to delay the actual shutdown // Time to wait after receiving shutdown request to delay the actual shutdown // process. This time may be zero which invokes immediate shutdown. // process. This time may be zero which invokes immediate shutdown. #ifndef BTA_DISABLE_DELAY static uint64_t get_DisableDelayTimerInMs() { constexpr uint64_t kDisableDelayTimerInMs = 0; #ifndef OS_ANDROID return 200; #else #else constexpr uint64_t kDisableDelayTimerInMs = static const uint64_t kDisableDelayTimerInMs = static_cast<uint64_t>(BTA_DISABLE_DELAY); android::sysprop::bluetooth::Bta::disable_delay().value_or(200); return kDisableDelayTimerInMs; #endif #endif } namespace { struct WaitForAllAclConnectionsToDrain { struct WaitForAllAclConnectionsToDrain { uint64_t time_to_wait_in_ms; uint64_t time_to_wait_in_ms; Loading Loading @@ -469,15 +474,15 @@ void bta_dm_disable() { if (BTM_GetNumAclLinks() == 0) { if (BTM_GetNumAclLinks() == 0) { // We can shut down faster if there are no ACL links // We can shut down faster if there are no ACL links switch (kDisableDelayTimerInMs) { switch (get_DisableDelayTimerInMs()) { case 0: case 0: LOG_DEBUG("Immediately disabling device manager"); LOG_DEBUG("Immediately disabling device manager"); bta_dm_disable_conn_down_timer_cback(nullptr); bta_dm_disable_conn_down_timer_cback(nullptr); break; break; default: default: LOG_DEBUG("Set timer to delay disable initiation:%lu ms", LOG_DEBUG("Set timer to delay disable initiation:%lu ms", static_cast<unsigned long>(kDisableDelayTimerInMs)); static_cast<unsigned long>(get_DisableDelayTimerInMs())); alarm_set_on_mloop(bta_dm_cb.disable_timer, kDisableDelayTimerInMs, alarm_set_on_mloop(bta_dm_cb.disable_timer, get_DisableDelayTimerInMs(), bta_dm_disable_conn_down_timer_cback, nullptr); bta_dm_disable_conn_down_timer_cback, nullptr); } } } else { } else { Loading
system/btif/Android.bp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -544,6 +544,7 @@ cc_test { "lib-bt-packets", "lib-bt-packets", "lib-bt-packets-avrcp", "lib-bt-packets-avrcp", "lib-bt-packets-base", "lib-bt-packets-base", "libcom.android.sysprop.bluetooth", "libc++fs", "libc++fs", "libflatbuffers-cpp", "libflatbuffers-cpp", "libgmock", "libgmock", Loading Loading @@ -665,6 +666,7 @@ cc_test { "lib-bt-packets", "lib-bt-packets", "lib-bt-packets-avrcp", "lib-bt-packets-avrcp", "lib-bt-packets-base", "lib-bt-packets-base", "libcom.android.sysprop.bluetooth", "libc++fs", "libc++fs", "libflatbuffers-cpp", "libflatbuffers-cpp", "libgmock", "libgmock", Loading