From 37c88107679d36c419572732b4af6e18bb2f7dce Mon Sep 17 00:00:00 2001 From: Ajay Panicker Date: Thu, 17 Mar 2016 17:09:24 -0700 Subject: Add guest mode functionality (2/3) Add a flag to enable() to start Bluetooth in restricted mode. In restricted mode, all devices that are paired during restricted mode are deleted upon leaving restricted mode. Right now restricted mode is only entered while a guest user is active. Bug: 27410683 Change-Id: I8f23d28ef0aa3a8df13d469c73005c8e1b894d19 --- btif/include/btif_api.h | 17 +++++++++++++++++ btif/include/btif_storage.h | 12 ++++++++++++ 2 files changed, 29 insertions(+) (limited to 'btif/include') diff --git a/btif/include/btif_api.h b/btif/include/btif_api.h index 62687d38d..6bb1d3978 100644 --- a/btif/include/btif_api.h +++ b/btif/include/btif_api.h @@ -85,6 +85,23 @@ bt_status_t btif_disable_bluetooth(void); *******************************************************************************/ bt_status_t btif_shutdown_bluetooth(void); +/******************************************************************************* +** +** Function is_restricted_mode +** +** Description Checks if BT was enabled in restriced mode. In restricted +** mode, bonds that are created are marked as temporary. +** These bonds persist until we leave restricted mode, at +** which point they will be deleted from the config. Also +** while in restricted mode, the user can access devices +** that are already paired before entering restricted mode, +** but they cannot remove any of these devices. +** +** Returns bool +** +*******************************************************************************/ +bool is_restricted_mode(void); + /******************************************************************************* ** ** Function btif_get_adapter_properties diff --git a/btif/include/btif_storage.h b/btif/include/btif_storage.h index 7763d3a3d..26384e136 100644 --- a/btif/include/btif_storage.h +++ b/btif/include/btif_storage.h @@ -309,6 +309,18 @@ bt_status_t btif_storage_add_device_to_autopair_blacklist(bt_bdaddr_t *remote_bd *******************************************************************************/ BOOLEAN btif_storage_is_fixed_pin_zeros_keyboard(bt_bdaddr_t *remote_bd_addr); +/******************************************************************************* +** +** Function btif_storage_is_retricted_device +** +** Description BTIF storage API - checks if this device is a restricted device +** +** Returns TRUE if the device is labled as restricted +** FALSE otherwise +** +*******************************************************************************/ +BOOLEAN btif_storage_is_restricted_device(const bt_bdaddr_t *remote_bd_addr); + #if (BLE_INCLUDED == TRUE) bt_status_t btif_storage_add_ble_bonding_key( bt_bdaddr_t *remote_bd_addr, char *key, -- cgit v1.2.3