restoreBluetoothAdapterName

Restores the device's global Bluetooth adapter name if a previous BluetoothServer advertising session overrode it (to advertise a custom local name) and was interrupted—e.g. by a process kill—before it could restore it. BluetoothServer restoration is best-effort and runs on graceful teardown; call this to also repair a leak from a prior process, for example from Application.onCreate, when the app does not build a server on startup.

The original name is only restored if the adapter still holds the overridden name, so a name the user or another app has since changed is never clobbered. Any stale record is cleared either way.

Return

true if the adapter name was restored

Parameters

context

the Context used to access the Bluetooth adapter and the stored override