17 Companion Device pairing
Petr Vaněk edited this page 3 months ago

On phones running Android 8.0 (API level 26) and higher, it's possible to use companion device pairing. It is recommended to use this setting, especially on Android 10 and higher as without it for example the Find phone feature cannot work correctly.

After the device is paired using this method, the device can leverage the REQUEST_COMPANION_RUN_IN_BACKGROUND permission to start the app from the background. This provides a better way for Gadgetbridge to keep its service running, read more about background service stability here.

In the future there might be a possibility to use companion device pairing to perform a Bluetooth (or Wi-Fi) scan of nearby devices, without requiring the ACCESS_FINE_LOCATION or BLUETOOTH_ADMIN permission. This would minimize the number of permissions needed. Currently, these permissions are still required. See more details here: https://developer.android.com/guide/topics/connectivity/companion-device-pairing

To utilize this in Gadgetbridge, enable the Companion device pairing in the setting and add your new device via the plus icon icon.

For devices already in Gadgetbridge, you must re-pair (re-bond) them: keep you device added in Gadgetbridge, un-pair it in your phone's bluetooth settings, disable "Ignore paired devices" in the settings. After that is done, you can simply disconnect it (long tap the device in Gadgetbridge Control Center) and press the plus icon icon, locate the device in the list (it might say Already bonded), tap it and follow the process.

See step by step:

  • Disconnect first:
  • Disconnected:
  • Tap the plus icon and select device in the list:
  • Follow the process:
  • Select OK on the Link question: