14 Companion Device pairing
TaaviE edited this page 2 weeks ago

On phones running Android 8.0 (API level 26) and higher, it’s possible to use companion device pairing. 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.

Currently not implemented, but there’s the 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. See more details here: https://developer.android.com/guide/topics/connectivity/companion-device-pairing

To utilize this in Gadgetbridge, first enable it in the settings and then you must re-pair your device. You can either un-pair it in your phone’s settings and re-pair it, or 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:
disconnect
  • Disconnected:
disconnected
  • Tap the plus icon and select device in the list:
list
  • Follow the process:
pairing
  • Select OK on the Link question:
linking