improve identity announcements (#198)

* improve identity announcements

* touches

* signing noise id

* panic mode delete signing key
This commit is contained in:
callebtc
2025-07-31 06:26:41 +02:00
committed by GitHub
parent 34d00839b2
commit 4cb5932fd0
15 changed files with 302 additions and 113 deletions
@@ -133,6 +133,13 @@ class BluetoothGattServerManager(
isClient = false
)
connectionTracker.addDeviceConnection(device.address, deviceConn)
connectionScope.launch {
delay(1000)
if (isActive) { // Check if still active
delegate?.onDeviceConnected(device)
}
}
}
BluetoothProfile.STATE_DISCONNECTED -> {
Log.i(TAG, "Server: Device disconnected ${device.address}")
@@ -204,9 +211,9 @@ class BluetoothGattServerManager(
}
if (BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE.contentEquals(value)) {
Log.d(TAG, "Device ${device.address} subscribed to notifications")
connectionTracker.addSubscribedDevice(device)
Log.d(TAG, "Server: Connection setup complete for ${device.address}")
connectionScope.launch {
delay(100)
if (isActive) { // Check if still active
@@ -272,7 +279,9 @@ class BluetoothGattServerManager(
*/
@Suppress("DEPRECATION")
private fun startAdvertising() {
if (!permissionManager.hasBluetoothPermissions() || bleAdvertiser == null || !isActive) return
if (!permissionManager.hasBluetoothPermissions() || bleAdvertiser == null || !isActive || bluetoothAdapter == null || !bluetoothAdapter.isMultipleAdvertisementSupported()) {
throw Exception("Missing Bluetooth permissions or BLE advertiser not available")
}
val settings = powerManager.getAdvertiseSettings()