The app scans for known Bluetooth LE devices.
If one is found, the user is prompted to accept its enrollment.
The service is started and keep waiting some intents.
The intents declared in the manifest are:
AddReceiverText(BTPair,
<intent-filter>
<action android:name="android.bluetooth.device.action.PAIRING_REQUEST" />
<action android:name="android.bluetooth.device.action.BOND_BONDING" />
<action android:name="android.bluetooth.device.action.BOND_BONDED" />
<action android:name="android.bluetooth.device.action.BOND_STATE_CHANGED"/>
</intent-filter>)
Now the app reads an encrypted characteristic, and this triggers the pairing by the OS.
Depending of the results the app creates some buttons to control the device.
In Android 10 the service is not working, but looking for errors in an USB connected device with Android 10, I found this text:
...
Background execution not allowed: receiving Intent { act=android.bluetooth.device.action.BOND_STATE_CHANGED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
onCreate
Background execution not allowed: receiving Intent { act=android.bluetooth.device.action.BOND_STATE_CHANGED flg=0x10 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa.broadcastreceiver.external.ExternalCommonBroadcastReceiver
onUidStateChanged: uid=10050, procState=11
Background execution not allowed: receiving Intent { act=android.bluetooth.device.action.BOND_STATE_CHANGED flg=0x10 (has extras) } to com.samsung.android.app.watchmanagerstub/com.sec.android.applicationmgr.WMStubBroadCastReceiver
Background execution not allowed: receiving Intent { act=android.bluetooth.device.action.BOND_STATE_CHANGED flg=0x10 (has extras) } to com.samsung.android.easysetup/.icmanager.IcBtStatusBroadcastReceiver
Background execution not allowed: receiving Intent { act=android.bluetooth.device.action.BOND_STATE_CHANGED flg=0x10 (has extras) } to my.test.app/.btpair$btpair_BR
...