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

Commit b37f2398 authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

LE: Use random address when initiating background connections

When re-connecting to HID devices, the first reconnection immediately
after a reboot incorrectly uses the static, public Bluetooth address of
the phone/tablet as the own address.

This patch fixes the Bluetooth initialization sequence to make sure
privacy is enabled before any Bluetooth services are started.

Bug: 16952502
Change-Id: I43e595ddc7e347fab972b059382b512fb03e9459
parent 5c058990
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -1495,6 +1495,11 @@ static void btif_dm_upstreams_evt(UINT16 event, char* p_param)
                 BTA_DmSetDeviceName(btif_get_default_local_name());
             }

#if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
             /* Enable local privacy */
             BTA_DmBleConfigLocalPrivacy(TRUE);
#endif

             /* for each of the enabled services in the mask, trigger the profile
              * enable */
             service_mask = btif_get_enabled_services_mask();
@@ -1517,12 +1522,6 @@ static void btif_dm_upstreams_evt(UINT16 event, char* p_param)
             btif_storage_load_autopair_device_list();

             btif_enable_bluetooth_evt(p_data->enable.status, p_data->enable.bd_addr);

             #if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
             /* Enable local privacy */
             /*TODO  Should this call be exposed to JAVA...? */
             BTA_DmBleConfigLocalPrivacy(TRUE);
             #endif
        }
        break;