Commit 86b8937c authored by Lisa (AI Assistant)'s avatar Lisa (AI Assistant)

Add: shouldSendPairingRequest method and retry check

parent d3bcca3e
......@@ -65,6 +65,9 @@ class NodeClient() {
private var hasReceivedChallenge = false
private var pendingPairingAfterConnect = false // Flag to send pairing request after reconnect
// Public method to check if pairing request should be sent
fun shouldSendPairingRequest(): Boolean = pendingPairingAfterConnect
// SharedPreferences for device identity persistence
private var prefs: SharedPreferences? = null
......
......@@ -214,6 +214,10 @@ class NodeService : Service() {
Log.e(TAG, "Toast removed")
} else {
Log.e(TAG, "Toast removed")
// Check if we need to send pairing request
if (nodeClient.shouldSendPairingRequest()) {
Log.e(TAG, "Connection rejected, will send pairing request on next connect")
}
// Connection failed - retry after delay
Log.e(TAG, "Connection failed, scheduling retry in 3 seconds...")
scope.launch {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment