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

Skip to content
Commit 25fc56ed authored by William Escande's avatar William Escande
Browse files

Add caching for {Map,Sap}.getConnectionState

BluetoothMap and BluetoothSap are heavily using their getConnectionState
method. By caching the value I intend to reduce drastically the number
of binder calls generated.
While performing a discovery, the caching is working on 80% of binder
calls. This value should be bigger when we kepp asking the value for the
same device. (currently everytime you ask the connection state of a new
device, you refresh the cache, there is no caching for multiples
devices).

I don't have any Map/Sap setup to test it, asking to test team if they
hit some issues

Fixing cache on BluetoothDevice by passing the device as parameter

Doing a refactoring of all cached method in bluetooth to keep code
consistency: AKA we try to do the most of check outside of the cache
query

Bug: 217366135
Test: Put some log to see the value being cached sometimes - need more testing
Ignore-AOSP-First: No caching api on AOSP
Change-Id: Iababf9f9068a181e277b400e786a4a67d4447dc8
parent 89f4da04
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment