Loading sysprop/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -9,6 +9,7 @@ sysprop_library { "avrcp.sysprop", "avrcp.sysprop", "bta.sysprop", "bta.sysprop", "hfp.sysprop", "hfp.sysprop", "pan.sysprop", ], ], property_owner: "Platform", property_owner: "Platform", api_packages: ["android.sysprop"], api_packages: ["android.sysprop"], Loading sysprop/pan.sysprop 0 → 100644 +10 −0 Original line number Original line Diff line number Diff line module: "android.sysprop.bluetooth.Pan" owner: Platform prop { api_name: "nap" type: Boolean scope: Internal access: Readonly prop_name: "bluetooth.pan.nap.enabled" } system/btif/src/btif_pan.cc +16 −3 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,9 @@ #include <linux/if_ether.h> #include <linux/if_ether.h> #include <linux/if_tun.h> #include <linux/if_tun.h> #include <net/if.h> #include <net/if.h> #ifdef OS_ANDROID #include <pan.sysprop.h> #endif #include <poll.h> #include <poll.h> #include <sys/ioctl.h> #include <sys/ioctl.h> #include <unistd.h> #include <unistd.h> Loading Loading @@ -93,6 +96,16 @@ static btpan_interface_t pan_if = { const btpan_interface_t* btif_pan_get_interface() { return &pan_if; } const btpan_interface_t* btif_pan_get_interface() { return &pan_if; } static bool pan_nap_is_enabled() { #ifdef OS_ANDROID // replace build time config PAN_NAP_DISABLED with runtime static const bool nap_is_enabled = android::sysprop::bluetooth::Pan::nap().value_or(true); return nap_is_enabled; #else return true; #endif } /******************************************************************************* /******************************************************************************* ** ** ** Function btif_pan_init ** Function btif_pan_init Loading @@ -118,9 +131,9 @@ void btif_pan_init() { btpan_cb.enabled = 1; btpan_cb.enabled = 1; int role = BTPAN_ROLE_NONE; int role = BTPAN_ROLE_NONE; #if PAN_NAP_DISABLED == FALSE if (pan_nap_is_enabled()) { role |= BTPAN_ROLE_PANNAP; role |= BTPAN_ROLE_PANNAP; #endif } #if PANU_DISABLED == FALSE #if PANU_DISABLED == FALSE role |= BTPAN_ROLE_PANU; role |= BTPAN_ROLE_PANU; #endif #endif Loading system/internal_include/bt_target.h +0 −4 Original line number Original line Diff line number Diff line Loading @@ -814,10 +814,6 @@ #define PAN_INCLUDED TRUE #define PAN_INCLUDED TRUE #endif #endif #ifndef PAN_NAP_DISABLED #define PAN_NAP_DISABLED FALSE #endif #ifndef PANU_DISABLED #ifndef PANU_DISABLED #define PANU_DISABLED FALSE #define PANU_DISABLED FALSE #endif #endif Loading Loading
sysprop/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -9,6 +9,7 @@ sysprop_library { "avrcp.sysprop", "avrcp.sysprop", "bta.sysprop", "bta.sysprop", "hfp.sysprop", "hfp.sysprop", "pan.sysprop", ], ], property_owner: "Platform", property_owner: "Platform", api_packages: ["android.sysprop"], api_packages: ["android.sysprop"], Loading
sysprop/pan.sysprop 0 → 100644 +10 −0 Original line number Original line Diff line number Diff line module: "android.sysprop.bluetooth.Pan" owner: Platform prop { api_name: "nap" type: Boolean scope: Internal access: Readonly prop_name: "bluetooth.pan.nap.enabled" }
system/btif/src/btif_pan.cc +16 −3 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,9 @@ #include <linux/if_ether.h> #include <linux/if_ether.h> #include <linux/if_tun.h> #include <linux/if_tun.h> #include <net/if.h> #include <net/if.h> #ifdef OS_ANDROID #include <pan.sysprop.h> #endif #include <poll.h> #include <poll.h> #include <sys/ioctl.h> #include <sys/ioctl.h> #include <unistd.h> #include <unistd.h> Loading Loading @@ -93,6 +96,16 @@ static btpan_interface_t pan_if = { const btpan_interface_t* btif_pan_get_interface() { return &pan_if; } const btpan_interface_t* btif_pan_get_interface() { return &pan_if; } static bool pan_nap_is_enabled() { #ifdef OS_ANDROID // replace build time config PAN_NAP_DISABLED with runtime static const bool nap_is_enabled = android::sysprop::bluetooth::Pan::nap().value_or(true); return nap_is_enabled; #else return true; #endif } /******************************************************************************* /******************************************************************************* ** ** ** Function btif_pan_init ** Function btif_pan_init Loading @@ -118,9 +131,9 @@ void btif_pan_init() { btpan_cb.enabled = 1; btpan_cb.enabled = 1; int role = BTPAN_ROLE_NONE; int role = BTPAN_ROLE_NONE; #if PAN_NAP_DISABLED == FALSE if (pan_nap_is_enabled()) { role |= BTPAN_ROLE_PANNAP; role |= BTPAN_ROLE_PANNAP; #endif } #if PANU_DISABLED == FALSE #if PANU_DISABLED == FALSE role |= BTPAN_ROLE_PANU; role |= BTPAN_ROLE_PANU; #endif #endif Loading
system/internal_include/bt_target.h +0 −4 Original line number Original line Diff line number Diff line Loading @@ -814,10 +814,6 @@ #define PAN_INCLUDED TRUE #define PAN_INCLUDED TRUE #endif #endif #ifndef PAN_NAP_DISABLED #define PAN_NAP_DISABLED FALSE #endif #ifndef PANU_DISABLED #ifndef PANU_DISABLED #define PANU_DISABLED FALSE #define PANU_DISABLED FALSE #endif #endif Loading