diff --git a/api/core/ble/navigation.html b/api/core/ble/navigation.html index 565ce8acac..e40b0071fb 100644 --- a/api/core/ble/navigation.html +++ b/api/core/ble/navigation.html @@ -457,16 +457,41 @@
org.meshtastic.core.common.stateSkip to content
-
-
- FirmwareMaintenanceLock -
-
-
+
+
+ +
+
+ + +
+ +
+
+ +
+
+
+ +
@@ -6852,17 +6877,42 @@
-
+
-
+
+ +
+ +
+
+ STOP +
+
+
+ + -
+
diff --git a/api/core/common/navigation.html b/api/core/common/navigation.html index 565ce8acac..e40b0071fb 100644 --- a/api/core/common/navigation.html +++ b/api/core/common/navigation.html @@ -457,16 +457,41 @@ - -
@@ -6852,17 +6877,42 @@
-
+
-
+
+ +
+ +
+
+ STOP +
+
+
+ + -
+
diff --git a/api/core/common/org.meshtastic.core.common.state/-operation-lease/index.html b/api/core/common/org.meshtastic.core.common.state/-operation-lease/index.html new file mode 100644 index 0000000000..5c831b1c91 --- /dev/null +++ b/api/core/common/org.meshtastic.core.common.state/-operation-lease/index.html @@ -0,0 +1,141 @@ + + + + + OperationLease + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+

OperationLease

+

One holder's claim on a RadioOperation. Releasing a lease affects only that holder.

Identity matters: two concurrent claims on the same operation produce two distinct leases, so a late release from an abandoned holder cannot retire a live one.

+
+
+
+
+
+

Properties

+
+
+
+
+ + +
Link copied to clipboard
+
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+ + \ No newline at end of file diff --git a/api/core/common/org.meshtastic.core.common.state/-operation-lease/operation.html b/api/core/common/org.meshtastic.core.common.state/-operation-lease/operation.html new file mode 100644 index 0000000000..89f3be1975 --- /dev/null +++ b/api/core/common/org.meshtastic.core.common.state/-operation-lease/operation.html @@ -0,0 +1,117 @@ + + + + + operation + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+

operation

+
+ +
+ +
+
+
+ + \ No newline at end of file diff --git a/api/core/common/org.meshtastic.core.common.state/-firmware-maintenance-lock/-firmware-maintenance-lock.html b/api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/-radio-operation-lock.html similarity index 92% rename from api/core/common/org.meshtastic.core.common.state/-firmware-maintenance-lock/-firmware-maintenance-lock.html rename to api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/-radio-operation-lock.html index c110841590..f6314772d5 100644 --- a/api/core/common/org.meshtastic.core.common.state/-firmware-maintenance-lock/-firmware-maintenance-lock.html +++ b/api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/-radio-operation-lock.html @@ -2,7 +2,7 @@ - FirmwareMaintenanceLock + RadioOperationLock + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+

activeOperations

+
+

The distinct operations currently in flight.

+
+ +
+
+
+ + \ No newline at end of file diff --git a/api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/holders.html b/api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/holders.html new file mode 100644 index 0000000000..bbf848d84f --- /dev/null +++ b/api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/holders.html @@ -0,0 +1,117 @@ + + + + + holders + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+

holders

+
+
val holders: StateFlow<Map<Long, RadioOperation>>(source)

Every live lease, keyed by lease id. Emits on every acquire and release.

+
+ +
+
+
+ + \ No newline at end of file diff --git a/api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/index.html b/api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/index.html new file mode 100644 index 0000000000..e17ec57cfa --- /dev/null +++ b/api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/index.html @@ -0,0 +1,254 @@ + + + + + RadioOperationLock + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+

RadioOperationLock

+

Tracks which RadioOperations are in flight, so the rest of the app can keep out of their way.

Three consumers, which is why one lock replaced the single-purpose FirmwareMaintenanceLock it grew out of: SharedRadioInterfaceService reads suppressesTransport to stay off the device, MeshService reads holders to refuse to stop itself and to hold a wake lock, and the service notification reads it to say what is running.

Holders are tracked as individual leases rather than a set of operation types. The set was wrong: a caller that cancels a job and immediately starts a replacement — which FirmwareUpdateViewModel does, without joining — lets the cancelled job's finally run after the replacement has acquired, and a shared entry would be retired out from under the live holder. Two holders of the same operation are now independent.

Lives in :core:common because the parties sit in modules that cannot see each other: the flows that take an operation are in :feature:firmware and :feature:discovery, and the code that must respect it is in :core:service.

Process-local by design. A process death drops every lease, which is correct — nothing is in flight any more — but it means this narrows the window in which an interrupted flash can strand a device rather than closing it.

+
+
+
+
+
+

Constructors

+
+
+
+
+ + +
Link copied to clipboard
+
+
+
+
constructor()
+
+
+
+
+
+
+
+

Properties

+
+
+
+
+ + +
Link copied to clipboard
+
+
+
+

The distinct operations currently in flight.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
val holders: StateFlow<Map<Long, RadioOperation>>

Every live lease, keyed by lease id. Emits on every acquire and release.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+

True while any operation is in flight.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+

True while an operation that needs the transport off the device is in flight.

+
+
+
+
+
+
+
+

Functions

+
+
+
+
+ + +
Link copied to clipboard
+
+
+
+

Takes operation and returns the lease that holds it. Each call is a distinct holder.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
fun release(lease: OperationLease?)

Releases lease. Idempotent, and null-safe so a caller can release a hold it may never have taken.

+
+
+
+
+ +
+
+
+ + +
Link copied to clipboard
+
+
+
+
suspend fun <T> withOperation(operation: RadioOperation, block: suspend () -> T): T

Runs block with operation held, releasing that exact lease even on failure or cancellation.

+
+
+
+
+
+
+
+
+
+ +
+
+
+ + \ No newline at end of file diff --git a/api/core/common/org.meshtastic.core.common.state/-firmware-maintenance-lock/is-active.html b/api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/is-active.html similarity index 94% rename from api/core/common/org.meshtastic.core.common.state/-firmware-maintenance-lock/is-active.html rename to api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/is-active.html index 8f67ab0f17..772473079a 100644 --- a/api/core/common/org.meshtastic.core.common.state/-firmware-maintenance-lock/is-active.html +++ b/api/core/common/org.meshtastic.core.common.state/-radio-operation-lock/is-active.html @@ -89,12 +89,12 @@
-
- +
+

isActive

-

True while a maintenance sequence holds the lock.

+

True while any operation is in flight.