Skip to content

Commit

Permalink
reorder init of system service to avoid use before init issue
Browse files Browse the repository at this point in the history
  • Loading branch information
crc-32 committed Jan 6, 2025
1 parent 7d931cf commit 77323c5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ open class PebbleDevice(

val appMessageTransactionSequence = AppMessageTransactionSequence().iterator()

// Required for the system handler
val systemService: SystemService by inject {parametersOf(protocolHandler)}

init {
// This will init all the handlers by reading the lazy value causing them to be injected
negotiationScope.launch {
Expand All @@ -68,7 +71,6 @@ open class PebbleDevice(
val appRunStateService: AppRunStateService by inject {parametersOf(protocolHandler)}
val blobDBService: BlobDBService by inject {parametersOf(protocolHandler)}
val appMessageService: AppMessageService by inject {parametersOf(protocolHandler)}
val systemService: SystemService by inject {parametersOf(protocolHandler)}
val musicService: MusicService by inject {parametersOf(protocolHandler)}
val putBytesService: PutBytesService by inject {parametersOf(protocolHandler)}
val phoneControlService: PhoneControlService by inject {parametersOf(protocolHandler)}
Expand Down

0 comments on commit 77323c5

Please sign in to comment.